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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B87E3C49361 for ; Mon, 28 Jun 2021 12:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A20B861C69 for ; Mon, 28 Jun 2021 12:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232870AbhF1MKh (ORCPT ); Mon, 28 Jun 2021 08:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232608AbhF1MKf (ORCPT ); Mon, 28 Jun 2021 08:10:35 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A38C061574 for ; Mon, 28 Jun 2021 05:08:10 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso10277916pjb.4 for ; Mon, 28 Jun 2021 05:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rBkm1+s9hX6PcUjinQ7lSJS/Fgd3FwweZh2+Z8xsqPo=; b=opd6sglrblljFRzHryg/7EDmSJHD5JrcCqUh9qzqAbDVm+/TtkkOtWQygN+1DkWBch AL45nqtkgOjaX1dUubd2kOvovFvWG6daiQBEHt119H2YFRS7/QXcRoKYQdjeBCeJ4s3d wGEzfk0U9N/+p7QxV1uMdyzpYfVi5uc+eqSlAjXvXRbRjUX0cmEYafIjy0gHuWuFhEWv D8a+oK8Nb9SH5DSPZUt/105BpunBxXb8WOPDQDC4roEBeRk7oE8WmqsbH3VRMhBV2vh3 a3sEy3r6o49FJDybVNWviCMJ08pewDwPGjT+8pcaLWNLbboO2sQQYx4AcRk1aw7ZUOOs 1fJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rBkm1+s9hX6PcUjinQ7lSJS/Fgd3FwweZh2+Z8xsqPo=; b=Krs+ibRapqQf0ku/iP8TEejy+ocv/RMEnFf8kL7z2IoVNHi7txfTWyGyGfaedqItHp +jgrPxGvqjJWw/KXSH3dpV44Ek45Zdd7k2n+qFTcWJPjfNjd/6XLH84iafTs0GP02hcv mrWgF8sDbRL/mbjRjjx5n7+3vRMO5I2TcjJFh7QOQYkMMm5LZZbxdQEGp0vinkQlOAMm ZOUaEYNw5+4Bbmq/K6UePgICrs9nENkspgWg87Q93kWwLyvuobP1sbpLJeo8pnEXE75B wUfJ06GyYr0lQNwUO6QpHWhlQviSlSvXIgH8KpY85418AUlYrvNr5h7/KSfhJUwYXYpu yJ8Q== X-Gm-Message-State: AOAM530AvUPzMLnFBpX1kTvBD1Zqy3uq7IFDIXF2kiwlWtUyGwk5vojv FQTXYGQuiLFUDlXE2AF2iFfzJg== X-Google-Smtp-Source: ABdhPJz+wogkKeCNY+BVjSj+kneg8FhgU/tquI+IyEsOosqz0f3FtnnoYWlFAZpKsenFk1uABafnlg== X-Received: by 2002:a17:90a:2f66:: with SMTP id s93mr876153pjd.19.1624882089207; Mon, 28 Jun 2021 05:08:09 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id o1sm14404856pfk.152.2021.06.28.05.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 05:08:08 -0700 (PDT) Date: Mon, 28 Jun 2021 20:08:02 +0800 From: Leo Yan To: James Clark Cc: acme@kernel.org, mathieu.poirier@linaro.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 Subject: Re: [PATCH v7 2/2] perf cs-etm: Split --dump-raw-trace by AUX records Message-ID: <20210628120802.GC200044@leoy-ThinkPad-X240s> References: <20210624164303.28632-1-james.clark@arm.com> <20210624164303.28632-3-james.clark@arm.com> <20210628012744.GA158794@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 CE7CCC2B9F4 for ; Mon, 28 Jun 2021 12:10:24 +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 917F561C49 for ; Mon, 28 Jun 2021 12:10:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 917F561C49 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DNphEc74GFU9mJ/KEIy5R5PzGzpllDBbvn2Jb9cYg8o=; b=vPpCevwpGFw6LQ dKr3nb3jIXWwVM2OvrW2j/amWyi2ICepwpp8GBnIX0NOmppbHMOigvvUSkOqXBWAoAJ93Fzx09cRX h7lJfz+Bpdmpz7+5B7k2Hfu6HoW1zlYIUxtdPwiQuDAVAUssVb0ohyJPs/nae2eOWTahybaYqfLZX yAUfI2QFiuPYoLNWPheWcNM2G+xzSOpmHJtL1ufgCkgOqb3afWoLy2G2B4QzosvBol+8FP+9g4JGb cmW1cVFc606t4c7LNbDRjcybPrIpspmBNvS2YWcjj3/v/eoGHbD/DezhKp2oZ2+chExozt/rrnAt5 2KQTZ/bFNaSdYroxZPSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxq3l-007sFT-PI; Mon, 28 Jun 2021 12:08:18 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxq3f-007sDK-EZ for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 12:08:12 +0000 Received: by mail-pj1-x1029.google.com with SMTP id bb20so9968569pjb.3 for ; Mon, 28 Jun 2021 05:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rBkm1+s9hX6PcUjinQ7lSJS/Fgd3FwweZh2+Z8xsqPo=; b=opd6sglrblljFRzHryg/7EDmSJHD5JrcCqUh9qzqAbDVm+/TtkkOtWQygN+1DkWBch AL45nqtkgOjaX1dUubd2kOvovFvWG6daiQBEHt119H2YFRS7/QXcRoKYQdjeBCeJ4s3d wGEzfk0U9N/+p7QxV1uMdyzpYfVi5uc+eqSlAjXvXRbRjUX0cmEYafIjy0gHuWuFhEWv D8a+oK8Nb9SH5DSPZUt/105BpunBxXb8WOPDQDC4roEBeRk7oE8WmqsbH3VRMhBV2vh3 a3sEy3r6o49FJDybVNWviCMJ08pewDwPGjT+8pcaLWNLbboO2sQQYx4AcRk1aw7ZUOOs 1fJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rBkm1+s9hX6PcUjinQ7lSJS/Fgd3FwweZh2+Z8xsqPo=; b=Scgs5OQGqCrsSDjzikmJ5bSdY7/O/BDDAIpjWEVcNL87ZEK/DeKg2yunxf6mkrQ3VI LYFPdPV4zMAqOYdE7wjJ30fdwE9hwrOTSsxNhbYbcd4xcEKsj+FvCwkVzVerwKqEHZOR w4QzV3KglWHCA3k7wgiy0joPn/FodmcFX0qo+bgbnRnTqnn+QgVeBW0BfV3Km6bxfUPt zWP/PWFrsL2bnTY/uErJBWO1iuqvOyRUYkKYh8sdLQYxQlwJWvbidSMwWoqLLgz1XQU9 ePpYtrcFXEfMtY5o9V5HRisUt2/AQzsx1qcpv/eI39z4HkQ/IJaljzpK+Lu7NNliSd25 /qzQ== X-Gm-Message-State: AOAM532u2GHRvZiI5u+7Ay4DD4yENakYWCa/0Psk4JqSxhbinjeCy9am Hc2ORuxaNGgsiONv7IyI44GaTA== X-Google-Smtp-Source: ABdhPJz+wogkKeCNY+BVjSj+kneg8FhgU/tquI+IyEsOosqz0f3FtnnoYWlFAZpKsenFk1uABafnlg== X-Received: by 2002:a17:90a:2f66:: with SMTP id s93mr876153pjd.19.1624882089207; Mon, 28 Jun 2021 05:08:09 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id o1sm14404856pfk.152.2021.06.28.05.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 05:08:08 -0700 (PDT) Date: Mon, 28 Jun 2021 20:08:02 +0800 From: Leo Yan To: James Clark Cc: acme@kernel.org, mathieu.poirier@linaro.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 Subject: Re: [PATCH v7 2/2] perf cs-etm: Split --dump-raw-trace by AUX records Message-ID: <20210628120802.GC200044@leoy-ThinkPad-X240s> References: <20210624164303.28632-1-james.clark@arm.com> <20210624164303.28632-3-james.clark@arm.com> <20210628012744.GA158794@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_050811_584905_C8FA60FB X-CRM114-Status: GOOD ( 25.72 ) 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 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. 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