aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bloat-o-meter3
-rwxr-xr-xscripts/checkstack.pl14
-rwxr-xr-xscripts/kernel-doc19
3 files changed, 30 insertions, 6 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 75f21d843c1d..ce59fc2d8de4 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -18,7 +18,8 @@ def getsizes(file):
18 for l in os.popen("nm --size-sort " + file).readlines(): 18 for l in os.popen("nm --size-sort " + file).readlines():
19 size, type, name = l[:-1].split() 19 size, type, name = l[:-1].split()
20 if type in "tTdDbB": 20 if type in "tTdDbB":
21 sym[name] = int(size, 16) 21 if "." in name: name = "static." + name.split(".")[0]
22 sym[name] = sym.get(name, 0) + int(size, 16)
22 return sym 23 return sym
23 24
24old = getsizes(sys.argv[1]) 25old = getsizes(sys.argv[1])
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index dadfa20ffec0..b34924663ac1 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -89,11 +89,21 @@ sub bysize($) {
89# 89#
90my $funcre = qr/^$x* <(.*)>:$/; 90my $funcre = qr/^$x* <(.*)>:$/;
91my $func; 91my $func;
92my $file, $lastslash;
93
92while (my $line = <STDIN>) { 94while (my $line = <STDIN>) {
93 if ($line =~ m/$funcre/) { 95 if ($line =~ m/$funcre/) {
94 $func = $1; 96 $func = $1;
95 } 97 }
96 if ($line =~ m/$re/) { 98 elsif ($line =~ m/(.*):\s*file format/) {
99 $file = $1;
100 $file =~ s/\.ko//;
101 $lastslash = rindex($file, "/");
102 if ($lastslash != -1) {
103 $file = substr($file, $lastslash + 1);
104 }
105 }
106 elsif ($line =~ m/$re/) {
97 my $size = $1; 107 my $size = $1;
98 $size = hex($size) if ($size =~ /^0x/); 108 $size = hex($size) if ($size =~ /^0x/);
99 109
@@ -109,7 +119,7 @@ while (my $line = <STDIN>) {
109 $addr =~ s/ /0/g; 119 $addr =~ s/ /0/g;
110 $addr = "0x$addr"; 120 $addr = "0x$addr";
111 121
112 my $intro = "$addr $func:"; 122 my $intro = "$addr $func [$file]:";
113 my $padlen = 56 - length($intro); 123 my $padlen = 56 - length($intro);
114 while ($padlen > 0) { 124 while ($padlen > 0) {
115 $intro .= ' '; 125 $intro .= ' ';
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 99fe4b7fb2f1..00e21297aefe 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -253,6 +253,7 @@ my $lineprefix="";
253# 3 - scanning prototype. 253# 3 - scanning prototype.
254# 4 - documentation block 254# 4 - documentation block
255my $state; 255my $state;
256my $in_doc_sect;
256 257
257#declaration types: can be 258#declaration types: can be
258# 'function', 'struct', 'union', 'enum', 'typedef' 259# 'function', 'struct', 'union', 'enum', 'typedef'
@@ -1064,7 +1065,7 @@ sub output_struct_man(%) {
1064 } 1065 }
1065 print "};\n.br\n"; 1066 print "};\n.br\n";
1066 1067
1067 print ".SH Arguments\n"; 1068 print ".SH Members\n";
1068 foreach $parameter (@{$args{'parameterlist'}}) { 1069 foreach $parameter (@{$args{'parameterlist'}}) {
1069 ($parameter =~ /^#/) && next; 1070 ($parameter =~ /^#/) && next;
1070 1071
@@ -1673,6 +1674,9 @@ sub process_state3_type($$) {
1673# replace <, >, and & 1674# replace <, >, and &
1674sub xml_escape($) { 1675sub xml_escape($) {
1675 my $text = shift; 1676 my $text = shift;
1677 if (($output_mode eq "text") || ($output_mode eq "man")) {
1678 return $text;
1679 }
1676 $text =~ s/\&/\\\\\\amp;/g; 1680 $text =~ s/\&/\\\\\\amp;/g;
1677 $text =~ s/\</\\\\\\lt;/g; 1681 $text =~ s/\</\\\\\\lt;/g;
1678 $text =~ s/\>/\\\\\\gt;/g; 1682 $text =~ s/\>/\\\\\\gt;/g;
@@ -1706,6 +1710,7 @@ sub process_file($) {
1706 if ($state == 0) { 1710 if ($state == 0) {
1707 if (/$doc_start/o) { 1711 if (/$doc_start/o) {
1708 $state = 1; # next line is always the function name 1712 $state = 1; # next line is always the function name
1713 $in_doc_sect = 0;
1709 } 1714 }
1710 } elsif ($state == 1) { # this line is the function name (always) 1715 } elsif ($state == 1) { # this line is the function name (always)
1711 if (/$doc_block/o) { 1716 if (/$doc_block/o) {
@@ -1756,12 +1761,20 @@ sub process_file($) {
1756 $newcontents = $2; 1761 $newcontents = $2;
1757 1762
1758 if ($contents ne "") { 1763 if ($contents ne "") {
1764 if (!$in_doc_sect && $verbose) {
1765 print STDERR "Warning(${file}:$.): contents before sections\n";
1766 ++$warnings;
1767 }
1759 dump_section($section, xml_escape($contents)); 1768 dump_section($section, xml_escape($contents));
1760 $section = $section_default; 1769 $section = $section_default;
1761 } 1770 }
1762 1771
1772 $in_doc_sect = 1;
1763 $contents = $newcontents; 1773 $contents = $newcontents;
1764 if ($contents ne "") { 1774 if ($contents ne "") {
1775 if (substr($contents, 0, 1) eq " ") {
1776 $contents = substr($contents, 1);
1777 }
1765 $contents .= "\n"; 1778 $contents .= "\n";
1766 } 1779 }
1767 $section = $newsection; 1780 $section = $newsection;
@@ -1776,7 +1789,7 @@ sub process_file($) {
1776 $prototype = ""; 1789 $prototype = "";
1777 $state = 3; 1790 $state = 3;
1778 $brcount = 0; 1791 $brcount = 0;
1779# print STDERR "end of doc comment, looking for prototype\n"; 1792# print STDERR "end of doc comment, looking for prototype\n";
1780 } elsif (/$doc_content/) { 1793 } elsif (/$doc_content/) {
1781 # miguel-style comment kludge, look for blank lines after 1794 # miguel-style comment kludge, look for blank lines after
1782 # @parameter line to signify start of description 1795 # @parameter line to signify start of description
@@ -1793,7 +1806,7 @@ sub process_file($) {
1793 print STDERR "Warning(${file}:$.): bad line: $_"; 1806 print STDERR "Warning(${file}:$.): bad line: $_";
1794 ++$warnings; 1807 ++$warnings;
1795 } 1808 }
1796 } elsif ($state == 3) { # scanning for function { (end of prototype) 1809 } elsif ($state == 3) { # scanning for function '{' (end of prototype)
1797 if ($decl_type eq 'function') { 1810 if ($decl_type eq 'function') {
1798 process_state3_function($_, $file); 1811 process_state3_function($_, $file);
1799 } else { 1812 } else {