This is an automated email from the ASF dual-hosted git repository.

rymanluk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new bf1bc74dd nimble/ll: Count preempted periodic advertising PDUs
bf1bc74dd is described below

commit bf1bc74dddc510c9845041eab512e73ebeeb3992
Author: Ɓukasz Rymanowski <[email protected]>
AuthorDate: Mon Sep 28 17:52:49 2026 +0200

    nimble/ll: Count preempted periodic advertising PDUs
    
    A periodic advertising PDU is queued one periodic interval ahead. A
    BIG event is queued only one ISO interval ahead and uses preempt_any,
    so when they overlap the BIG event removes the periodic PDU from the
    scheduler later. The periodic event is then skipped without any
    statistic: periodic_adv_drop_event only counts a PDU that could not be
    inserted.
    
    Add periodic_adv_preempted, incremented whenever the scheduler removes
    a periodic advertising PDU (AUX_SYNC_IND or AUX_CHAIN_IND).
---
 nimble/controller/include/controller/ble_ll.h | 1 +
 nimble/controller/src/ble_ll.c                | 1 +
 nimble/controller/src/ble_ll_adv.c            | 1 +
 3 files changed, 3 insertions(+)

diff --git a/nimble/controller/include/controller/ble_ll.h 
b/nimble/controller/include/controller/ble_ll.h
index ab75edcba..a80152790 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -205,6 +205,7 @@ STATS_SECT_START(ble_ll_stats)
     STATS_SECT_ENTRY(scan_timer_restarted)
     STATS_SECT_ENTRY(periodic_adv_drop_event)
     STATS_SECT_ENTRY(periodic_chain_drop_event)
+    STATS_SECT_ENTRY(periodic_adv_preempted)
     STATS_SECT_ENTRY(sync_event_failed)
     STATS_SECT_ENTRY(sync_received)
     STATS_SECT_ENTRY(sync_chain_failed)
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index b04db7666..640796102 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -367,6 +367,7 @@ STATS_NAME_START(ble_ll_stats)
     STATS_NAME(ble_ll_stats, scan_timer_restarted)
     STATS_NAME(ble_ll_stats, periodic_adv_drop_event)
     STATS_NAME(ble_ll_stats, periodic_chain_drop_event)
+    STATS_NAME(ble_ll_stats, periodic_adv_preempted)
     STATS_NAME(ble_ll_stats, sync_event_failed)
     STATS_NAME(ble_ll_stats, sync_received)
     STATS_NAME(ble_ll_stats, sync_chain_failed)
diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 1b76c6f09..9da714aac 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -1108,6 +1108,7 @@ ble_ll_adv_preempted(struct ble_ll_adv_sm *advsm)
 void
 ble_ll_adv_periodic_rmvd_from_sched(struct ble_ll_adv_sm *advsm)
 {
+    STATS_INC(ble_ll_stats, periodic_adv_preempted);
     ble_ll_event_add(&advsm->adv_periodic_txdone_ev);
 }
 #endif

Reply via email to