diff options
author | James Clark <james.clark@arm.com> | 2023-01-20 15:36:55 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-01-22 22:17:32 +0100 |
commit | d50a79cd0f391cbfdc3d9a6165e247d084f94dd3 (patch) | |
tree | 0ea966d9eaa89a5144f1f6cb8e7e2ecc1a427398 /tools/perf/util/python.c | |
parent | perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH (diff) | |
download | linux-d50a79cd0f391cbfdc3d9a6165e247d084f94dd3.tar.xz linux-d50a79cd0f391cbfdc3d9a6165e247d084f94dd3.zip |
perf pmu: Use perf_pmu__open_file() and perf_pmu__scan_file()
Remove some code that duplicates existing methods. Copy strings where
const strings are required.
No functional changes.
Committer notes:
Add a stub for erf_pmu__scan_file() in tools/perf/util/python.c not to
drag tools/perf/util/pmu.c into the python binding.
This fixes 'perf test python' at this point in this patchset.
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Acked-by: Suzuki Poulouse <suzuki.poulose@arm.com>
Tested-by: Tanmay Jagdale <tanmay@marvell.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Bharat Bhushan <bbhushan2@marvell.com>
Cc: George Cherian <gcherian@marvell.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Linu Cherian <lcherian@marvell.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230120143702.4035046-3-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r-- | tools/perf/util/python.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index d948455e5ed4..9e5d881b0987 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -20,6 +20,7 @@ #include "stat.h" #include "metricgroup.h" #include "util/env.h" +#include "util/pmu.h" #include <internal/lib.h> #include "util.h" @@ -83,7 +84,7 @@ void perf_stat__collect_metric_expr(struct evlist *evsel_list) } /* - * This one is needed not to drag the PMU bandwagon, jevents generated + * These ones are needed not to drag the PMU bandwagon, jevents generated * pmu_sys_event_tables, etc and evsel__find_pmu() is used so far just for * doing per PMU perf_event_attr.exclude_guest handling, not really needed, so * far, for the perf python binding known usecases, revisit if this become @@ -94,6 +95,11 @@ struct perf_pmu *evsel__find_pmu(struct evsel *evsel __maybe_unused) return NULL; } +int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt, ...) +{ + return EOF; +} + /* * Add this one here not to drag util/metricgroup.c */ |