All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/5] perf test: Sanity check file descriptors are cleaned up
@ 2025-06-24 19:03 Ian Rogers
  2025-06-24 19:03 ` [PATCH v1 1/5] perf dso: Add missed dso__put to dso__load_kcore Ian Rogers
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Ian Rogers @ 2025-06-24 19:03 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Kan Liang, James Clark, Howard Chu,
	Charlie Jenkins, Thomas Richter, Athira Rajeev, Stephen Brennan,
	Jean-Philippe Romain, Junhao He, Dr. David Alan Gilbert,
	Dmitry Vyukov, linux-perf-users, linux-kernel

Some recent patches showed we were leaking file descriptors:
https://lore.kernel.org/lkml/20250617223356.2752099-2-irogers@google.com/

When a test is forked the file descriptors >3 can be closed and then
any file descriptors >3 left after the test are leaks. Add this
checking to the forked test code. Prior to that clean up some file
descriptor usage so we can assert that only file descriptors are
cleaned up. Sometimes the file descriptor being held open is the
result of a memory leak, so fix those.

Ian Rogers (5):
  perf dso: Add missed dso__put to dso__load_kcore
  perf test code-reading: Avoid a leak of cpus and threads
  perf hwmon_pmu: Hold path rather than fd
  perf dso: With ref count checking, avoid dso_data holding dso live
  perf test: In forked mode add check that fds aren't leaked

 tools/perf/tests/builtin-test.c | 69 +++++++++++++++++++++++++++++++++
 tools/perf/tests/code-reading.c |  7 ----
 tools/perf/tests/hwmon_pmu.c    | 11 +++---
 tools/perf/util/dso.c           |  4 ++
 tools/perf/util/hwmon_pmu.c     | 38 +++++++++++++-----
 tools/perf/util/hwmon_pmu.h     |  4 +-
 tools/perf/util/pmus.c          |  2 +-
 tools/perf/util/pmus.h          |  2 +-
 tools/perf/util/symbol.c        |  1 +
 9 files changed, 112 insertions(+), 26 deletions(-)

-- 
2.50.0.714.g196bf9f422-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-07-03 18:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 19:03 [PATCH v1 0/5] perf test: Sanity check file descriptors are cleaned up Ian Rogers
2025-06-24 19:03 ` [PATCH v1 1/5] perf dso: Add missed dso__put to dso__load_kcore Ian Rogers
2025-06-24 19:03 ` [PATCH v1 2/5] perf test code-reading: Avoid a leak of cpus and threads Ian Rogers
2025-06-24 19:03 ` [PATCH v1 3/5] perf hwmon_pmu: Hold path rather than fd Ian Rogers
2025-06-24 19:03 ` [PATCH v1 4/5] perf dso: With ref count checking, avoid dso_data holding dso live Ian Rogers
2025-06-24 19:03 ` [PATCH v1 5/5] perf test: In forked mode add check that fds aren't leaked Ian Rogers
2025-07-03  2:20 ` [PATCH v1 0/5] perf test: Sanity check file descriptors are cleaned up Namhyung Kim
2025-07-03  3:03   ` Ian Rogers
2025-07-03 18:18     ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.