kgdb: kgdboc console poll hooks for serial_txx9 uart
[safe/jmp/linux-2.6] / scripts / kernel-doc
index 5c58478..ed591e9 100755 (executable)
@@ -1468,6 +1468,8 @@ sub dump_enum($$) {
            }
 
        }
+       # strip kmemcheck_bitfield_{begin,end}.*;
+       $members =~ s/kmemcheck_bitfield_.*?;//gos;
 
        output_declaration($declaration_name,
                           'enum',
@@ -1651,6 +1653,15 @@ sub push_parameter($$$) {
        }
        }
 
+       # strip spaces from $param so that it is one continous string
+       # on @parameterlist;
+       # this fixes a problem where check_sections() cannot find
+       # a parameter like "addr[6 + 2]" because it actually appears
+       # as "addr[6", "+", "2]" on the parameter list;
+       # but it's better to maintain the param string unchanged for output,
+       # so just weaken the string compare in check_sections() to ignore
+       # "[blah" in a parameter string;
+       ###$param =~ s/\s*//g;
        push @parameterlist, $param;
        $parametertypes{$param} = $type;
 }
@@ -1669,6 +1680,14 @@ sub check_sections($$$$$$) {
                        $prm_clean = $prms[$px];
                        $prm_clean =~ s/\[.*\]//;
                        $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
+                       # ignore array size in a parameter string;
+                       # however, the original param string may contain
+                       # spaces, e.g.:  addr[6 + 2]
+                       # and this appears in @prms as "addr[6" since the
+                       # parameter list is split at spaces;
+                       # hence just ignore "[..." for the sections check;
+                       $prm_clean =~ s/\[.*//;
+
                        ##$prm_clean =~ s/^\**//;
                        if ($prm_clean eq $sects[$sx]) {
                                $err = 0;
@@ -1828,6 +1847,25 @@ sub reset_state {
     $state = 0;
 }
 
+sub tracepoint_munge($) {
+       my $file = shift;
+       my $tracepointname = 0;
+       my $tracepointargs = 0;
+
+       if($prototype =~ m/TRACE_EVENT\((.*?),/) {
+               $tracepointname = $1;
+       }
+       if($prototype =~ m/TP_PROTO\((.*?)\)/) {
+               $tracepointargs = $1;
+       }
+       if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
+               print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n".
+                            "$prototype\n";
+       } else {
+               $prototype = "static inline void trace_$tracepointname($tracepointargs)";
+       }
+}
+
 sub syscall_munge() {
        my $void = 0;
 
@@ -1882,6 +1920,9 @@ sub process_state3_function($$) {
        if ($prototype =~ /SYSCALL_DEFINE/) {
                syscall_munge();
        }
+       if ($prototype =~ /TRACE_EVENT/) {
+               tracepoint_munge($file);
+       }
        dump_function($prototype, $file);
        reset_state();
     }