Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4227080pxv; Tue, 29 Jun 2021 01:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhqs7WL/ZnPuDOwi0cgDW2428lTeVPZQI85/HPFHBYm5N6FSDEEAcMlXtOAkaV5JQqcmlZ X-Received: by 2002:a92:60a:: with SMTP id x10mr332904ilg.278.1624956885354; Tue, 29 Jun 2021 01:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624956885; cv=none; d=google.com; s=arc-20160816; b=ldzlWW9yAI0qA2HKRK/AVi1sFQiYlFOFL1IOQMUkxwjBRx/CdJURgWPJa0EH/XLW/w KY74v8aAGVNRvEE84Ee6whVPQ7LXpOoYCHriWxpP2UU2pIyh6WgdWGC6yt42KFRJMy+s oA/Iiwqc6HDgVMzDaUOBjAaaHNJc6fiCW3nauUXfKQOoDMg/Td+5eGstQ3OH/gIplSg/ EWnodbwZtkyHAV0WeYBLai+sD8PZQUN6j236+UwgrBFGnubuoUmO9SJJWhOZSe50F/kw imVe/jx/MfkItVfkWmFEHvtdjDd5anAy0ZMz7EllWHLAYl1vqcR4xYq+iDOmnUYFO3l7 xKhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Fgb+sGQJTGpxb6NFzkg+Z/lOu3aQvVRCLav3DJEBtaU=; b=gE1c/Kje9TzZXRyZESmsoEg4Gi9NX8bVE5VHSSBabkpLXlvgaqGkRUmN4qG8Hmv3KQ yNL6m/Me2kxBz3q2WboETDioXBqNSpi5p0fLz9vQAlmf5KygD53uWcByVP+7SCLWH7r9 uEXierIP7wuW/J3tHYgOg3ETr9kHAJvHPn9Q9FVVF9xlb9EGizZL9TGM3p9nt8etLjzC MiCvCs8ls0/cmejQLiVYjL8ebnvgu4c4xHzzH5CY+FgGxpJ33KRkwsHwo9cyCKVpdCJI Hk3upw6klAUQpMX6mIKi2z6hr+yhgY/rz9W8CWBE4/nDAr8DN2SN1heHBDaBsx2lodqV 4dTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si19585844ioe.96.2021.06.29.01.54.33; Tue, 29 Jun 2021 01:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232636AbhF2IzA (ORCPT + 99 others); Tue, 29 Jun 2021 04:55:00 -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