Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libperf rc_check: Enable implicitly with sanitizers

If using leak sanitizer then implicitly enable reference count checking.

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: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230420171812.561603-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
9be6ab18 edd4cab2

+8
+8
tools/lib/perf/include/internal/rc_check.h
··· 6 6 #include <linux/zalloc.h> 7 7 8 8 /* 9 + * Enable reference count checking implicitly with leak checking, which is 10 + * integrated into address sanitizer. 11 + */ 12 + #if defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) 13 + #define REFCNT_CHECKING 1 14 + #endif 15 + 16 + /* 9 17 * Shared reference count checking macros. 10 18 * 11 19 * Reference count checking is an approach to sanitizing the use of reference