[PATCH v3 0/3] Generic weight struct, use env for sort key and header

Ian Rogers posted 3 patches 6 months, 3 weeks ago
tools/perf/arch/powerpc/util/Build         |   1 -
tools/perf/arch/powerpc/util/event.c       |  60 ----------
tools/perf/arch/x86/include/arch-tests.h   |   1 -
tools/perf/arch/x86/tests/Build            |   1 -
tools/perf/arch/x86/tests/arch-tests.c     |   2 -
tools/perf/arch/x86/tests/sample-parsing.c | 125 ---------------------
tools/perf/arch/x86/util/event.c           |  46 --------
tools/perf/builtin-annotate.c              |   2 +-
tools/perf/builtin-c2c.c                   |  53 +++++----
tools/perf/builtin-diff.c                  |   2 +-
tools/perf/builtin-report.c                |   2 +-
tools/perf/builtin-script.c                |   2 +-
tools/perf/builtin-top.c                   |  16 +--
tools/perf/tests/hists_cumulate.c          |   8 +-
tools/perf/tests/hists_filter.c            |   8 +-
tools/perf/tests/hists_link.c              |   8 +-
tools/perf/tests/hists_output.c            |  10 +-
tools/perf/tests/sample-parsing.c          |  14 +++
tools/perf/util/dlfilter.c                 |   2 +-
tools/perf/util/event.h                    |   5 -
tools/perf/util/evsel.c                    |  17 ++-
tools/perf/util/hist.c                     |   4 +-
tools/perf/util/hist.h                     |   2 +-
tools/perf/util/intel-tpebs.c              |   4 +-
tools/perf/util/sample.h                   |   5 +-
tools/perf/util/session.c                  |   2 +-
tools/perf/util/sort.c                     |  67 +++++++----
tools/perf/util/sort.h                     |   5 +-
tools/perf/util/synthetic-events.c         |  10 +-
29 files changed, 150 insertions(+), 334 deletions(-)
delete mode 100644 tools/perf/arch/powerpc/util/event.c
delete mode 100644 tools/perf/arch/x86/tests/sample-parsing.c
[PATCH v3 0/3] Generic weight struct, use env for sort key and header
Posted by Ian Rogers 6 months, 3 weeks ago
The arch directory is a barrier to cross-platform development as files
and behaviors within it are inherently platform specific. Sample
parsing should be generic but the PERF_SAMPLE_WEIGHT_STRUCT handling
was only present if building for x86 or powerpc. The sort key and
headers should be specific to the session that is being executed and
not to the machine perf is being run upon. These patches clean this
and associated code up.

v3: Code reorganizations suggested by Kan Liang.
v2: Avoid changes to include/perf/perf_dlfilter.h as suggested by
    Adrian Hunter.

Ian Rogers (3):
  perf sample: Remove arch notion of sample parsing
  perf test: Move PERF_SAMPLE_WEIGHT_STRUCT parsing to common test
  perf sort: Use perf_env to set arch sort keys and header

 tools/perf/arch/powerpc/util/Build         |   1 -
 tools/perf/arch/powerpc/util/event.c       |  60 ----------
 tools/perf/arch/x86/include/arch-tests.h   |   1 -
 tools/perf/arch/x86/tests/Build            |   1 -
 tools/perf/arch/x86/tests/arch-tests.c     |   2 -
 tools/perf/arch/x86/tests/sample-parsing.c | 125 ---------------------
 tools/perf/arch/x86/util/event.c           |  46 --------
 tools/perf/builtin-annotate.c              |   2 +-
 tools/perf/builtin-c2c.c                   |  53 +++++----
 tools/perf/builtin-diff.c                  |   2 +-
 tools/perf/builtin-report.c                |   2 +-
 tools/perf/builtin-script.c                |   2 +-
 tools/perf/builtin-top.c                   |  16 +--
 tools/perf/tests/hists_cumulate.c          |   8 +-
 tools/perf/tests/hists_filter.c            |   8 +-
 tools/perf/tests/hists_link.c              |   8 +-
 tools/perf/tests/hists_output.c            |  10 +-
 tools/perf/tests/sample-parsing.c          |  14 +++
 tools/perf/util/dlfilter.c                 |   2 +-
 tools/perf/util/event.h                    |   5 -
 tools/perf/util/evsel.c                    |  17 ++-
 tools/perf/util/hist.c                     |   4 +-
 tools/perf/util/hist.h                     |   2 +-
 tools/perf/util/intel-tpebs.c              |   4 +-
 tools/perf/util/sample.h                   |   5 +-
 tools/perf/util/session.c                  |   2 +-
 tools/perf/util/sort.c                     |  67 +++++++----
 tools/perf/util/sort.h                     |   5 +-
 tools/perf/util/synthetic-events.c         |  10 +-
 29 files changed, 150 insertions(+), 334 deletions(-)
 delete mode 100644 tools/perf/arch/powerpc/util/event.c
 delete mode 100644 tools/perf/arch/x86/tests/sample-parsing.c

