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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 CC884C11F67 for ; Tue, 29 Jun 2021 08:52:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADC5261DC1 for ; Tue, 29 Jun 2021 08:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232654AbhF2IzB (ORCPT ); Tue, 29 Jun 2021 04:55:01 -0400 Received: from foss.arm.com ([217.140.110.172]:46496 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232621AbhF2Iy7 (ORCPT ); Tue, 29 Jun 2021 04:54:59 -0400 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 6049DD6E; Tue, 29 Jun 2021 01:52:32 -0700 (PDT) Received: from [10.57.14.107] (unknown [10.57.14.107]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB6EF3F694; Tue, 29 Jun 2021 01:52:29 -0700 (PDT) Subject: Re: [PATCH v7 2/2] perf cs-etm: Split --dump-raw-trace by AUX records To: Mathieu Poirier , Leo Yan Cc: acme@kernel.org, coresight@lists.linaro.org, al.grant@arm.com, branislav.rankov@arm.com, denik@chromium.org, suzuki.poulose@arm.com, anshuman.khandual@arm.com, John Garry , Will Deacon , Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210624164303.28632-1-james.clark@arm.com> <20210624164303.28632-3-james.clark@arm.com> <20210628012744.GA158794@leoy-ThinkPad-X240s> <20210628120802.GC200044@leoy-ThinkPad-X240s> <20210628200132.GB1200359@p14s> From: James Clark Message-ID: Date: Tue, 29 Jun 2021 09:52:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210628200132.GB1200359@p14s> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/2021 21:01, Mathieu Poirier wrote: > On Mon, Jun 28, 2021 at 08:08:02PM +0800, Leo Yan wrote: >> On Mon, Jun 28, 2021 at 11:38:34AM +0100, James Clark wrote: >> >> [...] >> >>>>> static int cs_etm__process_auxtrace_event(struct perf_session *session, >>>>> union perf_event *event, >>>>> struct perf_tool *tool __maybe_unused) >>>>> @@ -2462,7 +2478,8 @@ static int cs_etm__process_auxtrace_event(struct perf_session *session, >>>>> cs_etm__dump_event(etm, buffer); >>>>> auxtrace_buffer__put_data(buffer); >>>>> } >>>>> - } >>>>> + } else if (dump_trace) >>>>> + dump_queued_data(etm, &event->auxtrace); >>>> >>>> IIUC, in the function cs_etm__process_auxtrace_event(), since >>>> "etm->data_queued" is always true, below flow will never run: >>>> >>>> if (!etm->data_queued) { >>>> ...... >>>> >>>> if (dump_trace) >>>> if (auxtrace_buffer__get_data(buffer, fd)) { >>>> cs_etm__dump_event(etm, buffer); >>>> auxtrace_buffer__put_data(buffer); >>>> } >>>> } >>>> >>>> If so, it's better to use a new patch to polish the code. >>>> >>> >>> Hi Leo, >>> >>> I think this is not true in piped mode because there is no auxtrace index. >>> In that mode, events are processed only in file order and cs_etm__process_auxtrace_event() >>> is called for each buffer. >>> >>> You can reproduce this with something like this: >>> >>> ./perf record -o - ls > stdio.data >>> cat stdio.data | ./perf report -i - >> >> You are right! I tried these two commands with cs_etm event, just as >> you said, in this case, the AUX trace data is not queued; so the flow >> for "if (!etm->data_queued)" should be kept. If so, I am very fine >> for current change. Thanks for sharing the knowledge. >> >>> There are some other Coresight features that don't work as expected in this mode, like >>> sorting timestamps between CPUs. The aux split patchset won't work either because random >>> access isn't possible. And the TRBE patch that I'm working on now won't work, because it >>> also requires the random access to lookup the flags on the AUX record to configure the >>> decoder for unformatted trace. >> > > There is a lot of things happening in this area. Based on the above should I > still plan to review this set or should I wait for another revision? >From my point of view, this one is final. It looks like both Leo and I have tested it with and without his snapshot changes and it's working as expected in both cases. Thanks James > > Thanks, > Mathieu > >> Cool, looking forward for the patches :) >> >> 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=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 21F9CC11F66 for ; Tue, 29 Jun 2021 08:54:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E453E61CA2 for ; Tue, 29 Jun 2021 08:54:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E453E61CA2 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mzP9pmO3c1HXhXdp3iDIVU3miENs1zxASgkjuyJGNpc=; b=lifTkNx3VdnbV1eokVNqJmCLbm mB3sq5F9VoNntmjw5UxYCIUkLDBdVrNQGCrNCrMt3bJI+3ehdNrwz6cxdCo/3C81GKil3XOutyC3d D0jGUx53fAkn4WnOp/yaXwnB+wQAQXnoZapChDL4nkwfDaSageoDoJ5ysvA5U6dueyp2iieeR4VmB tJDKeWdiSWBgHHWxMQvJoZGkBSWjvkx44G7DwzYvOUywwKeGuMMN+mCRGfnfWWrCRtq/yweUoSjc7 +GM+jyC3055p4yvwpMPar0JCY5/dwJXSpNdsG7DjwvJmoqioVH0bhi0pwcnBEPmBiMQLLSAGMvOgn 5XlMiakw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly9Ty-00AIRa-9M; Tue, 29 Jun 2021 08:52:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly9Tu-00AIQv-Fx for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 08:52:36 +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 6049DD6E; Tue, 29 Jun 2021 01:52:32 -0700 (PDT) Received: from [10.57.14.107] (unknown [10.57.14.107]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB6EF3F694; Tue, 29 Jun 2021 01:52:29 -0700 (PDT) Subject: Re: [PATCH v7 2/2] perf cs-etm: Split --dump-raw-trace by AUX records To: Mathieu Poirier , Leo Yan Cc: acme@kernel.org, coresight@lists.linaro.org, al.grant@arm.com, branislav.rankov@arm.com, denik@chromium.org, suzuki.poulose@arm.com, anshuman.khandual@arm.com, John Garry , Will Deacon , Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210624164303.28632-1-james.clark@arm.com> <20210624164303.28632-3-james.clark@arm.com> <20210628012744.GA158794@leoy-ThinkPad-X240s> <20210628120802.GC200044@leoy-ThinkPad-X240s> <20210628200132.GB1200359@p14s> From: James Clark Message-ID: Date: Tue, 29 Jun 2021 09:52:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210628200132.GB1200359@p14s> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210629_015234_695803_DE66531F X-CRM114-Status: GOOD ( 23.63 ) 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 28/06/2021 21:01, Mathieu Poirier wrote: > On Mon, Jun 28, 2021 at 08:08:02PM +0800, Leo Yan wrote: >> On Mon, Jun 28, 2021 at 11:38:34AM +0100, James Clark wrote: >> >> [...] >> >>>>> static int cs_etm__process_auxtrace_event(struct perf_session *session, >>>>> union perf_event *event, >>>>> struct perf_tool *tool __maybe_unused) >>>>> @@ -2462,7 +2478,8 @@ static int cs_etm__process_auxtrace_event(struct perf_session *session, >>>>> cs_etm__dump_event(etm, buffer); >>>>> auxtrace_buffer__put_data(buffer); >>>>> } >>>>> - } >>>>> + } else if (dump_trace) >>>>> + dump_queued_data(etm, &event->auxtrace); >>>> >>>> IIUC, in the function cs_etm__process_auxtrace_event(), since >>>> "etm->data_queued" is always true, below flow will never run: >>>> >>>> if (!etm->data_queued) { >>>> ...... >>>> >>>> if (dump_trace) >>>> if (auxtrace_buffer__get_data(buffer, fd)) { >>>> cs_etm__dump_event(etm, buffer); >>>> auxtrace_buffer__put_data(buffer); >>>> } >>>> } >>>> >>>> If so, it's better to use a new patch to polish the code. >>>> >>> >>> Hi Leo, >>> >>> I think this is not true in piped mode because there is no auxtrace index. >>> In that mode, events are processed only in file order and cs_etm__process_auxtrace_event() >>> is called for each buffer. >>> >>> You can reproduce this with something like this: >>> >>> ./perf record -o - ls > stdio.data >>> cat stdio.data | ./perf report -i - >> >> You are right! I tried these two commands with cs_etm event, just as >> you said, in this case, the AUX trace data is not queued; so the flow >> for "if (!etm->data_queued)" should be kept. If so, I am very fine >> for current change. Thanks for sharing the knowledge. >> >>> There are some other Coresight features that don't work as expected in this mode, like >>> sorting timestamps between CPUs. The aux split patchset won't work either because random >>> access isn't possible. And the TRBE patch that I'm working on now won't work, because it >>> also requires the random access to lookup the flags on the AUX record to configure the >>> decoder for unformatted trace. >> > > There is a lot of things happening in this area. Based on the above should I > still plan to review this set or should I wait for another revision? >From my point of view, this one is final. It looks like both Leo and I have tested it with and without his snapshot changes and it's working as expected in both cases. Thanks James > > Thanks, > Mathieu > >> Cool, looking forward for the patches :) >> >> Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel