Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4304476rwb; Tue, 8 Nov 2022 15:17:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Q5LhHo2MfFd5wcZNjLSO9jak2HY6WiotoT0KycSlaIoQEvz2YZMZU6SndlatNfWVOb/Hp X-Received: by 2002:a50:ab15:0:b0:466:dd0d:d472 with SMTP id s21-20020a50ab15000000b00466dd0dd472mr487362edc.396.1667949468535; Tue, 08 Nov 2022 15:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667949468; cv=none; d=google.com; s=arc-20160816; b=pjbtQiLfUQGQxAHFF6wA+5HncSgXkYLvXqRXTTrOq1IwLW0oETb4T9e+GM9oBbrgwZ TxeH12IdRw9S4Mgc+XzTyDPAbyYOT52uN7NYl75hWDjb86S4+ygkDYj9PFGWBl2EH+Xg wVK3H/Df0eU2jr92BAycmshgIU2awZeKeOOk6Ea2qu6ceyArxfwJBOt1Tc1utOwJomUZ tuSwiD8dWrvZQTaevNCbaMqIxNKYauPm+xfgU5pjTVZ+boTwq8dbO+1d+V2y2rdRaPy6 JLOBSn2/C76xv9av0pReMEaWaF7vXLxHa+SWtIYFj2n5HokClZaJMV5Bvx1DVYqXAidx ZCHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=Dh9TXe24hJW2N1u3J0ox/xalIGBfHppZvQxUYFr35iI=; b=MC4CTbtrWmi87Zbo0cohEXQlqX/dAo3wGExeYNevicriShct3xFKJazGy/lfBpmxAk f+GHHRoHf+y1ZjaruLZHbGpZ2BWREbaq7ZV6ikGaF+85BY09JSgx69Gah67gAkLKQ0d+ rmpjDvdCbV2MsnqyajwyFDL64Ppn6gNfd7nuNLAsx7DyMpctgd+dmwkOLip9QZmrJFC1 i8+ljcAcYaDnT0fE/qygF7w6rcLsJVOOjl166YDEJkYnx7QJSxzBJp+i1nNbI8wQhWvU VRDSwJevNdEbhUdWNEyVZ0RsI3O4EoGAiWt5fgX+irsm8rjZ0JglLdIV5epz58xYwgF/ zLMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a056402021400b0045bfaaab6d1si12679938edv.48.2022.11.08.15.17.13; Tue, 08 Nov 2022 15:17:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbiKHWtV (ORCPT + 93 others); Tue, 8 Nov 2022 17:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiKHWtU (ORCPT ); Tue, 8 Nov 2022 17:49:20 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 692286035B; Tue, 8 Nov 2022 14:49:19 -0800 (PST) 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 56F2F1FB; Tue, 8 Nov 2022 14:49:25 -0800 (PST) Received: from [10.57.68.207] (unknown [10.57.68.207]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 83CFB3F703; Tue, 8 Nov 2022 14:49:17 -0800 (PST) Message-ID: <994b80f8-5c92-f82c-d43a-cc24fb002c98@arm.com> Date: Tue, 8 Nov 2022 22:49:16 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v5 13/14] coresight: events: PERF_RECORD_AUX_OUTPUT_HW_ID used for Trace ID To: Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mathieu.poirier@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-perf-users@vger.kernel.org, leo.yan@linaro.org, quic_jinlmao@quicinc.com References: <20221101163103.17921-1-mike.leach@linaro.org> <20221101163103.17921-14-mike.leach@linaro.org> From: Suzuki K Poulose In-Reply-To: <20221101163103.17921-14-mike.leach@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2022 16:31, Mike Leach wrote: > Use the perf_report_aux_output_id() call to output the CoreSight trace ID > and associated CPU as a PERF_RECORD_AUX_OUTPUT_HW_ID record in the > perf.data file. > > Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-etm-perf.c | 7 +++++++ > include/linux/coresight-pmu.h | 14 ++++++++++++++ > 2 files changed, 21 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c > index 6166f716a6ac..59a2ad95c1dc 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c > @@ -4,6 +4,7 @@ > * Author: Mathieu Poirier > */ > > +#include > #include > #include > #include > @@ -448,6 +449,7 @@ static void etm_event_start(struct perf_event *event, int flags) > struct perf_output_handle *handle = &ctxt->handle; > struct coresight_device *sink, *csdev = per_cpu(csdev_src, cpu); > struct list_head *path; > + u64 hw_id; > > if (!csdev) > goto fail; > @@ -493,6 +495,11 @@ static void etm_event_start(struct perf_event *event, int flags) > if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) > goto fail_disable_path; > > + /* output cpu / trace ID in perf record */ > + hw_id = FIELD_PREP(CS_AUX_HW_ID_VERSION_MASK, CS_AUX_HW_ID_CURR_VERSION) | > + FIELD_PREP(CS_AUX_HW_ID_TRACE_ID_MASK, coresight_trace_id_read_cpu_id(cpu)); super minor nit: You may split this for better readability. traceid = coresight_trace_id_read_cpu_id(cpu); hw_id = FIELD_PREP(CS_AUX_HW_ID_VERSION_MASK, CS_AUX_HW_ID_CURR_VERSION); hw_id |= FIELD_PREP(CS_AUX_HW_ID_TRACE_ID_MASK, traceid); Either ways, Reviewed-by: Suzuki K Poulose