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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1AA93C83F2C for ; Mon, 4 Sep 2023 15:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:Cc:References:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tEWePFQiAcwk3Ef5mx7SEsAg9LNB6VVP563K5RMVBFQ=; b=CHMpYZAPq7KTHw Em5i7H5FunM5ToNVOeg5h+Ij/uq4qqdUNrB02YA0sOZlmqNGxNN3JBWC0WhTyHaJtCDaqBifI++Gq ydJhdxnW3SnWk+83nmVcjor4XBqPT6n2wtG6bZCiJ9uiuKH/3MNZX+uybN5VJV2u2GsMsmiR9yBcq e6TkfTlGVgo0SLkJUUsd2tVVohkFKjdv9cWDuF0eTy6cWEsHIh47wgfUX3M/gTc6oPnqBOD9LdADk g2XKPOCaQMV7dje9ti6habU6gOcU8xDtP2v1quSGUhUIFibJX27ww/CImYMyyTkq6KNw5pBEtX0Yx 00kAPlKQy7wn1GGN0RnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdBST-004NGB-2Q; Mon, 04 Sep 2023 15:25:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdBSQ-004NFY-2X for linux-arm-kernel@lists.infradead.org; Mon, 04 Sep 2023 15:25:44 +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 1D5B6143D; Mon, 4 Sep 2023 08:26:18 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D99AD3F738; Mon, 4 Sep 2023 08:25:37 -0700 (PDT) Message-ID: <2a7f6d40-6502-d389-f691-488e3d9b9005@arm.com> Date: Mon, 4 Sep 2023 16:25:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v1 2/2] perf cs-etm: Respect timestamp option Content-Language: en-US To: Leo Yan References: <20230827133557.112494-1-leo.yan@linaro.org> <20230827133557.112494-3-leo.yan@linaro.org> Cc: Arnaldo Carvalho de Melo , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org From: James Clark In-Reply-To: <20230827133557.112494-3-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230904_082542_878452_DC6E09FC X-CRM114-Status: GOOD ( 20.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On 27/08/2023 14:35, Leo Yan wrote: > When users pass the option '--timestamp' or '-T' in the record command, > all events will set the PERF_SAMPLE_TIME bit in the attribution. In > this case, the AUX event will record the kernel timestamp, but it > doesn't mean Arm CoreSight enables timestamp packets in its hardware > tracing. > > If the option '--timestamp' or '-T' is set, this patch always enables > Arm CoreSight timestamp, as a result, the bit 28 in event's config is to > be set. > > Before: > > # perf record -e cs_etm// --per-thread --timestamp -- ls > # perf script --header-only > ... > # event : name = cs_etm//, , id = { 69 }, type = 12, size = 136, > config = 0, { sample_period, sample_freq } = 1, > sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST, > disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1 > ... > > After: > > # perf record -e cs_etm// --per-thread --timestamp -- ls > # perf script --header-only > ... > # event : name = cs_etm//, , id = { 49 }, type = 12, size = 136, > config = 0x10000000, { sample_period, sample_freq } = 1, > sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST, > disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1 > ... > > Signed-off-by: Leo Yan Reviewed-by: James Clark > --- > tools/perf/arch/arm/util/cs-etm.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c > index cf9ef9ba800b..58c506e9788d 100644 > --- a/tools/perf/arch/arm/util/cs-etm.c > +++ b/tools/perf/arch/arm/util/cs-etm.c > @@ -442,6 +442,15 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, > "contextid", 1); > } > > + /* > + * When the option '--timestamp' or '-T' is enabled, the PERF_SAMPLE_TIME > + * bit is set for all events. In this case, always enable Arm CoreSight > + * timestamp tracing. > + */ > + if (opts->sample_time_set) > + evsel__set_config_if_unset(cs_etm_pmu, cs_etm_evsel, > + "timestamp", 1); > + > /* Add dummy event to keep tracking */ > err = parse_event(evlist, "dummy:u"); > if (err) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel