public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	irogers@google.com, adrian.hunter@intel.com, terrelln@fb.com,
	ravi.bangoria@amd.com, ananth.narayan@amd.com
Subject: Re: [PATCH 1/2] perf script: Skip aggregation for stat events
Date: Wed, 10 May 2023 14:37:08 -0300	[thread overview]
Message-ID: <ZFvWRFGJlAPsgsZL@kernel.org> (raw)
In-Reply-To: <CAM9d7cgZLiRmUDnxW3NpN67Jvgj670FPBkwqncXmDEamYM6n3A@mail.gmail.com>

Em Fri, May 05, 2023 at 04:43:20PM -0700, Namhyung Kim escreveu:
> Hello,
> 
> On Fri, May 5, 2023 at 3:03 AM Sandipan Das <sandipan.das@amd.com> wrote:
> >
> > The script command does not support aggregation modes by itself although
> > that can be achieved using post-processing scripts. Because of this, it
> > does not allocate memory for aggregated event values.
> >
> > Upon running perf stat record, the aggregation mode is set in the perf
> > data file. If the mode is AGGR_GLOBAL, the aggregated event values are
> > accessed and this leads to a segmentation fault since these were never
> > allocated to begin with. Set the mode to AGGR_NONE explicitly to avoid
> > this.
> >
> > E.g.
> >
> >   $ perf stat record -e cycles true
> >   $ perf script
> >
> > Before:
> >   Segmentation fault (core dumped)
> >
> > After:
> >   CPU   THREAD             VAL             ENA             RUN            TIME EVENT
> >    -1   231919          162831          362069          362069          935289 cycles:u
> >
> > Fixes: 8b76a3188b85 ("perf stat: Remove unused perf_counts.aggr field")
> > Signed-off-by: Sandipan Das <sandipan.das@amd.com>
> > Cc: stable@vger.kernel.org # v6.2+
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied both to perf-tools, for v6.4.

- Arnaldo


      reply	other threads:[~2023-05-10 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 10:02 [PATCH 1/2] perf script: Skip aggregation for stat events Sandipan Das
2023-05-05 10:02 ` [PATCH 2/2] perf test: Add stat test for record and script Sandipan Das
2023-05-05 23:43   ` Namhyung Kim
2023-05-05 23:43 ` [PATCH 1/2] perf script: Skip aggregation for stat events Namhyung Kim
2023-05-10 17:37   ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZFvWRFGJlAPsgsZL@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=terrelln@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox