diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-02-13 18:03:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-13 19:21:20 -0500 |
commit | b2e3e658b344c6bcfb8fb694100ab2f2b5b2edb0 (patch) | |
tree | a2999226edcb6b293c2044716a0146c7f2f82a22 /scripts/mod/modpost.h | |
parent | fb40bd78b0f91b274879cf5db8facd1e04b6052e (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 'scripts/mod/modpost.h')
-rw-r--r-- | scripts/mod/modpost.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 999f15e0e008..565c5872407e 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h | |||
@@ -112,6 +112,8 @@ struct module { | |||
112 | int has_init; | 112 | int has_init; |
113 | int has_cleanup; | 113 | int has_cleanup; |
114 | struct buffer dev_table_buf; | 114 | struct buffer dev_table_buf; |
115 | char **markers; | ||
116 | size_t nmarkers; | ||
115 | char srcversion[25]; | 117 | char srcversion[25]; |
116 | }; | 118 | }; |
117 | 119 | ||
@@ -126,6 +128,7 @@ struct elf_info { | |||
126 | Elf_Section export_gpl_sec; | 128 | Elf_Section export_gpl_sec; |
127 | Elf_Section export_unused_gpl_sec; | 129 | Elf_Section export_unused_gpl_sec; |
128 | Elf_Section export_gpl_future_sec; | 130 | Elf_Section export_gpl_future_sec; |
131 | Elf_Section markers_strings_sec; | ||
129 | const char *strtab; | 132 | const char *strtab; |
130 | char *modinfo; | 133 | char *modinfo; |
131 | unsigned int modinfo_len; | 134 | unsigned int modinfo_len; |