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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 A3DD1C433DB for ; Mon, 11 Jan 2021 10:08:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59D632222F for ; Mon, 11 Jan 2021 10:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728850AbhAKKIC (ORCPT ); Mon, 11 Jan 2021 05:08:02 -0500 Received: from foss.arm.com ([217.140.110.172]:52256 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728527AbhAKKIC (ORCPT ); Mon, 11 Jan 2021 05:08:02 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59CFC101E; Mon, 11 Jan 2021 02:07:16 -0800 (PST) Received: from [10.57.39.145] (unknown [10.57.39.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB0003F70D; Mon, 11 Jan 2021 02:07:12 -0800 (PST) Subject: Re: [PATCH v1 7/7] perf cs-etm: Detect pid in VMID for kernel running at EL2 To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , 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 Cc: Al Grant References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-8-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <19205bb1-369a-9274-d752-d94f33a909f8@arm.com> Date: Mon, 11 Jan 2021 10:07:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210109074435.626855-8-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leo On 1/9/21 7:44 AM, Leo Yan wrote: > From: Suzuki K Poulose > > The pid of the task could be traced as VMID when the kernel is > running at EL2. Teach the decoder to look for vmid when the > context_id is invalid but we have a valid VMID. Thank you again for cleaning up this ! Please see one comment below. > > Cc: Mike Leach > Cc: Mathieu Poirier > Cc: Al Grant > Co-developed-by: Leo Yan > Signed-off-by: Suzuki K Poulose > Signed-off-by: Leo Yan > --- > .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 32 ++++++++++++++++--- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > index cd007cc9c283..9e81169dfa76 100644 > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > @@ -6,6 +6,7 @@ > * Author: Mathieu Poirier > */ > > +#include > #include > #include > #include > @@ -500,13 +501,36 @@ cs_etm_decoder__set_tid(struct cs_etm_queue *etmq, > const ocsd_generic_trace_elem *elem, > const uint8_t trace_chan_id) > { > - pid_t tid; > + pid_t tid = -1; > + u64 pid_fmt; > + int ret; > > - /* Ignore PE_CONTEXT packets that don't have a valid contextID */ > - if (!elem->context.ctxt_id_valid) > + ret = cs_etm__get_pid_fmt(trace_chan_id, &pid_fmt); > + if (ret) > + return OCSD_RESP_FATAL_SYS_ERR; The patch looks fine to me. I am wondering if this can be cached somewhere in the etmq to avoid doing the search everytime we hit a CID ? Surely for a session, this woudn't change and thus for the decoder life time. Cheers Suzuki 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.5 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 212A4C433E6 for ; Mon, 11 Jan 2021 10:08:46 +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 D01A22220F for ; Mon, 11 Jan 2021 10:08:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D01A22220F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0f1Ek4i8UjfGjqzXlCsmNZkGLcQk0lq18o+TwtEKnfQ=; b=C3zNByXr/ilIL5RDfDs4mDSUY cmN1Iu7J0egu7qFXVaySa6a/lYsC16FechfgUC7zFYXgVVfLcEl6SG9LJKJqZPFQx5CZLPGIBubkI 4Nea2odwWdGfahZcpXJ8waMhx2kMKAhQ8kpeTBc9mLFDzyfRThETAGeSL8HI3sxV0x/TVv9x/PqJz 7K3Dk4lDMwJqOjx2TQI3a+6d9DOrmCXIyX2MTtNrCitJQsHy3zMM1KkViy9t2yqDmbVubxvQmOx6A Lui/gmqBCQTuKzW2VmBOJi1aMSqMWHNlSuco6x1ejKlO/Kc+aU2tLbZPyoTvhytemEul4yjCUc3sj P0pNxNwLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyu6b-0006lN-Ly; Mon, 11 Jan 2021 10:07:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyu6X-0006ju-HE for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 10:07:18 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59CFC101E; Mon, 11 Jan 2021 02:07:16 -0800 (PST) Received: from [10.57.39.145] (unknown [10.57.39.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB0003F70D; Mon, 11 Jan 2021 02:07:12 -0800 (PST) Subject: Re: [PATCH v1 7/7] perf cs-etm: Detect pid in VMID for kernel running at EL2 To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , 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 References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-8-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <19205bb1-369a-9274-d752-d94f33a909f8@arm.com> Date: Mon, 11 Jan 2021 10:07:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210109074435.626855-8-leo.yan@linaro.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_050717_659109_9ED6328A X-CRM114-Status: GOOD ( 22.78 ) 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: Al Grant Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Leo On 1/9/21 7:44 AM, Leo Yan wrote: > From: Suzuki K Poulose > > The pid of the task could be traced as VMID when the kernel is > running at EL2. Teach the decoder to look for vmid when the > context_id is invalid but we have a valid VMID. Thank you again for cleaning up this ! Please see one comment below. > > Cc: Mike Leach > Cc: Mathieu Poirier > Cc: Al Grant > Co-developed-by: Leo Yan > Signed-off-by: Suzuki K Poulose > Signed-off-by: Leo Yan > --- > .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 32 ++++++++++++++++--- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > index cd007cc9c283..9e81169dfa76 100644 > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > @@ -6,6 +6,7 @@ > * Author: Mathieu Poirier > */ > > +#include > #include > #include > #include > @@ -500,13 +501,36 @@ cs_etm_decoder__set_tid(struct cs_etm_queue *etmq, > const ocsd_generic_trace_elem *elem, > const uint8_t trace_chan_id) > { > - pid_t tid; > + pid_t tid = -1; > + u64 pid_fmt; > + int ret; > > - /* Ignore PE_CONTEXT packets that don't have a valid contextID */ > - if (!elem->context.ctxt_id_valid) > + ret = cs_etm__get_pid_fmt(trace_chan_id, &pid_fmt); > + if (ret) > + return OCSD_RESP_FATAL_SYS_ERR; The patch looks fine to me. I am wondering if this can be cached somewhere in the etmq to avoid doing the search everytime we hit a CID ? Surely for a session, this woudn't change and thus for the decoder life time. Cheers Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel