linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Kan Liang <kan.liang@linux.intel.com>,
	Zhengjun Xing <zhengjun.xing@linux.intel.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	"Steinar H. Gunderson" <sesse@google.com>,
	Kim Phillips <kim.phillips@amd.com>,
	Florian Fischer <florian.fischer@muhq.space>,
	James Clark <james.clark@arm.com>,
	Suzuki Poulouse <suzuki.poulose@arm.com>,
	Sean Christopherson <seanjc@google.com>,
	Leo Yan <leo.yan@linaro.org>,
	John Garry <john.g.garry@oracle.com>,
	Kajol Jain <kjain@linux.ibm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v5 00/11] Better fixes for  grouping of events
Date: Mon, 13 Mar 2023 15:25:40 -0300	[thread overview]
Message-ID: <ZA9qpIuUPecYPiFk@kernel.org> (raw)
In-Reply-To: <20230312021543.3060328-1-irogers@google.com>

Em Sat, Mar 11, 2023 at 06:15:32PM -0800, Ian Rogers escreveu:
> The rules for grouping events have grown more complex. Topdown events
> must be grouped, but flags like --metric-no-group and flags on metrics
> don't respect this. Uncore events may be expanded using wild cards for
> PMU names, but then the events need reordering so the group members
> are adjacent. Rather than fixing metrics, this change fixes the main
> event parsing code to first sort and then regroup evsels.
> 
> As this is shared functionality changes to it should cause
> concern. The change is done with the intent of simplifying and making
> more robust the grouping logic, examples are given. If additional
> changes are necessary, they are most likely necessary to the
> evsel__group_pmu_name logic as the code avoids breaking groups that
> are on the same "group" PMU. The group_pmu_name is a variant of the
> pmu_name tweaked in the case of software and aux events, that use
> groups in a slightly different manner to conventional events.
> 
> The code was manually tested as well as passing perf test on a Intel
> tigerlake CPU with intel-pt.
> 
> v5. Add Adrian's Acked-by on patch 3, add a fix to the warning logic
>     for multiple event groups as reported by Adrian.


Appled locally, testing.

- Arnaldo

> v4. Move the Intel pmu->auxtrace initialization to the existing
>     perf_pmu__get_default_config as suggested by Adrian Hunter.
> v3. Rename pmu_name to group_pmu_name and add patch to warn when
>     events are regrouped as requested by Namhyung.
> v2. Fix up the commit message on 4/10 (thanks Arnaldo). Drop
>     unnecessary v1 5/10 (thanks Kan). evlist->core.nr_groups wasn't
>     being correctly maintained after the sort/regrouping and so the
>     new patch 10/10 removes that variable and computes it from the
>     evlist when necessary, generally just tests.
> 
> Ian Rogers (11):
>   libperf evlist: Avoid a use of evsel idx
>   perf stat: Don't remove all grouped events when CPU maps disagree
>   perf pmu: Earlier PMU auxtrace initialization
>   perf stat: Modify the group test
>   perf evsel: Allow const evsel for certain accesses
>   perf evsel: Add function to compute group PMU name
>   perf parse-events: Pass ownership of the group name
>   perf parse-events: Sort and group parsed events
>   perf evsel: Remove use_uncore_alias
>   perf evlist: Remove nr_groups
>   perf parse-events: Warn when events are regrouped
> 
>  tools/lib/perf/evlist.c                  |  31 ++-
>  tools/lib/perf/include/internal/evlist.h |   1 -
>  tools/lib/perf/include/perf/evlist.h     |   1 +
>  tools/perf/arch/x86/util/auxtrace.c      |   4 -
>  tools/perf/arch/x86/util/evlist.c        |  39 ++--
>  tools/perf/arch/x86/util/pmu.c           |   8 +-
>  tools/perf/builtin-record.c              |   2 +-
>  tools/perf/builtin-report.c              |   2 +-
>  tools/perf/builtin-stat.c                |  24 +-
>  tools/perf/tests/bpf.c                   |   1 -
>  tools/perf/tests/parse-events.c          |  24 +-
>  tools/perf/tests/pfm.c                   |  12 +-
>  tools/perf/tests/pmu-events.c            |   2 +-
>  tools/perf/util/evlist.c                 |   2 +-
>  tools/perf/util/evlist.h                 |   8 +-
>  tools/perf/util/evsel.c                  |  27 ++-
>  tools/perf/util/evsel.h                  |   8 +-
>  tools/perf/util/header.c                 |   3 +-
>  tools/perf/util/metricgroup.c            |   3 +-
>  tools/perf/util/parse-events.c           | 275 ++++++++++++-----------
>  tools/perf/util/parse-events.h           |  14 +-
>  tools/perf/util/parse-events.y           |  28 +--
>  tools/perf/util/pfm.c                    |   1 -
>  tools/perf/util/pmu.c                    |   6 +-
>  tools/perf/util/python.c                 |   2 +-
>  tools/perf/util/stat-shadow.c            |   2 +-
>  26 files changed, 284 insertions(+), 246 deletions(-)
> 
> -- 
> 2.40.0.rc1.284.g88254d51c5-goog
> 

-- 

- Arnaldo

      parent reply	other threads:[~2023-03-13 18:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12  2:15 [PATCH v5 00/11] Better fixes for grouping of events Ian Rogers
2023-03-12  2:15 ` [PATCH v5 01/11] libperf evlist: Avoid a use of evsel idx Ian Rogers
2023-03-12  2:15 ` [PATCH v5 02/11] perf stat: Don't remove all grouped events when CPU maps disagree Ian Rogers
2023-03-12  2:15 ` [PATCH v5 03/11] perf pmu: Earlier PMU auxtrace initialization Ian Rogers
2023-03-12  2:15 ` [PATCH v5 04/11] perf stat: Modify the group test Ian Rogers
2023-03-12  2:15 ` [PATCH v5 05/11] perf evsel: Allow const evsel for certain accesses Ian Rogers
2023-03-12  2:15 ` [PATCH v5 06/11] perf evsel: Add function to compute group PMU name Ian Rogers
2023-03-12  2:15 ` [PATCH v5 07/11] perf parse-events: Pass ownership of the group name Ian Rogers
2023-03-12  2:15 ` [PATCH v5 08/11] perf parse-events: Sort and group parsed events Ian Rogers
2023-03-12  2:15 ` [PATCH v5 09/11] perf evsel: Remove use_uncore_alias Ian Rogers
2023-03-12  2:15 ` [PATCH v5 10/11] perf evlist: Remove nr_groups Ian Rogers
2023-03-12  2:15 ` [PATCH v5 11/11] perf parse-events: Warn when events are regrouped Ian Rogers
2023-03-13 18:25 ` 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=ZA9qpIuUPecYPiFk@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=florian.fischer@muhq.space \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kim.phillips@amd.com \
    --cc=kjain@linux.ibm.com \
    --cc=leo.yan@linaro.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=seanjc@google.com \
    --cc=sesse@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=zhengjun.xing@linux.intel.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;
as well as URLs for NNTP newsgroup(s).