-- 
2.49.0.1143.g0be31eac6b-goog
Re: [PATCH v3 0/3] Generic weight struct, use env for sort key and header
Posted by Ian Rogers 6 months, 2 weeks ago
On Wed, May 21, 2025 at 9:53 AM Ian Rogers <irogers@google.com> wrote:
>
> The arch directory is a barrier to cross-platform development as files
> and behaviors within it are inherently platform specific. Sample
> parsing should be generic but the PERF_SAMPLE_WEIGHT_STRUCT handling
> was only present if building for x86 or powerpc. The sort key and
> headers should be specific to the session that is being executed and
> not to the machine perf is being run upon. These patches clean this
> and associated code up.
>
> v3: Code reorganizations suggested by Kan Liang.
> v2: Avoid changes to include/perf/perf_dlfilter.h as suggested by
>     Adrian Hunter.

Ping. Thanks,
Ian

> Ian Rogers (3):
>   perf sample: Remove arch notion of sample parsing
>   perf test: Move PERF_SAMPLE_WEIGHT_STRUCT parsing to common test
>   perf sort: Use perf_env to set arch sort keys and header
>
>  tools/perf/arch/powerpc/util/Build         |   1 -
>  tools/perf/arch/powerpc/util/event.c       |  60 ----------
>  tools/perf/arch/x86/include/arch-tests.h   |   1 -
>  tools/perf/arch/x86/tests/Build            |   1 -
>  tools/perf/arch/x86/tests/arch-tests.c     |   2 -
>  tools/perf/arch/x86/tests/sample-parsing.c | 125 ---------------------
>  tools/perf/arch/x86/util/event.c           |  46 --------
>  tools/perf/builtin-annotate.c              |   2 +-
>  tools/perf/builtin-c2c.c                   |  53 +++++----
>  tools/perf/builtin-diff.c                  |   2 +-
>  tools/perf/builtin-report.c                |   2 +-
>  tools/perf/builtin-script.c                |   2 +-
>  tools/perf/builtin-top.c                   |  16 +--
>  tools/perf/tests/hists_cumulate.c          |   8 +-
>  tools/perf/tests/hists_filter.c            |   8 +-
>  tools/perf/tests/hists_link.c              |   8 +-
>  tools/perf/tests/hists_output.c            |  10 +-
>  tools/perf/tests/sample-parsing.c          |  14 +++
>  tools/perf/util/dlfilter.c                 |   2 +-
>  tools/perf/util/event.h                    |   5 -
>  tools/perf/util/evsel.c                    |  17 ++-
>  tools/perf/util/hist.c                     |   4 +-
>  tools/perf/util/hist.h                     |   2 +-
>  tools/perf/util/intel-tpebs.c              |   4 +-
>  tools/perf/util/sample.h                   |   5 +-
>  tools/perf/util/session.c                  |   2 +-
>  tools/perf/util/sort.c                     |  67 +++++++----
>  tools/perf/util/sort.h                     |   5 +-
>  tools/perf/util/synthetic-events.c         |  10 +-
>  29 files changed, 150 insertions(+), 334 deletions(-)
>  delete mode 100644 tools/perf/arch/powerpc/util/event.c
>  delete mode 100644 tools/perf/arch/x86/tests/sample-parsing.c
>
> --
> 2.49.0.1143.g0be31eac6b-goog
>