]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: mac80211: improve stop/wake queue tracing
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 1 Jan 2025 05:05:28 +0000 (07:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 13 Jan 2025 14:26:44 +0000 (15:26 +0100)
Add the refcount. This can be useful when we want to understand why a
queue stays stopped after it is woken.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.bd320c6e6702.I6ae0f19d922aea1f28236d72bf260acac428fc02@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/trace.h
net/mac80211/util.c

index fe26fb46758d5f378df8e26d6b4fedc35eae48c8..72fad8ea8bb9aee2c44802f5918f853e745326f9 100644 (file)
@@ -3159,49 +3159,55 @@ TRACE_EVENT(api_finalize_rx_omi_bw,
 
 TRACE_EVENT(wake_queue,
        TP_PROTO(struct ieee80211_local *local, u16 queue,
-                enum queue_stop_reason reason),
+                enum queue_stop_reason reason, int refcount),
 
-       TP_ARGS(local, queue, reason),
+       TP_ARGS(local, queue, reason, refcount),
 
        TP_STRUCT__entry(
                LOCAL_ENTRY
                __field(u16, queue)
                __field(u32, reason)
+               __field(int, refcount)
        ),
 
        TP_fast_assign(
                LOCAL_ASSIGN;
                __entry->queue = queue;
                __entry->reason = reason;
+               __entry->refcount = refcount;
        ),
 
        TP_printk(
-               LOCAL_PR_FMT " queue:%d, reason:%d",
-               LOCAL_PR_ARG, __entry->queue, __entry->reason
+               LOCAL_PR_FMT " queue:%d, reason:%d, refcount: %d",
+               LOCAL_PR_ARG, __entry->queue, __entry->reason,
+               __entry->refcount
        )
 );
 
 TRACE_EVENT(stop_queue,
        TP_PROTO(struct ieee80211_local *local, u16 queue,
-                enum queue_stop_reason reason),
+                enum queue_stop_reason reason, int refcount),
 
-       TP_ARGS(local, queue, reason),
+       TP_ARGS(local, queue, reason, refcount),
 
        TP_STRUCT__entry(
                LOCAL_ENTRY
                __field(u16, queue)
                __field(u32, reason)
+               __field(int, refcount)
        ),
 
        TP_fast_assign(
                LOCAL_ASSIGN;
                __entry->queue = queue;
                __entry->reason = reason;
+               __entry->refcount = refcount;
        ),
 
        TP_printk(
-               LOCAL_PR_FMT " queue:%d, reason:%d",
-               LOCAL_PR_ARG, __entry->queue, __entry->reason
+               LOCAL_PR_FMT " queue:%d, reason:%d, refcount: %d",
+               LOCAL_PR_ARG, __entry->queue, __entry->reason,
+               __entry->refcount
        )
 );
 
index 5e8e5a1236ac361b8a3d5602ef74dfd5a5a873c6..f6b631faf4f7f99309466ec3b1d52f7a7acf450e 100644 (file)
@@ -437,8 +437,6 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
 {
        struct ieee80211_local *local = hw_to_local(hw);
 
-       trace_wake_queue(local, queue, reason);
-
        if (WARN_ON(queue >= hw->queues))
                return;
 
@@ -456,6 +454,9 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
        if (local->q_stop_reasons[queue][reason] == 0)
                __clear_bit(reason, &local->queue_stop_reasons[queue]);
 
+       trace_wake_queue(local, queue, reason,
+                        local->q_stop_reasons[queue][reason]);
+
        if (local->queue_stop_reasons[queue] != 0)
                /* someone still has this queue stopped */
                return;
@@ -502,8 +503,6 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
 {
        struct ieee80211_local *local = hw_to_local(hw);
 
-       trace_stop_queue(local, queue, reason);
-
        if (WARN_ON(queue >= hw->queues))
                return;
 
@@ -512,6 +511,9 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
        else
                local->q_stop_reasons[queue][reason]++;
 
+       trace_stop_queue(local, queue, reason,
+                        local->q_stop_reasons[queue][reason]);
+
        set_bit(reason, &local->queue_stop_reasons[queue]);
 }