Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: improve stop/wake queue tracing

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>

authored by

Emmanuel Grumbach and committed by
Johannes Berg
00e3daad 2bf50225

+20 -12
+14 -8
net/mac80211/trace.h
··· 3159 3159 3160 3160 TRACE_EVENT(wake_queue, 3161 3161 TP_PROTO(struct ieee80211_local *local, u16 queue, 3162 - enum queue_stop_reason reason), 3162 + enum queue_stop_reason reason, int refcount), 3163 3163 3164 - TP_ARGS(local, queue, reason), 3164 + TP_ARGS(local, queue, reason, refcount), 3165 3165 3166 3166 TP_STRUCT__entry( 3167 3167 LOCAL_ENTRY 3168 3168 __field(u16, queue) 3169 3169 __field(u32, reason) 3170 + __field(int, refcount) 3170 3171 ), 3171 3172 3172 3173 TP_fast_assign( 3173 3174 LOCAL_ASSIGN; 3174 3175 __entry->queue = queue; 3175 3176 __entry->reason = reason; 3177 + __entry->refcount = refcount; 3176 3178 ), 3177 3179 3178 3180 TP_printk( 3179 - LOCAL_PR_FMT " queue:%d, reason:%d", 3180 - LOCAL_PR_ARG, __entry->queue, __entry->reason 3181 + LOCAL_PR_FMT " queue:%d, reason:%d, refcount: %d", 3182 + LOCAL_PR_ARG, __entry->queue, __entry->reason, 3183 + __entry->refcount 3181 3184 ) 3182 3185 ); 3183 3186 3184 3187 TRACE_EVENT(stop_queue, 3185 3188 TP_PROTO(struct ieee80211_local *local, u16 queue, 3186 - enum queue_stop_reason reason), 3189 + enum queue_stop_reason reason, int refcount), 3187 3190 3188 - TP_ARGS(local, queue, reason), 3191 + TP_ARGS(local, queue, reason, refcount), 3189 3192 3190 3193 TP_STRUCT__entry( 3191 3194 LOCAL_ENTRY 3192 3195 __field(u16, queue) 3193 3196 __field(u32, reason) 3197 + __field(int, refcount) 3194 3198 ), 3195 3199 3196 3200 TP_fast_assign( 3197 3201 LOCAL_ASSIGN; 3198 3202 __entry->queue = queue; 3199 3203 __entry->reason = reason; 3204 + __entry->refcount = refcount; 3200 3205 ), 3201 3206 3202 3207 TP_printk( 3203 - LOCAL_PR_FMT " queue:%d, reason:%d", 3204 - LOCAL_PR_ARG, __entry->queue, __entry->reason 3208 + LOCAL_PR_FMT " queue:%d, reason:%d, refcount: %d", 3209 + LOCAL_PR_ARG, __entry->queue, __entry->reason, 3210 + __entry->refcount 3205 3211 ) 3206 3212 ); 3207 3213
+6 -4
net/mac80211/util.c
··· 437 437 { 438 438 struct ieee80211_local *local = hw_to_local(hw); 439 439 440 - trace_wake_queue(local, queue, reason); 441 - 442 440 if (WARN_ON(queue >= hw->queues)) 443 441 return; 444 442 ··· 453 455 454 456 if (local->q_stop_reasons[queue][reason] == 0) 455 457 __clear_bit(reason, &local->queue_stop_reasons[queue]); 458 + 459 + trace_wake_queue(local, queue, reason, 460 + local->q_stop_reasons[queue][reason]); 456 461 457 462 if (local->queue_stop_reasons[queue] != 0) 458 463 /* someone still has this queue stopped */ ··· 503 502 { 504 503 struct ieee80211_local *local = hw_to_local(hw); 505 504 506 - trace_stop_queue(local, queue, reason); 507 - 508 505 if (WARN_ON(queue >= hw->queues)) 509 506 return; 510 507 ··· 510 511 local->q_stop_reasons[queue][reason] = 1; 511 512 else 512 513 local->q_stop_reasons[queue][reason]++; 514 + 515 + trace_stop_queue(local, queue, reason, 516 + local->q_stop_reasons[queue][reason]); 513 517 514 518 set_bit(reason, &local->queue_stop_reasons[queue]); 515 519 }