]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf hwmon_pmu: Use openat rather than dup to refresh directory
authorIan Rogers <irogers@google.com>
Fri, 6 Dec 2024 04:23:05 +0000 (20:23 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Dec 2024 21:15:30 +0000 (18:15 -0300)
commit9a4426120dddab113782ea9cb331e5c03e2231ff
tree45879fac3f564c659900510821c1db0b153d6877
parent5e530a8287b7c935eeb56d65c11d0f823b3dc0a7
perf hwmon_pmu: Use openat rather than dup to refresh directory

The hwmon PMU test will make a temp directory, open the directory with
O_DIRECTORY then fill it with contents. As the open is before the
filling the contents the later fdopendir may reflect the initial empty
state, meaning no events are seen. Change to re-open the directory,
rather than dup the fd, so the latest contents are seen.

Minor tweaks/additions to debug messages.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20241206042306.1055913-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/hwmon_pmu.c