From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA73AC433E0 for ; Tue, 19 Jan 2021 02:33:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B207222252 for ; Tue, 19 Jan 2021 02:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388119AbhASCdD (ORCPT ); Mon, 18 Jan 2021 21:33:03 -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-Google-Smtp-Source: ABdhPJwRbPzmJTXErPTmUDjCOjOwHC1A58EszURj027d3d25v9kr+MKuv4ynvAtX/hFTHTG6SMa52w== 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D92C433E0 for ; Tue, 19 Jan 2021 02:34:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6120B22252 for ; Tue, 19 Jan 2021 02:34:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6120B22252 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c2RFTsoSSDF6mtqz/D4B7djSb0gExgVBr1tSclTbNE8=; b=ZnXj9yps/khEx2iNl+jxpnudk cY+MwZum2x4R8wJ6G5JSXm4pqywSjghHeP5D1T1GbPutkmxZ943CJXxvN33WJrpigXHZIsgOXhU6/ I+CleUzs7BnsMnkDBeSit2TtNF6NbDPeBeROb6uQ7VVtSMlIMQqCZfhaRvM0cVj/1C4M13iiv8hl3 5xT7a92fF4+/GOTTQdXsW+PVknbRddXcKDqA/rHQRT9xTsHTR+uiZzj75F6ZNNQN8AUvrXTdJ7XyR brFczwTmM3sUEAmX3aUVE+kGjx6UoVItlQvRsaqrDze6zLueidCvFYF59OJSK+oytfX0vxOxwVL2w d3dxkEa2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1gof-0004Ro-Cv; Tue, 19 Jan 2021 02:32:21 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1goc-0004R6-TL for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2021 02:32:20 +0000 Received: by mail-pl1-x62a.google.com with SMTP id q4so9650922plr.7 for ; Mon, 18 Jan 2021 18:32:15 -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=Apf/hH96zw994kI/EpmBb2E67P8LNvhRq2oZCYKwi0vv4eJBrUEjV0fgfyhaLE2PAT BcNEb1ZQLbtQlYn0L8w/LPINXEH6lH2v3dwg5/zi/mVdIMubTBz2H93SINT9OGRwAgKa u0UJAZaEJOgVYddr9TSQ3ecNzFVJOCOP8phWxo7XsMvbuz5mjNkDsTMs1D5mkCjabNEz JiCU2SSQmOgfYeamrGO/sFT568BvL/tNQ74hQzVQUrQHaRt49axJdGKZBoIVAXvO7Ulr zSJeYq4CLI6meP5GbVjOE4aDuNPfeogllZVIWrYDto3iYjJbeEduH4e3vnSgs/MhA3GT NN8w== X-Gm-Message-State: AOAM531qsaNymLS4gHpmJv9CrlQwvfJYnJsVwoV+kHYHM3JYISKPTz4y x5As0h1wkvbUKHvk30+/gmfmOQ== X-Google-Smtp-Source: ABdhPJwRbPzmJTXErPTmUDjCOjOwHC1A58EszURj027d3d25v9kr+MKuv4ynvAtX/hFTHTG6SMa52w== 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 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-Disposition: inline In-Reply-To: <20210115224416.GB375055@xps15> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210118_213219_225149_0C96DC9B X-CRM114-Status: GOOD ( 26.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Al Grant , Denis Nikitin , Suzuki K Poulose , Alexander Shishkin , Jiri Olsa , coresight@lists.linaro.org, John Garry , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Daniel Kiss , Will Deacon , linux-arm-kernel@lists.infradead.org, Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel