diff options
Diffstat (limited to 'kernel/trace/trace_probe.c')
-rw-r--r-- | kernel/trace/trace_probe.c | 30 |
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) \ |
40 | int PRINT_TYPE_FUNC_NAME(type)(struct trace_seq *s, const char *name, \ | 40 | int 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 | } \ |
46 | const char PRINT_TYPE_FMT_NAME(type)[] = fmt; \ | 46 | const char PRINT_TYPE_FMT_NAME(tname)[] = fmt; \ |
47 | NOKPROBE_SYMBOL(PRINT_TYPE_FUNC_NAME(type)); | 47 | NOKPROBE_SYMBOL(PRINT_TYPE_FUNC_NAME(tname)); |
48 | 48 | ||
49 | DEFINE_BASIC_PRINT_TYPE_FUNC(u8 , "0x%x") | 49 | DEFINE_BASIC_PRINT_TYPE_FUNC(u8, u8, "%u") |
50 | DEFINE_BASIC_PRINT_TYPE_FUNC(u16, "0x%x") | 50 | DEFINE_BASIC_PRINT_TYPE_FUNC(u16, u16, "%u") |
51 | DEFINE_BASIC_PRINT_TYPE_FUNC(u32, "0x%x") | 51 | DEFINE_BASIC_PRINT_TYPE_FUNC(u32, u32, "%u") |
52 | DEFINE_BASIC_PRINT_TYPE_FUNC(u64, "0x%Lx") | 52 | DEFINE_BASIC_PRINT_TYPE_FUNC(u64, u64, "%Lu") |
53 | DEFINE_BASIC_PRINT_TYPE_FUNC(s8, "%d") | 53 | DEFINE_BASIC_PRINT_TYPE_FUNC(s8, s8, "%d") |
54 | DEFINE_BASIC_PRINT_TYPE_FUNC(s16, "%d") | 54 | DEFINE_BASIC_PRINT_TYPE_FUNC(s16, s16, "%d") |
55 | DEFINE_BASIC_PRINT_TYPE_FUNC(s32, "%d") | 55 | DEFINE_BASIC_PRINT_TYPE_FUNC(s32, s32, "%d") |
56 | DEFINE_BASIC_PRINT_TYPE_FUNC(s64, "%Ld") | 56 | DEFINE_BASIC_PRINT_TYPE_FUNC(s64, s64, "%Ld") |
57 | DEFINE_BASIC_PRINT_TYPE_FUNC(x8, u8, "0x%x") | ||
58 | DEFINE_BASIC_PRINT_TYPE_FUNC(x16, u16, "0x%x") | ||
59 | DEFINE_BASIC_PRINT_TYPE_FUNC(x32, u32, "0x%x") | ||
60 | DEFINE_BASIC_PRINT_TYPE_FUNC(x64, u64, "0x%Lx") | ||
57 | 61 | ||
58 | /* Print type function for string type */ | 62 | /* Print type function for string type */ |
59 | int PRINT_TYPE_FUNC_NAME(string)(struct trace_seq *s, const char *name, | 63 | int PRINT_TYPE_FUNC_NAME(string)(struct trace_seq *s, const char *name, |