netns xfrm: fix "ip xfrm state|policy count" misreport
[safe/jmp/linux-2.6] / scripts / kernel-doc
index b52d340..241310e 100755 (executable)
@@ -1852,10 +1852,17 @@ sub tracepoint_munge($) {
        my $tracepointname = 0;
        my $tracepointargs = 0;
 
-       if($prototype =~ m/TRACE_EVENT\((.*?),/) {
+       if ($prototype =~ m/TRACE_EVENT\((.*?),/) {
                $tracepointname = $1;
        }
-       if($prototype =~ m/TP_PROTO\((.*?)\)/) {
+       if ($prototype =~ m/DEFINE_SINGLE_EVENT\((.*?),/) {
+               $tracepointname = $1;
+       }
+       if ($prototype =~ m/DEFINE_EVENT\((.*?),(.*?),/) {
+               $tracepointname = $2;
+       }
+       $tracepointname =~ s/^\s+//; #strip leading whitespace
+       if ($prototype =~ m/TP_PROTO\((.*?)\)/) {
                $tracepointargs = $1;
        }
        if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
@@ -1920,7 +1927,9 @@ sub process_state3_function($$) {
        if ($prototype =~ /SYSCALL_DEFINE/) {
                syscall_munge();
        }
-       if ($prototype =~ /TRACE_EVENT/) {
+       if ($prototype =~ /TRACE_EVENT/ || $prototype =~ /DEFINE_EVENT/ ||
+           $prototype =~ /DEFINE_SINGLE_EVENT/)
+       {
                tracepoint_munge($file);
        }
        dump_function($prototype, $file);
@@ -1995,6 +2004,7 @@ sub process_file($) {
     my $identifier;
     my $func;
     my $descr;
+    my $in_purpose = 0;
     my $initial_section_counter = $section_counter;
 
     if (defined($ENV{'SRCTREE'})) {
@@ -2044,6 +2054,7 @@ sub process_file($) {
                    $descr =~ s/\s*$//;
                    $descr =~ s/\s+/ /;
                    $declaration_purpose = xml_escape($descr);
+                   $in_purpose = 1;
                } else {
                    $declaration_purpose = "";
                }
@@ -2090,6 +2101,7 @@ sub process_file($) {
                }
 
                $in_doc_sect = 1;
+               $in_purpose = 0;
                $contents = $newcontents;
                if ($contents ne "") {
                    while ((substr($contents, 0, 1) eq " ") ||
@@ -2119,11 +2131,19 @@ sub process_file($) {
            } elsif (/$doc_content/) {
                # miguel-style comment kludge, look for blank lines after
                # @parameter line to signify start of description
-               if ($1 eq "" &&
-                       ($section =~ m/^@/ || $section eq $section_context)) {
-                   dump_section($file, $section, xml_escape($contents));
-                   $section = $section_default;
-                   $contents = "";
+               if ($1 eq "") {
+                   if ($section =~ m/^@/ || $section eq $section_context) {
+                       dump_section($file, $section, xml_escape($contents));
+                       $section = $section_default;
+                       $contents = "";
+                   } else {
+                       $contents .= "\n";
+                   }
+                   $in_purpose = 0;
+               } elsif ($in_purpose == 1) {
+                   # Continued declaration purpose
+                   chomp($declaration_purpose);
+                   $declaration_purpose .= " " . xml_escape($1);
                } else {
                    $contents .= $1 . "\n";
                }