aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-11 02:50:05 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-11 02:50:05 -0500
commit73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee (patch)
tree02cd3308d328bce9cf97bf2c1c9d5e932103ebfe /scripts
parent328257099077e8affd438c179d8a938948de2e7f (diff)
parent50c4c4e268a2d7a3e58ebb698ac74da0de40ae36 (diff)
Merge 4.15-rc3 into driver-core-next
We want the fixes and changes in here for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bloat-o-meter7
-rwxr-xr-xscripts/checkpatch.pl2
-rwxr-xr-xscripts/faddr2line21
-rwxr-xr-xscripts/kernel-doc2
4 files changed, 21 insertions, 11 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 6f099f915dcf..94b664817ad9 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -83,8 +83,11 @@ def print_result(symboltype, symbolformat, argc):
83 for d, n in delta: 83 for d, n in delta:
84 if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)) 84 if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d))
85 85
86 print("Total: Before=%d, After=%d, chg %+.2f%%" % \ 86 if otot:
87 (otot, ntot, (ntot - otot)*100.0/otot)) 87 percent = (ntot - otot) * 100.0 / otot
88 else:
89 percent = 0
90 print("Total: Before=%d, After=%d, chg %+.2f%%" % (otot, ntot, percent))
88 91
89if sys.argv[1] == "-c": 92if sys.argv[1] == "-c":
90 print_result("Function", "tT", 3) 93 print_result("Function", "tT", 3)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 95cda3ecc66b..040aa79e1d9d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5753,7 +5753,7 @@ sub process {
5753 for (my $count = $linenr; $count <= $lc; $count++) { 5753 for (my $count = $linenr; $count <= $lc; $count++) {
5754 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); 5754 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
5755 $fmt =~ s/%%//g; 5755 $fmt =~ s/%%//g;
5756 if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) { 5756 if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
5757 $bad_extension = $1; 5757 $bad_extension = $1;
5758 last; 5758 last;
5759 } 5759 }
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 1f5ce959f596..39e07d8574dd 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -44,9 +44,16 @@
44set -o errexit 44set -o errexit
45set -o nounset 45set -o nounset
46 46
47READELF="${CROSS_COMPILE}readelf"
48ADDR2LINE="${CROSS_COMPILE}addr2line"
49SIZE="${CROSS_COMPILE}size"
50NM="${CROSS_COMPILE}nm"
51
47command -v awk >/dev/null 2>&1 || die "awk isn't installed" 52command -v awk >/dev/null 2>&1 || die "awk isn't installed"
48command -v readelf >/dev/null 2>&1 || die "readelf isn't installed" 53command -v ${READELF} >/dev/null 2>&1 || die "readelf isn't installed"
49command -v addr2line >/dev/null 2>&1 || die "addr2line isn't installed" 54command -v ${ADDR2LINE} >/dev/null 2>&1 || die "addr2line isn't installed"
55command -v ${SIZE} >/dev/null 2>&1 || die "size isn't installed"
56command -v ${NM} >/dev/null 2>&1 || die "nm isn't installed"
50 57
51usage() { 58usage() {
52 echo "usage: faddr2line <object file> <func+offset> <func+offset>..." >&2 59 echo "usage: faddr2line <object file> <func+offset> <func+offset>..." >&2
@@ -69,10 +76,10 @@ die() {
69find_dir_prefix() { 76find_dir_prefix() {
70 local objfile=$1 77 local objfile=$1
71 78
72 local start_kernel_addr=$(readelf -sW $objfile | awk '$8 == "start_kernel" {printf "0x%s", $2}') 79 local start_kernel_addr=$(${READELF} -sW $objfile | awk '$8 == "start_kernel" {printf "0x%s", $2}')
73 [[ -z $start_kernel_addr ]] && return 80 [[ -z $start_kernel_addr ]] && return
74 81
75 local file_line=$(addr2line -e $objfile $start_kernel_addr) 82 local file_line=$(${ADDR2LINE} -e $objfile $start_kernel_addr)
76 [[ -z $file_line ]] && return 83 [[ -z $file_line ]] && return
77 84
78 local prefix=${file_line%init/main.c:*} 85 local prefix=${file_line%init/main.c:*}
@@ -104,7 +111,7 @@ __faddr2line() {
104 111
105 # Go through each of the object's symbols which match the func name. 112 # Go through each of the object's symbols which match the func name.
106 # In rare cases there might be duplicates. 113 # In rare cases there might be duplicates.
107 file_end=$(size -Ax $objfile | awk '$1 == ".text" {print $2}') 114 file_end=$(${SIZE} -Ax $objfile | awk '$1 == ".text" {print $2}')
108 while read symbol; do 115 while read symbol; do
109 local fields=($symbol) 116 local fields=($symbol)
110 local sym_base=0x${fields[0]} 117 local sym_base=0x${fields[0]}
@@ -156,10 +163,10 @@ __faddr2line() {
156 163
157 # pass real address to addr2line 164 # pass real address to addr2line
158 echo "$func+$offset/$sym_size:" 165 echo "$func+$offset/$sym_size:"
159 addr2line -fpie $objfile $addr | sed "s; $dir_prefix\(\./\)*; ;" 166 ${ADDR2LINE} -fpie $objfile $addr | sed "s; $dir_prefix\(\./\)*; ;"
160 DONE=1 167 DONE=1
161 168
162 done < <(nm -n $objfile | awk -v fn=$func -v end=$file_end '$3 == fn { found=1; line=$0; start=$1; next } found == 1 { found=0; print line, "0x"$1 } END {if (found == 1) print line, end; }') 169 done < <(${NM} -n $objfile | awk -v fn=$func -v end=$file_end '$3 == fn { found=1; line=$0; start=$1; next } found == 1 { found=0; print line, "0x"$1 } END {if (found == 1) print line, end; }')
163} 170}
164 171
165[[ $# -lt 2 ]] && usage 172[[ $# -lt 2 ]] && usage
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index bd29a92b4b48..df0f045a9a89 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -3248,4 +3248,4 @@ if ($verbose && $warnings) {
3248 print STDERR "$warnings warnings\n"; 3248 print STDERR "$warnings warnings\n";
3249} 3249}
3250 3250
3251exit($errors); 3251exit($output_mode eq "none" ? 0 : $errors);