aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/marker.h
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-02-13 18:03:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 19:21:20 -0500
commitb2e3e658b344c6bcfb8fb694100ab2f2b5b2edb0 (patch)
treea2999226edcb6b293c2044716a0146c7f2f82a22 /include/linux/marker.h
parentfb40bd78b0f91b274879cf5db8facd1e04b6052e (diff)
Linux Kernel Markers: create modpost file
This adds some new magic in the MODPOST phase for CONFIG_MARKERS. Analogous to the Module.symvers file, the build will now write a Module.markers file when CONFIG_MARKERS=y is set. This file lists the name, defining module, and format string of each marker, separated by \t characters. This simple text file can be used by offline build procedures for instrumentation code, analogous to how System.map and Module.symvers can be useful to have for kernels other than the one you are running right now. The strings are made easy to extract by having the __trace_mark macro define the name and format together in a single array called __mstrtab_* in the __markers_strings section. This is straightforward and reliable as long as the marker structs are always defined by this macro. It is an unreasonable amount of hairy work to extract the string pointers from the __markers section structs, which entails handling a relocation type for every machine under the sun. Mathieu : - Ran through checkpatch.pl Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: David Smith <dsmith@redhat.com> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/marker.h')
-rw-r--r--include/linux/marker.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/marker.h b/include/linux/marker.h
index b5f95637f289..5df879dc3776 100644
--- a/include/linux/marker.h
+++ b/include/linux/marker.h
@@ -61,15 +61,12 @@ struct marker {
61 */ 61 */
62#define __trace_mark(name, call_private, format, args...) \ 62#define __trace_mark(name, call_private, format, args...) \
63 do { \ 63 do { \
64 static const char __mstrtab_name_##name[] \ 64 static const char __mstrtab_##name[] \
65 __attribute__((section("__markers_strings"))) \ 65 __attribute__((section("__markers_strings"))) \
66 = #name; \ 66 = #name "\0" format; \
67 static const char __mstrtab_format_##name[] \
68 __attribute__((section("__markers_strings"))) \
69 = format; \
70 static struct marker __mark_##name \ 67 static struct marker __mark_##name \
71 __attribute__((section("__markers"), aligned(8))) = \ 68 __attribute__((section("__markers"), aligned(8))) = \
72 { __mstrtab_name_##name, __mstrtab_format_##name, \ 69 { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \
73 0, 0, marker_probe_cb, \ 70 0, 0, marker_probe_cb, \
74 { __mark_empty_function, NULL}, NULL }; \ 71 { __mark_empty_function, NULL}, NULL }; \
75 __mark_check_format(format, ## args); \ 72 __mark_check_format(format, ## args); \