Skip to contentSkip to conversation

libperf rc_check: Enable implicitly with sanitizers

PATCH Applied Ian Rogers 2 participants 2 messages Apr 20, 2023 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 libperf rc_check: Enable implicitly with sanitizers

If using leak sanitizer then implicitly enable reference count checking.

---
 tools/lib/perf/include/internal/rc_check.h | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/lib/perf/include/internal/rc_check.h +8 -0
index c0626d8beb59..d5d771ccdc7b 100644
@@ -5,6 +5,14 @@
 #include <stdlib.h>
 #include <linux/zalloc.h>
 
+/*
+ * Enable reference count checking implicitly with leak checking, which is
+ * integrated into address sanitizer.
+ */
+#if defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
+#define REFCNT_CHECKING 1
+#endif
+
 /*
  * Shared reference count checking macros.
  *
Signature · 1 line
2.40.0.634.g4ca3ef3211-goog
maintainer Applied
#1 lore raw

Em Thu, Apr 20, 2023 at 10:18:12AM -0700, Ian Rogers escreveu:

Quoted 2 lines

If using leak sanitizer then implicitly enable reference count checking.

Thanks, applied.

- Arnaldo

Quoted 27 lines
---
 tools/lib/perf/include/internal/rc_check.h | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/lib/perf/include/internal/rc_check.h +8 -0
index c0626d8beb59..d5d771ccdc7b 100644
@@ -5,6 +5,14 @@
 #include <stdlib.h>
 #include <linux/zalloc.h>
 
+/*
+ * Enable reference count checking implicitly with leak checking, which is
+ * integrated into address sanitizer.
+ */
+#if defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
+#define REFCNT_CHECKING 1
+#endif
+
 /*
  * Shared reference count checking macros.
  *
Signature · 1 line
2.40.0.634.g4ca3ef3211-goog
Signature · 1 line
- Arnaldo