aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-05-12 15:21:10 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 16:26:03 -0400
commit0aa977f592f17004f9d1d545f2e1bb9ea71896c3 (patch)
tree3568f8f505ca613c64e7e5c863a829429c728ee1
parentdc102a8fae2d0d6bf5223fc549247f2e23959ae6 (diff)
Markers - define non optimized marker
To support the forthcoming "immediate values" marker optimization, we must have a way to declare markers in few code paths that does not use instruction modification based enable. This will be the case of printk(), some traps and eventually lockdep instrumentation. Changelog : - Fix reversed boolean logic of "generic". Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/marker.h29
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 {
79extern void marker_update_probe_range(struct marker *begin, 83extern 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)
84static inline void marker_update_probe_range(struct marker *begin, 88static 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.