From 241ad11f2d2542723136ffa81cd5db61d590156c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 5 Jul 2009 20:17:34 +0200 Subject: kbuild, deb-pkg: fix install scripts for posix sh bash versus dash and posh disagree on expanding $@ within double quotes: export x="$@" see http://bugs.debian.org/381091 for details just use the arglist with $*. dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install): subprocess pre-installation script returned error exit status 2 export: 6: 2.6.31-rc1-18: bad variable name fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567 seen on Ubuntu as there dash is the default sh, versus bash on Debian. Reported-by: Pauli Cc: Frans Pop Signed-off-by: maximilian attems Acked-By: Andres Salomon --- scripts/package/builddeb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/package/builddeb b/scripts/package/builddeb index b19f1f4..8b357b0 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -89,7 +89,7 @@ for script in postinst postrm preinst prerm ; do set -e # Pass maintainer script parameters to hook scripts -export DEB_MAINT_PARAMS="\$@" +export DEB_MAINT_PARAMS="\$*" test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d exit 0 -- cgit v1.1 From 668cdedfdb2eb00d8efe127618bead4d46d9e942 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 6 Jul 2009 00:07:14 -0400 Subject: kconfig: variable argument lists needs `stdarg.h' Fix build on non GNU based platforms. Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/lxdialog/util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c index 86d95cc..f2375ad 100644 --- a/scripts/kconfig/lxdialog/util.c +++ b/scripts/kconfig/lxdialog/util.c @@ -19,6 +19,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + #include "dialog.h" struct dialog_info dlg; -- cgit v1.1 From d0e1e09568507ac771072d97f0781af82c935b3e Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 6 Jul 2009 00:07:28 -0400 Subject: kconfig: initialize the screen before using curses(3) functions This is needed on non ncurses based implementation to get a properly initialized `stdscr' in main(). Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/mconf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 3bcacb4..25b60bc 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -888,6 +888,8 @@ int main(int ac, char **av) single_menu_mode = 1; } + initscr(); + getyx(stdscr, saved_y, saved_x); if (init_dialog(NULL)) { fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); -- cgit v1.1 From fc4c73554c9d93b3e495f2f7acae1323b0d5db84 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Thu, 23 Jul 2009 17:16:14 +0100 Subject: ftrace: Fix the conditional that updates $ref_func Fix the conditional that checks if we already have a $ref_func and that the new function is weak. The code as previously checking whether either condition was false, and we really need to only update $ref_func is both cconditions are false. Signed-off-by: Matt Fleming LKML-Reference: <1248365775-25196-1-git-send-email-matt@console-pimps.org> Signed-off-by: Steven Rostedt --- scripts/recordmcount.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 7109e2b..16c5563 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -414,7 +414,7 @@ while () { $read_function = 0; } else { # if we already have a function, and this is weak, skip it - if (!defined($ref_func) || !defined($weak{$text})) { + if (!defined($ref_func) && !defined($weak{$text})) { $ref_func = $text; } } -- cgit v1.1 From bd171d5ffc5cb2ba471e8205c679ee9d12b90116 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Thu, 23 Jul 2009 17:16:15 +0100 Subject: ftrace: Only update $offset when we update $ref_func The value of $offset should be the offset of $ref_func from the beginning of the object file. Therefore, we should set both variables together. This fixes a bug I was hitting on sh where $offset (which is used to calcualte the addends for the __mcount_loc entries) was being set multiple times and didn't correspond to $ref_func's offset in the object file. The addends in __mcount_loc were calculated incorrectly, resulting in ftrace dynamically modifying addresses that weren't mcount call sites. Signed-off-by: Matt Fleming LKML-Reference: <1248365775-25196-2-git-send-email-matt@console-pimps.org> Signed-off-by: Steven Rostedt --- scripts/recordmcount.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 16c5563..d29baa2 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -403,7 +403,6 @@ while () { # section found, now is this a start of a function? } elsif ($read_function && /$function_regex/) { $text_found = 1; - $offset = hex $1; $text = $2; # if this is either a local function or a weak function @@ -412,10 +411,12 @@ while () { if (!defined($locals{$text}) && !defined($weak{$text})) { $ref_func = $text; $read_function = 0; + $offset = hex $1; } else { # if we already have a function, and this is weak, skip it if (!defined($ref_func) && !defined($weak{$text})) { $ref_func = $text; + $offset = hex $1; } } } elsif ($read_headers && /$mcount_section/) { -- cgit v1.1 From 51fbb4bab6c8710eb897ab3fb06efbbc921f3a8d Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Wed, 29 Jul 2009 15:02:03 -0700 Subject: markup_oops: fix it with 32-bit userspace on a 64-bit kernel A 32-bit perl can't handle 64-bit addresses without using the BigInt package. Signed-off-by: Matthew Wilcox Acked-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/markup_oops.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index 528492b..8977401 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl use File::Basename; +use Math::BigInt; # Copyright 2008, Intel Corporation # @@ -172,8 +173,8 @@ while () { parse_x86_regs($line); } -my $decodestart = hex($target) - hex($func_offset); -my $decodestop = hex($target) + 8192; +my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset"); +my $decodestop = Math::BigInt->from_hex("0x$target") + 8192; if ($target eq "0") { print "No oops found!\n"; print "Usage: \n"; -- cgit v1.1 From 870020f93af2323a81f179091a0780dc1d5b916b Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 29 Jul 2009 15:04:28 -0700 Subject: scripts/get_maintainer.pl: Add -f directory use Don't require a specific file in a directory to be tested. Also Arnd Bergmann pointed out that the MAINTAINERS pattern requirement that directory patterns have a trailing slash was unnecessary and was likely to be error prone. Removed that requirement. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/get_maintainer.pl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 3e73314..7fc09fc 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -13,7 +13,7 @@ use strict; my $P = $0; -my $V = '0.16'; +my $V = '0.17'; use Getopt::Long qw(:config no_auto_abbrev); @@ -132,6 +132,10 @@ while () { $value =~ s@\.@\\\.@g; ##Convert . to \. $value =~ s/\*/\.\*/g; ##Convert * to .* $value =~ s/\?/\./g; ##Convert ? to . + ##if pattern is a directory and it lacks a trailing slash, add one + if ((-d $value)) { + $value =~ s@([^/])$@$1/@; + } } push(@typevalue, "$type:$value"); } elsif (!/^(\s)*$/) { @@ -146,8 +150,10 @@ close(MAINT); my @files = (); foreach my $file (@ARGV) { - next if ((-d $file)); - if (!(-f $file)) { + ##if $file is a directory and it lacks a trailing slash, add one + if ((-d $file)) { + $file =~ s@([^/])$@$1/@; + } elsif (!(-f $file)) { die "$P: file '${file}' not found\n"; } if ($from_filename) { @@ -292,7 +298,7 @@ sub file_match_pattern { sub usage { print < show version --help => show this help information +Notes: + Using "-f directory" may give unexpected results: + + Used with "--git", git signators for _all_ files in and below + directory are examined as git recurses directories. + Any specified X: (exclude) pattern matches are _not_ ignored. + Used with "--nogit", directory is used as a pattern match, + no individual file within the directory or subdirectory + is matched. EOT } -- cgit v1.1 From afa81ee13033de791c41c1d9333853504653939b Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 29 Jul 2009 15:04:28 -0700 Subject: get_maintainer.pl: Add git-min-percent option Allow an option to control the minimum percentage of sign-offs required before being considered a maintainer. git-min-percent has a default value of 5 Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/get_maintainer.pl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 7fc09fc..61ef275 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -27,6 +27,7 @@ my $email_git = 1; my $email_git_penguin_chiefs = 0; my $email_git_min_signatures = 1; my $email_git_max_maintainers = 5; +my $email_git_min_percent = 5; my $email_git_since = "1-year-ago"; my $output_multiline = 1; my $output_separator = ", "; @@ -65,6 +66,7 @@ if (!GetOptions( 'git-chief-penguins!' => \$email_git_penguin_chiefs, 'git-min-signatures=i' => \$email_git_min_signatures, 'git-max-maintainers=i' => \$email_git_max_maintainers, + 'git-min-percent=i' => \$email_git_min_percent, 'git-since=s' => \$email_git_since, 'm!' => \$email_maintainer, 'n!' => \$email_usename, @@ -307,6 +309,7 @@ MAINTAINER field selection options: --git-chief-penguins => include ${penguin_chiefs} --git-min-signatures => number of signatures required (default: 1) --git-max-maintainers => maximum maintainers to add (default: 5) + --git-min-percent => minimum percentage of commits required (default: 0) --git-since => git history to use (default: 1-year-ago) --m => include maintainer(s) if any --n => include name 'Full Name ' @@ -497,6 +500,7 @@ sub recent_git_signoffs { my $output = ""; my $count = 0; my @lines = (); + my $total_sign_offs; if (which("git") eq "") { warn("$P: git not found. Add --nogit to options?\n"); @@ -520,17 +524,26 @@ sub recent_git_signoffs { $output =~ s/^\s*//gm; @lines = split("\n", $output); + + $total_sign_offs = 0; + foreach my $line (@lines) { + if ($line =~ m/([0-9]+)\s+(.*)/) { + $total_sign_offs += $1; + } else { + die("$P: Unexpected git output: ${line}\n"); + } + } + foreach my $line (@lines) { if ($line =~ m/([0-9]+)\s+(.*)/) { my $sign_offs = $1; $line = $2; $count++; if ($sign_offs < $email_git_min_signatures || - $count > $email_git_max_maintainers) { + $count > $email_git_max_maintainers || + $sign_offs * 100 / $total_sign_offs < $email_git_min_percent) { last; } - } else { - die("$P: Unexpected git output: ${line}\n"); } if ($line =~ m/(.+)<(.+)>/) { my $git_name = $1; -- cgit v1.1 From 3d202aeb7b7b33d5a5b2040ee5af5b309782941c Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 29 Jul 2009 15:04:29 -0700 Subject: get_maintainerpl-add-git-min-percent-option-fix Allow an option to control the minimum percentage of sign-offs required before being considered a maintainer. git-min-percent has a default value of 5 Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 61ef275..278a45b 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -309,7 +309,7 @@ MAINTAINER field selection options: --git-chief-penguins => include ${penguin_chiefs} --git-min-signatures => number of signatures required (default: 1) --git-max-maintainers => maximum maintainers to add (default: 5) - --git-min-percent => minimum percentage of commits required (default: 0) + --git-min-percent => minimum percentage of commits required (default: 5) --git-since => git history to use (default: 1-year-ago) --m => include maintainer(s) if any --n => include name 'Full Name ' -- cgit v1.1 From 3f6e968ef4e1d8d93d8a8505461b0e50a9e97ad8 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 5 Aug 2009 22:00:14 -0400 Subject: tracing: do not use functions starting with .L in recordmcount.pl On Wed, 5 Aug 2009, Ingo Molnar wrote: > * Dave Airlie wrote: > > > Hey, > > > > So I spent 3-4 hrs today (I'm stupid yes) tracking down a .o > > breakage by blaming rawhide gcc/binutils as I was using make > > V=1and seeing only the compiler chain running, > > Hm, is this that powerpc related build bug you just reported? Well we tracked it down and it is powerpc64 specific. Seems that in drivers/hwmon/lm93.c there's a function called: LM93_IN_FROM_REG() But PPC64 has function descriptors and the real function names (the ones you see in objdump) start with a '.'. Thus this in objdump you have: Disassembly of section .text: 0000000000000000 <.LM93_IN_FROM_REG>: 0: 7c 08 02 a6 mflr r0 4: fb 81 ff e0 std r28,-32(r1) The function name used is .LM93_IN_FROM_REG. But gcc considers symbols that start with ".L" as a special symbol that is used inside the assembly stage. The nm passed into recordmcount uses the --synthetic option which shows the ".L" symbols (my runs outside of the build did not include the --synthetic option, so my older patch worked). We see the function as a local. Now to capture all the locations that use "mcount" we need to have a reference to link into the object file a list of mcount callers. We need a reference that will not disappear. We try to use a global function and if that does not work, we use a local function as a reference. But to relink the section back into the object, we need to make it global. In this case, we run objcopy using --globalize-symbol and --localize-symbol to convert the symbol into a global symbol, link the mcount list, then convert it back to a local symbol. This works great except for this case. .L* symbols can not be converted into a global symbol, and the mcount section referencing it will remain unresolved. Reported-by: Dave Airlie LKML-Reference: Signed-off-by: Steven Rostedt --- scripts/recordmcount.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index d29baa2..4889c44 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -414,7 +414,10 @@ while () { $offset = hex $1; } else { # if we already have a function, and this is weak, skip it - if (!defined($ref_func) && !defined($weak{$text})) { + if (!defined($ref_func) && !defined($weak{$text}) && + # PPC64 can have symbols that start with .L and + # gcc considers these special. Don't use them! + $text !~ /^\.L/) { $ref_func = $text; $offset = hex $1; } -- cgit v1.1 From 7dbdee2e9a2ac42ea5135801bcc9d1a8e3f672aa Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 6 Aug 2009 19:53:18 -0400 Subject: tracing: Fix recordmcount.pl to handle sections with only weak functions Roland Dreier found that a section that contained only a weak function in one of the staging drivers and this caused recordmcount.pl to spit out a warning and fail. Although it is strange that a driver would have a weak function, and this function only be used in one place, it should not be something to make recordmcount.pl fail. This patch fixes the issue in a simple manner: if only weak functions exist in a section, then that section will not be recorded. Reported-by: Roland Dreier Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- scripts/recordmcount.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 4889c44..911ba7f 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -393,7 +393,7 @@ while () { $read_function = 0; } # print out any recorded offsets - update_funcs() if ($text_found); + update_funcs() if (defined($ref_func)); # reset all markers and arrays $text_found = 0; @@ -444,7 +444,7 @@ while () { } # dump out anymore offsets that may have been found -update_funcs() if ($text_found); +update_funcs() if (defined($ref_func)); # If we did not find any mcount callers, we are done (do nothing). if (!$opened) { -- cgit v1.1