aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/bloat-o-meter58
-rw-r--r--scripts/kconfig/conf.c18
-rw-r--r--scripts/kconfig/qconf.h6
-rwxr-xr-xscripts/kernel-doc12
-rw-r--r--scripts/mksysmap2
6 files changed, 87 insertions, 11 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 0c4f3a9f2ea9..bf96a61d4b86 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -30,7 +30,7 @@
30# - See include/linux/module.h for more details 30# - See include/linux/module.h for more details
31 31
32# Step 4 is solely used to allow module versioning in external modules, 32# Step 4 is solely used to allow module versioning in external modules,
33# where the CRC of each module is retreived from the Module.symers file. 33# where the CRC of each module is retrieved from the Module.symers file.
34 34
35.PHONY: _modpost 35.PHONY: _modpost
36_modpost: __modpost 36_modpost: __modpost
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
new file mode 100644
index 000000000000..75f21d843c1d
--- /dev/null
+++ b/scripts/bloat-o-meter
@@ -0,0 +1,58 @@
1#!/usr/bin/python
2#
3# Copyright 2004 Matt Mackall <mpm@selenic.com>
4#
5# inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
6#
7# This software may be used and distributed according to the terms
8# of the GNU General Public License, incorporated herein by reference.
9
10import sys, os, re
11
12if len(sys.argv) != 3:
13 sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])
14 sys.exit(-1)
15
16def getsizes(file):
17 sym = {}
18 for l in os.popen("nm --size-sort " + file).readlines():
19 size, type, name = l[:-1].split()
20 if type in "tTdDbB":
21 sym[name] = int(size, 16)
22 return sym
23
24old = getsizes(sys.argv[1])
25new = getsizes(sys.argv[2])
26grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0
27delta, common = [], {}
28
29for a in old:
30 if a in new:
31 common[a] = 1
32
33for name in old:
34 if name not in common:
35 remove += 1
36 down += old[name]
37 delta.append((-old[name], name))
38
39for name in new:
40 if name not in common:
41 add += 1
42 up += new[name]
43 delta.append((new[name], name))
44
45for name in common:
46 d = new.get(name, 0) - old.get(name, 0)
47 if d>0: grow, up = grow+1, up+d
48 if d<0: shrink, down = shrink+1, down-d
49 delta.append((d, name))
50
51delta.sort()
52delta.reverse()
53
54print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
55 (add, remove, grow, shrink, up, -down, up-down)
56print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")
57for d, n in delta:
58 if d: print "%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 8ba5d29d3d42..10eeae53d827 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -63,6 +63,20 @@ static void check_stdin(void)
63 } 63 }
64} 64}
65 65
66static char *fgets_check_stream(char *s, int size, FILE *stream)
67{
68 char *ret = fgets(s, size, stream);
69
70 if (ret == NULL && feof(stream)) {
71 printf(_("aborted!\n\n"));
72 printf(_("Console input is closed. "));
73 printf(_("Run 'make oldconfig' to update configuration.\n\n"));
74 exit(1);
75 }
76
77 return ret;
78}
79
66static void conf_askvalue(struct symbol *sym, const char *def) 80static void conf_askvalue(struct symbol *sym, const char *def)
67{ 81{
68 enum symbol_type type = sym_get_type(sym); 82 enum symbol_type type = sym_get_type(sym);
@@ -100,7 +114,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
100 check_stdin(); 114 check_stdin();
101 case ask_all: 115 case ask_all:
102 fflush(stdout); 116 fflush(stdout);
103 fgets(line, 128, stdin); 117 fgets_check_stream(line, 128, stdin);
104 return; 118 return;
105 case set_default: 119 case set_default:
106 printf("%s\n", def); 120 printf("%s\n", def);
@@ -356,7 +370,7 @@ static int conf_choice(struct menu *menu)
356 check_stdin(); 370 check_stdin();
357 case ask_all: 371 case ask_all:
358 fflush(stdout); 372 fflush(stdout);
359 fgets(line, 128, stdin); 373 fgets_check_stream(line, 128, stdin);
360 strip(line); 374 strip(line);
361 if (line[0] == '?') { 375 if (line[0] == '?') {
362 printf("\n%s\n", menu->sym->help ? 376 printf("\n%s\n", menu->sym->help ?
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 7c03927d4c7c..e52f3e90bf0c 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -22,8 +22,8 @@ public:
22 22
23#if QT_VERSION >= 300 23#if QT_VERSION >= 300
24 void readListSettings(); 24 void readListSettings();
25 QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok); 25 QValueList<int> readSizes(const QString& key, bool *ok);
26 bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value); 26 bool writeSizes(const QString& key, const QValueList<int>& value);
27#endif 27#endif
28 28
29 bool showAll; 29 bool showAll;
@@ -124,7 +124,7 @@ public:
124 void setParentMenu(void); 124 void setParentMenu(void);
125 125
126 template <class P> 126 template <class P>
127 void ConfigList::updateMenuList(P*, struct menu*); 127 void updateMenuList(P*, struct menu*);
128 128
129 bool updateAll; 129 bool updateAll;
130 130
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 2f45fd2969d0..9fd5f5b87d1e 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1405,6 +1405,7 @@ sub create_parameterlist($$$) {
1405 my $type; 1405 my $type;
1406 my $param; 1406 my $param;
1407 1407
1408 # temporarily replace commas inside function pointer definition
1408 while ($args =~ /(\([^\),]+),/) { 1409 while ($args =~ /(\([^\),]+),/) {
1409 $args =~ s/(\([^\),]+),/$1#/g; 1410 $args =~ s/(\([^\),]+),/$1#/g;
1410 } 1411 }
@@ -1465,11 +1466,10 @@ sub push_parameter($$$) {
1465 my $param_name = $param; 1466 my $param_name = $param;
1466 $param_name =~ s/\[.*//; 1467 $param_name =~ s/\[.*//;
1467 1468
1468 if ($type eq "" && $param eq "...") 1469 if ($type eq "" && $param =~ /\.\.\.$/)
1469 { 1470 {
1470 $type=""; 1471 $type="";
1471 $param="..."; 1472 $parameterdescs{$param} = "variable arguments";
1472 $parameterdescs{"..."} = "variable arguments";
1473 } 1473 }
1474 elsif ($type eq "" && ($param eq "" or $param eq "void")) 1474 elsif ($type eq "" && ($param eq "" or $param eq "void"))
1475 { 1475 {
@@ -1477,7 +1477,11 @@ sub push_parameter($$$) {
1477 $param="void"; 1477 $param="void";
1478 $parameterdescs{void} = "no arguments"; 1478 $parameterdescs{void} = "no arguments";
1479 } 1479 }
1480 if (defined $type && $type && !defined $parameterdescs{$param_name}) { 1480 # warn if parameter has no description
1481 # (but ignore ones starting with # as these are no parameters
1482 # but inline preprocessor statements
1483 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
1484
1481 $parameterdescs{$param_name} = $undescribed; 1485 $parameterdescs{$param_name} = $undescribed;
1482 1486
1483 if (($type eq 'function') || ($type eq 'enum')) { 1487 if (($type eq 'function') || ($type eq 'enum')) {
diff --git a/scripts/mksysmap b/scripts/mksysmap
index a6430e05972d..4390fab9f5bd 100644
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -1,7 +1,7 @@
1#!/bin/sh -x 1#!/bin/sh -x
2# Based on the vmlinux file create the System.map file 2# Based on the vmlinux file create the System.map file
3# System.map is used by module-init tools and some debugging 3# System.map is used by module-init tools and some debugging
4# tools to retreive the actual addresses of symbols in the kernel. 4# tools to retrieve the actual addresses of symbols in the kernel.
5# 5#
6# Usage 6# Usage
7# mksysmap vmlinux System.map 7# mksysmap vmlinux System.map