Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4656372pxv; Tue, 29 Jun 2021 12:14:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLWMcCtOYkaAv6xXQcrz+IQ23mZuHQhUw5aMN8rYFWUMpPWJKKImkxwnGUEpTwDdYC6HMW X-Received: by 2002:a05:6402:3507:: with SMTP id b7mr42708547edd.66.1624994073654; Tue, 29 Jun 2021 12:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624994073; cv=none; d=google.com; s=arc-20160816; b=r87L0funKRgcmGC05wzIGklArP0PrK0u74JvuEm9LbqSMXLGKPPb/QdImh9/JWsEey 6mB0Z/F9ikyhsmNPuddcNQys5g99HF8wUTcK9KJvSsXRriPJIx17w8ss0TnNyRvk6sw1 VC/8UN7QE2D7JiM1WcjQaR4GKHioJ6SIrUufP/REiIlZ8G05e5jk4RSh5X92/O/6cEjl p6Ztw81YnghUiiridTcaza0zMYmsPjQC0ZxFmLm6GNZLUa2q6EqBXfycmeHJJ3SSOJCo /UrfWXqzPbiP/lDf8U530GckWQkpY3zHyAUTodDWWZA3jaxDbzqD6Cpe+oFrbjiZXqWX gNgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IQZ/MG27uCidkTSCI4YoLKoh50so7qSZQ7ja/JlUo2I=; b=L0Pnm6RR7MRl0rbLrdGvOJV3dlGU7U5VjqE4XMmqFAfYiPXuCh9IiLCKNaEHvWLWhW JJyt3hr1j5v1FmdjKnmm8ouMizZqvq3ywzqsJ7z/euhAjbFQMo4V04+81eHfGAQyLqcD vhEgbr3pduyIqOAxRUNF3utUdNG77LSwzMJvqBG5GQPhHkd90KFA2XOK7yVzYqt4xt1X M8Y2nEGExE0ofckq4eqenGomg/4QrVn5f2F8PsR2K40zXuG10Yq6iUPJjvPJPY3dzuAC q+/XvRb3olFYjU8CEAGmTHWTU+/q3DUYokR4DvyM1hu67YuJYIZPENDq2dzV/Ly8V53/ YkHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gay8DKwt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si939172edz.128.2021.06.29.12.14.09; Tue, 29 Jun 2021 12:14:33 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Gay8DKwt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234903AbhF2TKt (ORCPT + 99 others); Tue, 29 Jun 2021 15:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235408AbhF2TKs (ORCPT ); Tue, 29 Jun 2021 15:10:48 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B6C9C061760 for ; Tue, 29 Jun 2021 12:08:21 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id a6so90373ioe.0 for ; Tue, 29 Jun 2021 12:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IQZ/MG27uCidkTSCI4YoLKoh50so7qSZQ7ja/JlUo2I=; b=Gay8DKwtPNOIcUv3WQZgu6ebp3xm3yjkSUbCgRHh5G5dW/iU/Z4b0YKoNPOY2OoRK3 nnMi42TFY99ajD/oOZkRsZgsDDqoIZGjkuA8k4jtbuqCXbHb4i/KoP8cbgZpK2xkFPUM riDcAWG0xttwHPE4eoZh8qy7clDrX6vcLeglrb2TtC0PiBjupAVxAYDRw21H5GUrDEmG doBfxpJzfRtAL5WsekApdYYur75uuHRgOAKP9bqp32kD9NEASskZgOpVj3tr79nMir1G BNqbowXpXlijfsIgMkE41lF/aDfo7SHxNfPAhaWrlwVKPfYG8e9sGElk2is6N1+poaDQ FeHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IQZ/MG27uCidkTSCI4YoLKoh50so7qSZQ7ja/JlUo2I=; b=O0tDMFWrAgFSBmxB+1on+f60+HPvJ6U3QK6TUbp/bJ8usdmurhaOphbj3q4DOUWNxx NJX/f2wSYWA84LFKIzjwxeTTyzlvXT/2jIKpcDo0T763kn/nF2KSl0x5Bz8Sds4ZxQOc YJe2zzTpZJbavB0KMEanlvSTRfBVfqaTvGIU1JLqeEMFjVzOi2/0NdDLtZJhZzFtWqWD okoxHAUTGSL7hNwLt7ACZvuktz/qc35W80GYxBoxwdi5MzzJTPGyD+flz/ECbJ3cKsQL svigcMeAwvnW9n269bx5SlvjQ4w04gokVfi03JgLYnJ9cVh2+5eW5AaFUog62Nduozcm davQ== X-Gm-Message-State: AOAM533wSy6jypDfAgBlHzorCf7yD7EdHi+PeEdaoYkRucYg8qNxVwLJ 8o0C/UenKN4Ev9vxGJjtHDdrAuWa84hq62U2IVYRiQ== X-Received: by 2002:a5d:8d16:: with SMTP id p22mr5123773ioj.90.1624993700558; Tue, 29 Jun 2021 12:08:20 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Mathieu Poirier Date: Tue, 29 Jun 2021 13:08:09 -0600 Message-ID: Subject: Re: [PATCH v7 2/2] perf cs-etm: Split --dump-raw-trace by AUX records To: James Clark Cc: Leo Yan , Arnaldo Carvalho de Melo , Coresight ML , Al Grant , Branislav Rankov , Denis Nikitin , "Suzuki K. Poulose" , Anshuman Khandual , John Garry , Will Deacon , Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Jun 2021 at 02:52, James Clark wrote: > > > > 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. > Very well - I will start working on it once I'm through with the ultrasoc patchset. > Thanks > James > > > > > Thanks, > > Mathieu > > > >> Cool, looking forward for the patches :) > >> > >> Leo