Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp574565rdb; Mon, 29 Jan 2024 10:54:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLioRULsWpJCu3oUN+aIaI7I8gaR5LNY1JxNzaUPqgKVBc3ISznBKRlcwGmDDhJxTX0ScB X-Received: by 2002:a17:906:fa10:b0:a35:fe4c:e76b with SMTP id lo16-20020a170906fa1000b00a35fe4ce76bmr655105ejb.66.1706554499636; Mon, 29 Jan 2024 10:54:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554499; cv=pass; d=google.com; s=arc-20160816; b=PXoNQ42NVlgwTXow6g/yJ2utr1i+ifkV/wbLrnGKZrSJ5Hh71rekC/9lDIuJkAdY5N i4dVYDXXSOoWNeHNFXeN63SMlGXgXXfy1EoKl7v5dPLJcalUAq7kS+eBLHw0GjmOdx5j 0szaizlRRYvdHrCRzUL7WjQ07Wz5GezYWc2LCrd8m5+YpQOQmMOIxhig+AUgsN+FvJKk YNoLCyFjzZvC9R7taksJHzuduU9pqwl4ma3O2BO1MP9m0E6urNV6WVXpkSmk7HuYEGir ielYx7bZdzp6i6tociuwqFrEgSw8/WL/AdmM2mlsC3oNzLNz4pqv6LeJkUpujUMc8lIj ICqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=37o3qylp52nTac3iOIHQRZ32l/7H9m6JnA2e2jY+kTE=; fh=htkYrscpDo1naXhowhGO+vWwmzJPVJLnwRabf8Z18Z8=; b=FVTCZu5TghkXKAxcGPkXwxFJ8PR8H73EWVB5v/HEQvGTi14moapQakbd81YeQeFIE7 BHibVjZaWofvAGF7/uyM/FmPTreCfQUEVK3gcVBjbqJEM5JUdM36z+rnILGA8aivIvau o9D/hsmr+BNOud3QUsYyuctsjmACN/lSrmRgoTr0eoSHDfzREhzHJ9bT+tqvR99URC+6 xdczNG5sFf+Yiq94J4r2r44PwKDgFnND+IfRopfkgZ48eLwT6ZBh5YVSxH1iUC2rct26 dfImOIKH2ecmLA2vvGMBvQOyn6Ytge+d1h5ynR0DLVs6QNHk2/9VxxIJwdvXQKOR3Iu5 xnmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=LLoN5ZwB; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2697-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCW4S94AApc1g19YtLp0H7QOLnOeHTRZjUgRvGQVzbmrCZHsGCr5knFJsT8V63oeAra/1CTNSQ678YM5PHI8LrYEeJxSnO8ytZ5b0ajv/Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b24-20020a170906039800b00a35da54db3csi745213eja.979.2024.01.29.10.54.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:54:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=LLoN5ZwB; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2697-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 667151F273FB for ; Mon, 29 Jan 2024 18:54:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F3F8482C1; Mon, 29 Jan 2024 18:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="LLoN5ZwB" X-Original-To: linux-wireless@vger.kernel.org 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 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 Content-Transfer-Encoding: 8bit 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) -- 2.43.0