diff options
-rw-r--r-- | include/linux/marker.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/linux/marker.h b/include/linux/marker.h index 338533abb47b..1290653f9241 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h | |||
@@ -58,8 +58,12 @@ struct marker { | |||
58 | * Make sure the alignment of the structure in the __markers section will | 58 | * Make sure the alignment of the structure in the __markers section will |
59 | * not add unwanted padding between the beginning of the section and the | 59 | * not add unwanted padding between the beginning of the section and the |
60 | * structure. Force alignment to the same alignment as the section start. | 60 | * structure. Force alignment to the same alignment as the section start. |
61 | * | ||
62 | * The "generic" argument controls which marker enabling mechanism must be used. | ||
63 | * If generic is true, a variable read is used. | ||
64 | * If generic is false, immediate values are used. | ||
61 | */ | 65 | */ |
62 | #define __trace_mark(name, call_private, format, args...) \ | 66 | #define __trace_mark(generic, name, call_private, format, args...) \ |
63 | do { \ | 67 | do { \ |
64 | static const char __mstrtab_##name[] \ | 68 | static const char __mstrtab_##name[] \ |
65 | __attribute__((section("__markers_strings"))) \ | 69 | __attribute__((section("__markers_strings"))) \ |
@@ -79,7 +83,7 @@ struct marker { | |||
79 | extern void marker_update_probe_range(struct marker *begin, | 83 | extern void marker_update_probe_range(struct marker *begin, |
80 | struct marker *end); | 84 | struct marker *end); |
81 | #else /* !CONFIG_MARKERS */ | 85 | #else /* !CONFIG_MARKERS */ |
82 | #define __trace_mark(name, call_private, format, args...) \ | 86 | #define __trace_mark(generic, name, call_private, format, args...) \ |
83 | __mark_check_format(format, ## args) | 87 | __mark_check_format(format, ## args) |
84 | static inline void marker_update_probe_range(struct marker *begin, | 88 | static inline void marker_update_probe_range(struct marker *begin, |
85 | struct marker *end) | 89 | struct marker *end) |
@@ -87,15 +91,30 @@ static inline void marker_update_probe_range(struct marker *begin, | |||
87 | #endif /* CONFIG_MARKERS */ | 91 | #endif /* CONFIG_MARKERS */ |
88 | 92 | ||
89 | /** | 93 | /** |
90 | * trace_mark - Marker | 94 | * trace_mark - Marker using code patching |
91 | * @name: marker name, not quoted. | 95 | * @name: marker name, not quoted. |
92 | * @format: format string | 96 | * @format: format string |
93 | * @args...: variable argument list | 97 | * @args...: variable argument list |
94 | * | 98 | * |
95 | * Places a marker. | 99 | * Places a marker using optimized code patching technique (imv_read()) |
100 | * to be enabled when immediate values are present. | ||
96 | */ | 101 | */ |
97 | #define trace_mark(name, format, args...) \ | 102 | #define trace_mark(name, format, args...) \ |
98 | __trace_mark(name, NULL, format, ## args) | 103 | __trace_mark(0, name, NULL, format, ## args) |
104 | |||
105 | /** | ||
106 | * _trace_mark - Marker using variable read | ||
107 | * @name: marker name, not quoted. | ||
108 | * @format: format string | ||
109 | * @args...: variable argument list | ||
110 | * | ||
111 | * Places a marker using a standard memory read (_imv_read()) to be | ||
112 | * enabled. Should be used for markers in code paths where instruction | ||
113 | * modification based enabling is not welcome. (__init and __exit functions, | ||
114 | * lockdep, some traps, printk). | ||
115 | */ | ||
116 | #define _trace_mark(name, format, args...) \ | ||
117 | __trace_mark(1, name, NULL, format, ## args) | ||
99 | 118 | ||
100 | /** | 119 | /** |
101 | * MARK_NOARGS - Format string for a marker with no argument. | 120 | * MARK_NOARGS - Format string for a marker with no argument. |