Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp357717rdb; Thu, 1 Feb 2024 10:21:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpSdxFY8NzM9qpyM4tAK8/5d/6L8VtNYgLbN/C+RtRkJKTg7PZlg+T9bXNGYoj4WUsPeOE X-Received: by 2002:a2e:7401:0:b0:2cc:eaf4:4f82 with SMTP id p1-20020a2e7401000000b002cceaf44f82mr3577801ljc.26.1706811714343; Thu, 01 Feb 2024 10:21:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706811714; cv=pass; d=google.com; s=arc-20160816; b=ky0paFu8nTvAdwbuET6H5E8AxIHbZFw7fffFFTOP9wKoL/SJcrpWJCv4L7dcFHOggF xNc/VHMTaE0/eAiFdP6nPAz8pJGy9smafCWq+sAYN7XkQMtXiAPM2MUgPtn8jB70nIpZ ODuR6kQTqRDYxoe9Z2x76bPrkqy3ZPiPXVMtTEokekCC3Pf4azMALJBWuA4NFb18jpyz hDF54OhB/vpxmg57Kgv1xcpEK+72tGdDyrrLukvZ5BqFQI05ai9ko1vyaUXNp1Yv8/yu E101SRMVGK92DVByBT56PGM8/fKF7gO4WfiJAn74kzDm/sKtzeAb7oI1wj5/nf0U+NXw cWbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9QbPK55qOwnCFgat/5tt4TIiRg6DuX327D3VZLO3Ze8=; fh=yc8UG9PsCx/Pyxm7dBNzzC+yOU7nWrHth1CAxsUy0/4=; b=epy2ReXccSh8NC/6Sp16UfdDnOtz8NLraEuO/Xf3XAf5zFHdTNeoc3Gue13kiuhss4 zju+JZPzUmVoPQxEET7LaXb+uF3KhYD+5Vh1j67roLS6phnaNKHTN0RILMMXJkSPvnL+ nbFtvB49elU9SumZ3H05//Wnbx2LWC2VWgqtr9X06JWTg06pdoECcD+V4rb8XwQU6xSN s9Did5EVKu4FJ19EgZTbxuK5aUHH/Kbe3r5Ob7R2XRbj0pVSoSc/WS8b2YIfhbqf+ywJ Ggy6GBSagwoqL7OniaYFxQFSHtllVLdEidHH5rpdv2o+qXjDocZQBmMVkkNulRCDK6Vo zMWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UKj1+9Lv; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCVpp6QJebDWq8TKiDC4mnMZrCPr535LYT5vYbunmpEqXYSsb3cvz9hT0GsoEyER9Pz2ppGAAQi3P52zJyh6zudQjbbGX1+t9Is6FpH4BA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u12-20020a50eacc000000b0055a82bbb2dfsi49623edp.39.2024.02.01.10.21.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:21:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UKj1+9Lv; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 290C01F25F1C for ; Thu, 1 Feb 2024 18:21:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFF9B12FB1B; Thu, 1 Feb 2024 18:21:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="UKj1+9Lv" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 CA97A7428A for ; Thu, 1 Feb 2024 18:21:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706811699; cv=none; b=aPMi5lfeAvnwkNE3Gfga1rawOYVdB5dDZXvMvOgW8fKy6B2Aq6u45kLqsybMfUeBjktCzqHZ/Io/KRcY12mmjyeM0GCWKnmRNca2i7C1JWmFWKsX/5CSefuSWlgomthdp2LXSu2ZqrM5ZlhbXZE0paki//O6TP00BWgie7XY5/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706811699; c=relaxed/simple; bh=NGI/ELzng3jIIkGxNs4kwcQn99TRMHrTqHnI3dE6Tbk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=IanYVehKv1z7xjNxlWHGg8eK/08RHKeQzYaLN6CxIOLD7+Qv2Q8u0eMuPFU+Svv+mHJVUMI3JK+W1e+bwTEx0Fepbv3OqziaBlnC82Hli+lYh5EhemSd5zbr156vZfpV969LjLDX2taJr46Y0YWl3g0Lha/8wAmosVj6k+jgnek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=UKj1+9Lv; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4116Q2SP017218; Thu, 1 Feb 2024 18:21:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=9QbPK55qOwnCFgat/5tt4TIiRg6DuX327D3VZLO3Ze8=; b=UK j1+9LvHUF1nCkFv/HY2h8D+fKBIbrkcqMSMmdlfQwnfaO5biuCnVWzRx5o6uByIw LXeq7vUVnVxBEfxhs9ClWbrisIUk4t9ORHNhALEy+wBF5lTunhjP77jo88W8lKyJ AT9F5wC+9jTaRDZYp8VpFt5kmgC23HG9mt3XQLTnuCoYk01K1Zf5hzJ7qAXyOssb MNedHvep/5phh1f0hUZlUTl+HxqYR8RY6R3fm04lnlGBpR3n/xKtWWqDaYRcoqwr kvPi4U2Pnzlyb1LHXhRk/sQirtKqEpEvHCDiYECIBrApV5Rx7AaTp+lvA9lnIm81 6aA3j7l4bz4VX/7/qGBA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w0619hu11-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Feb 2024 18:21:31 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 411ILU1h024482 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2024 18:21:30 GMT Received: from [10.110.16.197] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 1 Feb 2024 10:21:29 -0800 Message-ID: Date: Thu, 1 Feb 2024 10:21:29 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: mac80211: trace SMPS requests from driver Content-Language: en-US To: Johannes Berg , CC: Johannes Berg References: <20240129195435.b20d2ead2013.I8213e65c274451d523a3397519ac578c3ed2df4d@changeid> From: Jeff Johnson In-Reply-To: <20240129195435.b20d2ead2013.I8213e65c274451d523a3397519ac578c3ed2df4d@changeid> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: i2PxTZG38B6-TQBLwpV0Xph7tsSosUEf X-Proofpoint-ORIG-GUID: i2PxTZG38B6-TQBLwpV0Xph7tsSosUEf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-01_04,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0 impostorscore=0 bulkscore=0 mlxlogscore=725 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2402010141 On 1/29/2024 10:54 AM, Johannes Berg wrote: > 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; why go to this trouble? why not just print the link_id that was passed into ieee80211_request_smps()? just so non-MLD will give -1 instead of 0? seems all of the other existing trace functions just print the link_id that was provided > + __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)