From patchwork Mon Jan 29 18:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13536227 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B140614AAA for ; Mon, 29 Jan 2024 18:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554481; cv=none; b=MOqBAVeMfpgwxiMp2nQA/P4u20FKhAhbM9VSPwp10clJdtqb1PeO8jDO6Fi7ZZ9okBh/LX7Gc64Fyn+eXwIhv8kHD6iMiR8lXO1J5O3f2gWmOPS3R2gWtK60Uuj/gl7dsgfX/DIfFFKTOiB/dB6VMtGGL4fLDyxpldL99q+ITR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554481; c=relaxed/simple; bh=rgBcZVoiIsjEY8WtVNwrSoEyjvm83AsS4QGRWgC/AJ4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hs2wes6/hpDMUqynDwR7EyH9fYr0dHZvottIJjdcNZomLA6xcGe8obrC8xtZslYe4DpS9Sb211b2Mem9W7/mZCmxJHfi14Agg/DO3NJEO1RRfGhQ1Q1K2MaW3czjJQRbQXU6CJ4lu6Ba/5/FWEF3la+ZeWe7sC7B2/bolR7P2mM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=LLoN5ZwB; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="LLoN5ZwB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=37o3qylp52nTac3iOIHQRZ32l/7H9m6JnA2e2jY+kTE=; t=1706554479; x=1707764079; b=LLoN5ZwBC4aBrGRxokqeR8BlX+JIR3xv2Mhc28+2dc8v0Sx1U8gu8oKbPUbn9yJjMs986ZXqkw/ 1PEyIMvjCXG9blWxMIp9A8wS3tFtLBsQ5e5HZP/nqZ0NRxkpWW524c+PB6hfHzxteepNK6i5TeODz XBx+E4Kx+EEyOt6fW9FFITR2lwAXIBFkMvdTjYZFlJ2YxBh+UdjeoHGYr9TyHd0F1ik1vHayBIpo1 Q5xiIKYP5BYdKHLvmJktYWMasZ0VTECCG5gheABijzH7hdxVDMgryNPkr7SFNNJvF3pN0VqYR4wIx TDQpKEZSLSB5KCxaFDk+gUZgQ4SjZ9FD/qdA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUWmD-00000004ziR-0ezo; Mon, 29 Jan 2024 19:54:37 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: trace SMPS requests from driver Date: Mon, 29 Jan 2024 19:54:35 +0100 Message-ID: <20240129195435.b20d2ead2013.I8213e65c274451d523a3397519ac578c3ed2df4d@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg 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. Signed-off-by: Johannes Berg --- net/mac80211/ht.c | 4 +++- net/mac80211/trace.h | 31 ++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index cfe2653ed47f..c3330aea4da3 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -9,7 +9,7 @@ * Copyright 2007, Michael Wu * Copyright 2007-2010, Intel Corporation * Copyright 2017 Intel Deutschland GmbH - * Copyright(c) 2020-2023 Intel Corporation + * Copyright(c) 2020-2024 Intel Corporation */ #include @@ -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; diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 2d0d969f0c3d..806e762aa546 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -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) @@ -3058,6 +3058,35 @@ 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 = + ieee80211_vif_is_mld(&sdata->vif) ? link->link_id : -1; + __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)