]> 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)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 9 Dec 2024 23:00:03 +0000 (15:00 -0800)
commit3f61a12b08bd84e6cf705484c2cb9d5b891882fa
tree3f4b34df133aa1e08c6ca2f41e8ecbc9df892ef0
parent246dfe3dc199246bd64635163115f2691623fc53
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@kernel.org>
Link: https://lore.kernel.org/r/20241206042306.1055913-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/hwmon_pmu.c