aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_probe.c')
-rw-r--r--kernel/trace/trace_probe.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 74e80a582c28..8c0553d9afd3 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -36,24 +36,28 @@ const char *reserved_field_names[] = {
36}; 36};
37 37
38/* Printing in basic type function template */ 38/* Printing in basic type function template */
39#define DEFINE_BASIC_PRINT_TYPE_FUNC(type, fmt) \ 39#define DEFINE_BASIC_PRINT_TYPE_FUNC(tname, type, fmt) \
40int PRINT_TYPE_FUNC_NAME(type)(struct trace_seq *s, const char *name, \ 40int PRINT_TYPE_FUNC_NAME(tname)(struct trace_seq *s, const char *name, \
41 void *data, void *ent) \ 41 void *data, void *ent) \
42{ \ 42{ \
43 trace_seq_printf(s, " %s=" fmt, name, *(type *)data); \ 43 trace_seq_printf(s, " %s=" fmt, name, *(type *)data); \
44 return !trace_seq_has_overflowed(s); \ 44 return !trace_seq_has_overflowed(s); \
45} \ 45} \
46const char PRINT_TYPE_FMT_NAME(type)[] = fmt; \ 46const char PRINT_TYPE_FMT_NAME(tname)[] = fmt; \
47NOKPROBE_SYMBOL(PRINT_TYPE_FUNC_NAME(type)); 47NOKPROBE_SYMBOL(PRINT_TYPE_FUNC_NAME(tname));
48 48
49DEFINE_BASIC_PRINT_TYPE_FUNC(u8 , "0x%x") 49DEFINE_BASIC_PRINT_TYPE_FUNC(u8, u8, "%u")
50DEFINE_BASIC_PRINT_TYPE_FUNC(u16, "0x%x") 50DEFINE_BASIC_PRINT_TYPE_FUNC(u16, u16, "%u")
51DEFINE_BASIC_PRINT_TYPE_FUNC(u32, "0x%x") 51DEFINE_BASIC_PRINT_TYPE_FUNC(u32, u32, "%u")
52DEFINE_BASIC_PRINT_TYPE_FUNC(u64, "0x%Lx") 52DEFINE_BASIC_PRINT_TYPE_FUNC(u64, u64, "%Lu")
53DEFINE_BASIC_PRINT_TYPE_FUNC(s8, "%d") 53DEFINE_BASIC_PRINT_TYPE_FUNC(s8, s8, "%d")
54DEFINE_BASIC_PRINT_TYPE_FUNC(s16, "%d") 54DEFINE_BASIC_PRINT_TYPE_FUNC(s16, s16, "%d")
55DEFINE_BASIC_PRINT_TYPE_FUNC(s32, "%d") 55DEFINE_BASIC_PRINT_TYPE_FUNC(s32, s32, "%d")
56DEFINE_BASIC_PRINT_TYPE_FUNC(s64, "%Ld") 56DEFINE_BASIC_PRINT_TYPE_FUNC(s64, s64, "%Ld")
57DEFINE_BASIC_PRINT_TYPE_FUNC(x8, u8, "0x%x")
58DEFINE_BASIC_PRINT_TYPE_FUNC(x16, u16, "0x%x")
59DEFINE_BASIC_PRINT_TYPE_FUNC(x32, u32, "0x%x")
60DEFINE_BASIC_PRINT_TYPE_FUNC(x64, u64, "0x%Lx")
57 61
58/* Print type function for string type */ 62/* Print type function for string type */
59int PRINT_TYPE_FUNC_NAME(string)(struct trace_seq *s, const char *name, 63int PRINT_TYPE_FUNC_NAME(string)(struct trace_seq *s, const char *name,