diff options
author | Ian Rogers <irogers@google.com> | 2024-05-09 08:32:45 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-05-09 18:46:43 -0300 |
commit | d790ead8a60c0f687446f7d8faa96943dc158912 (patch) | |
tree | 2071b914210e436e25ec5a1c3cd5ff24cd647fe0 /tools/kvm | |
parent | c9d492378faec5c1fb8ea1534c620f7320bbb23a (diff) | |
download | linux-stable-d790ead8a60c0f687446f7d8faa96943dc158912.tar.gz linux-stable-d790ead8a60c0f687446f7d8faa96943dc158912.tar.bz2 linux-stable-d790ead8a60c0f687446f7d8faa96943dc158912.zip |
perf tracepoint: Don't scan all tracepoints to test if one exists
In is_valid_tracepoint, rather than scanning
"/sys/kernel/tracing/events/*/*" skipping any path where
"/sys/kernel/tracing/events/*/*/id" doesn't exist, and then testing if
"*:*" matches the tracepoint name, just use the given tracepoint name
replace the ':' with '/' and see if the id file exists.
This turns a nested directory search into a single file available test.
Rather than return 1 for valid and 0 for invalid, return true and false.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240509153245.1990426-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/kvm')
0 files changed, 0 insertions, 0 deletions