Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2511798pxb; Mon, 18 Jan 2021 21:44:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzZkOSVQwkC0GE4eEgOKU5te8j8/DQSWlNzlPWe7Kpx55JXh+evL2/wAwovMPJPiUndhmU X-Received: by 2002:a50:d7c7:: with SMTP id m7mr2020690edj.260.1611035068655; Mon, 18 Jan 2021 21:44:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611035068; cv=none; d=google.com; s=arc-20160816; b=V/FRoImo9YRaMm/ugmwzuY9a32T89cA6zlFjIxMaRseEDHBfdloDPyYiBD+etO9ttS xkSQYk/hHkkT9YxU5qeZcHMRIX51zVqShMbf0KuP7SZ/1MfKq0FK0pep4wX7hMKaEpYP TXRyUYBekkFrYVFTmBr2FJH2zVql2MQY5iJXzCTYWOr37wO0fCDMJsCI0FoReDkKJNZD YXeDqlSoVJhM33DylJb7S5WVvBKeJSKk7xjPTAxzbNkVAjAxwW01eX5DYySRw2cy1y9y tU9HvE4L13N5D1OP86pghP071E3U5HwdSyePEgxrW2ssdecknQCcc23buvgtsPF7pbj8 De7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SuMQrIH62Xu4SD6Twlivr0r+jwy5BFaCnuj4YIYtSxY=; b=rN1i/x418sQleyT42FznWUFLT/XrjR0BeqAcUItW8wcXWK/c1nnhsgI3lMso8nL775 t+xYI3Zqq3jSNEprIXuDHXKmAulmwurvhtQzVet2Bx/ZBr7PDLFR72StLSZqHu8OQvEh 2rrClEQw1733mTf+AwHxNm1HNaZhozGL8cXNddAYGgHVPJk+Xh8p/Uh3jYL+rjV7m93C kwX4Dqkuu/zxIfvU2NCkob27u+iwHwbm0IEPhJ5wCiV0npnw+nWLJqsan7JOi+3P2WpX daAWF4hQKJUbMtZRhwMFmt2VsewAgsZo6UA3HqCWOJWCdRCVWKyXrkUNpJG64mOnFgNh sE/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n7EKsI6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si4039374edv.130.2021.01.18.21.44.06; Mon, 18 Jan 2021 21:44:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n7EKsI6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387545AbhASCdA (ORCPT + 99 others); Mon, 18 Jan 2021 21:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728366AbhASCcy (ORCPT ); Mon, 18 Jan 2021 21:32:54 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8447DC061573 for ; Mon, 18 Jan 2021 18:32:14 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id g3so9669586plp.2 for ; Mon, 18 Jan 2021 18:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SuMQrIH62Xu4SD6Twlivr0r+jwy5BFaCnuj4YIYtSxY=; b=n7EKsI6Xh0Z1t0TesLJwoXA92pfl/yKKVfi+x2L3uIU7bLAm71pfHb9nGd7L865PIO vIGlWjoLMXOnhAyY/aRVj0bNoZTygd3pYqO/kOlb+wiRGeyHOnsjDOYyvofS4VXYkcgL OgXOV24X5VcJYCFtVsOnF39jugJ/UCX32vSLSrHVAgkePk0SVOb3QyFTqdBDTrIWRJow ZG8eXVOM2yTTh6eEZXV/xwfJ4Jx/oJfCjIdCXEtqtT74gixIReIO3tGFZ7oeblDRNrG1 FOYemz/vfLAjSjgZTzuFH5lcNbZlUBHUE/US5K+H/ITdhZGxvoIihYovCc6RF0un98A7 badw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SuMQrIH62Xu4SD6Twlivr0r+jwy5BFaCnuj4YIYtSxY=; b=R7NY3MUfQN/icBpPsWBumaUOn06mwHovqIeL/JOitm1kkkf9p7kylYS6aNvT05pPSJ oWK7dR7x8A9ooJxXt3yLtIIUW9MnZ87vpQmPGcVLUFHwucoVl5VLA6xvJGG5/morxkiW LwG7DuhGb0HNsuj+xH0RMTqZQN+1fh8uD8ruoPHDcty8Easg4ia0G4TpSBRtgTo/1V4E Gt8q5Qwds4iIT/S6rgia44UlXcU5h1VRxE5nBNltBXAzVlPnJnbBbt2K8r2nLQgXOVxC Fsvg6NlvY1UU1JGMN0NpfI0VdL5hYzElgJSXxAUKRcO48IDVzPrQ9aHXstjuNlwGPm2u g9Pw== X-Gm-Message-State: AOAM532UkwaogsCOypKxpmQ5jjYaJ9c4j+KwFAGEHZm65y6F0uKMB+Vf 1xsDXift+xm7laPjOV0u68+jng== X-Received: by 2002:a17:90a:183:: with SMTP id 3mr2538810pjc.99.1611023534028; Mon, 18 Jan 2021 18:32:14 -0800 (PST) Received: from leoy-ThinkPad-X240s ([64.120.119.108]) by smtp.gmail.com with ESMTPSA id n7sm17474988pfn.141.2021.01.18.18.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 18:32:13 -0800 (PST) Date: Tue, 19 Jan 2021 10:32:07 +0800 From: Leo Yan To: Mathieu Poirier Cc: Arnaldo Carvalho de Melo , Suzuki K Poulose , Mike Leach , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Al Grant Subject: Re: [PATCH v1 2/7] perf cs_etm: Use pid tracing explicitly instead of contextid Message-ID: <20210119023207.GA6483@leoy-ThinkPad-X240s> References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-3-leo.yan@linaro.org> <20210115224416.GB375055@xps15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210115224416.GB375055@xps15> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu, On Fri, Jan 15, 2021 at 03:44:16PM -0700, Mathieu Poirier wrote: > On Sat, Jan 09, 2021 at 03:44:30PM +0800, Leo Yan wrote: > > From: Suzuki K Poulose > > > > If the kernel is running at EL2, the pid of the task is exposed > > via VMID instead of the CONTEXTID. Add support for this in the > > perf tool. > > > > By default the perf tool requests contextid and timestamp for > > task bound events. Instead of hard coding contextid, switch > > to "pid" config exposed by the kernel. While at it, define new > > independent macros (rather than using the "config" bits) for > > requesting the "pid" and "timestamp" for cs_etm_set_option(), > > since the PID config is now dynamic depending on the kernel > > exception level. > > > > Cc: Mike Leach > > Cc: Mathieu Poirier > > Cc: Al Grant > > Signed-off-by: Suzuki K Poulose > > Signed-off-by: Leo Yan > > --- > > tools/include/linux/coresight-pmu.h | 11 +++-- > > tools/perf/arch/arm/util/cs-etm.c | 68 ++++++++++++++++++++++------- > > 2 files changed, 59 insertions(+), 20 deletions(-) > > > > diff --git a/tools/include/linux/coresight-pmu.h b/tools/include/linux/coresight-pmu.h > > index b0e35eec6499..927c6285ce5d 100644 > > --- a/tools/include/linux/coresight-pmu.h > > +++ b/tools/include/linux/coresight-pmu.h > > @@ -11,16 +11,19 @@ > > #define CORESIGHT_ETM_PMU_SEED 0x10 > > > > /* ETMv3.5/PTM's ETMCR config bit */ > > -#define ETM_OPT_CYCACC 12 > > -#define ETM_OPT_CTXTID 14 > > -#define ETM_OPT_TS 28 > > -#define ETM_OPT_RETSTK 29 > > +#define ETM_OPT_CYCACC 12 > > +#define ETM_OPT_CTXTID 14 > > +#define ETM_OPT_CTXTID_IN_VMID 15 > > +#define ETM_OPT_TS 28 > > +#define ETM_OPT_RETSTK 29 > > > > /* ETMv4 CONFIGR programming bits for the ETM OPTs */ > > #define ETM4_CFG_BIT_CYCACC 4 > > #define ETM4_CFG_BIT_CTXTID 6 > > +#define ETM4_CFG_BIT_VMID 7 > > #define ETM4_CFG_BIT_TS 11 > > #define ETM4_CFG_BIT_RETSTK 12 > > +#define ETM4_CFG_BIT_VMID_OPT 15 > > Wasn't this done in the previous patch? In the previous patch, these bits are defined in the kernel's header include/linux/coresight-pmu.h; at here it defines the same bits in tool's header. To be honest, I struggled to understand your suggestions, finally I think it's feasbile and we can simplify the implementation. I will try to refine the patch series for the review. Appreciate for good suggestions! Leo