wifi: mac80211: trace SMPS requests from driver
authorJohannes Berg <johannes.berg@intel.com>
Mon, 29 Jan 2024 18:54:35 +0000 (19:54 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 2 Feb 2024 13:20:42 +0000 (14:20 +0100)
Even if there are a lot of possible ways drivers might
call this, at least knowing when they do and with what
settings can be useful. Add tracing for it.

Link: https://msgid.link/20240129195435.b20d2ead2013.I8213e65c274451d523a3397519ac578c3ed2df4d@changeid
[removed link-id contortions as suggested by Jeff]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ht.c
net/mac80211/trace.h

index 749f4ecab99030310e6c5b82633f8cad85fe589b..bccc99a0038320b3a15a5c4c31b02475486be6bd 100644 (file)
@@ -9,7 +9,7 @@
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2007-2010, Intel Corporation
  * Copyright 2017      Intel Deutschland GmbH
- * Copyright(c) 2020-2023 Intel Corporation
+ * Copyright(c) 2020-2024 Intel Corporation
  */
 
 #include <linux/ieee80211.h>
@@ -603,6 +603,8 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, unsigned int link_id,
        if (WARN_ON(!link))
                goto out;
 
+       trace_api_request_smps(sdata->local, sdata, link, smps_mode);
+
        if (link->u.mgd.driver_smps_mode == smps_mode)
                goto out;
 
index 1c0c46b11c6d7363fb7c6d0330f5c650d1d665df..e2dde3e77c301fa123680941fab2b23f1a9eabc5 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Portions of this file
  * Copyright(c) 2016-2017 Intel Deutschland GmbH
- * Copyright (C) 2018 - 2023 Intel Corporation
+ * Copyright (C) 2018 - 2024 Intel Corporation
  */
 
 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
@@ -3035,6 +3035,34 @@ TRACE_EVENT(api_radar_detected,
        )
 );
 
+TRACE_EVENT(api_request_smps,
+       TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata,
+                struct ieee80211_link_data *link,
+                enum ieee80211_smps_mode smps_mode),
+
+       TP_ARGS(local, sdata, link, smps_mode),
+
+       TP_STRUCT__entry(
+               LOCAL_ENTRY
+               VIF_ENTRY
+               __field(int, link_id)
+               __field(u32, smps_mode)
+       ),
+
+       TP_fast_assign(
+               LOCAL_ASSIGN;
+               VIF_ASSIGN;
+               __entry->link_id = link->link_id,
+               __entry->smps_mode = smps_mode;
+       ),
+
+       TP_printk(
+               LOCAL_PR_FMT " " VIF_PR_FMT " link:%d, smps_mode:%d",
+               LOCAL_PR_ARG, VIF_PR_ARG, __entry->link_id, __entry->smps_mode
+       )
+);
+
 /*
  * Tracing for internal functions
  * (which may also be called in response to driver calls)