From 34e70fdb5123df0ba5d91f08a4af3b2dd22baf09 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Mon, 23 May 2016 10:46:23 +0100 Subject: [PATCH] dtrace: make perf-events probes separately configured This makes them look like every other provider, and lets us conditionalize them on CONFIG_TRACEPOINTS, like other tracepoint users do. Orabug: 23004534 Signed-off-by: Nick Alcock Acked-by: Kris Van Hees --- include/linux/sdt.h | 8 ++++++++ kernel/dtrace/Kconfig | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/include/linux/sdt.h b/include/linux/sdt.h index c44db3de6654..1a745548e915 100644 --- a/include/linux/sdt.h +++ b/include/linux/sdt.h @@ -122,6 +122,8 @@ extern "C" { (uintptr_t)(arg6), (uintptr_t)(arg7), (uintptr_t)(arg8)); \ } +#ifdef CONFIG_DT_SDT_PERF + /* This counts the number of args */ #define DTRACE_NARGS_SEQ(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,N,...) N #define DTRACE_NARGS(...) DTRACE_NARGS_SEQ(__VA_ARGS__, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) @@ -184,6 +186,12 @@ extern "C" { __dtrace_probe_##name(DTRACE_APPLY(DTRACE_UINTPTR_CAST_EACH, args)); \ } +#else + +#define DTRACE_PROBE_TRACEPOINT(name, args...) + +#endif + typedef struct sdt_probedesc { char *sdpd_name; /* probe name */ char *sdpd_func; /* probe function */ diff --git a/kernel/dtrace/Kconfig b/kernel/dtrace/Kconfig index 80a0262d3d94..b5747c77a2dd 100644 --- a/kernel/dtrace/Kconfig +++ b/kernel/dtrace/Kconfig @@ -46,6 +46,14 @@ config DT_SDT help To be written. +config DT_SDT_PERF + bool "DTrace perf-events Probes" + default y + depends on DT_SDT + select TRACEPOINTS + help + To be written. + config DT_SYSTRACE tristate "System Call Tracing" default m -- 2.50.1