diff options
author | Jason Baron <jbaron@redhat.com> | 2009-04-30 13:29:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-01 08:03:35 -0400 |
commit | 56afb0f8823650f53a5f0e96d69a282e8892c61b (patch) | |
tree | 5b5d67b892f2aaf7d3e4a79017d520c8fd9e9503 | |
parent | a0e39ed378fb6ba916522764cd508fa7d42ad495 (diff) |
kerneldoc, tracing: make kernel-doc understand TRACE_EVENT() macro (take #2)
Add support to kernel-doc for tracepoint comments above TRACE_EVENT()
macro definitions. Paves the way for tracepoint docbook.
[ Impact: extend DocBook infrastructure ]
Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: akpm@linux-foundation.org
Cc: rostedt@goodmis.org
Cc: fweisbec@gmail.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: wcohen@redhat.com
LKML-Reference: <d80706b6797e277924d2f3ec9af176c6b2951f88.1241107197.git.jbaron@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rwxr-xr-x | scripts/kernel-doc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0f11870116dc..2b53a55fbece 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1827,6 +1827,25 @@ sub reset_state { | |||
1827 | $state = 0; | 1827 | $state = 0; |
1828 | } | 1828 | } |
1829 | 1829 | ||
1830 | sub tracepoint_munge($) { | ||
1831 | my $file = shift; | ||
1832 | my $tracepointname = 0; | ||
1833 | my $tracepointargs = 0; | ||
1834 | |||
1835 | if($prototype =~ m/TRACE_EVENT\((.*?),/) { | ||
1836 | $tracepointname = $1; | ||
1837 | } | ||
1838 | if($prototype =~ m/TP_PROTO\((.*?)\)/) { | ||
1839 | $tracepointargs = $1; | ||
1840 | } | ||
1841 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { | ||
1842 | print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n". | ||
1843 | "$prototype\n"; | ||
1844 | } else { | ||
1845 | $prototype = "static inline void trace_$tracepointname($tracepointargs)"; | ||
1846 | } | ||
1847 | } | ||
1848 | |||
1830 | sub syscall_munge() { | 1849 | sub syscall_munge() { |
1831 | my $void = 0; | 1850 | my $void = 0; |
1832 | 1851 | ||
@@ -1881,6 +1900,9 @@ sub process_state3_function($$) { | |||
1881 | if ($prototype =~ /SYSCALL_DEFINE/) { | 1900 | if ($prototype =~ /SYSCALL_DEFINE/) { |
1882 | syscall_munge(); | 1901 | syscall_munge(); |
1883 | } | 1902 | } |
1903 | if ($prototype =~ /TRACE_EVENT/) { | ||
1904 | tracepoint_munge($file); | ||
1905 | } | ||
1884 | dump_function($prototype, $file); | 1906 | dump_function($prototype, $file); |
1885 | reset_state(); | 1907 | reset_state(); |
1886 | } | 1908 | } |