lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100222102229.78e3c0e2@nehalam>
Date:	Mon, 22 Feb 2010 10:22:29 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	rostedt@...dmis.org
Cc:	Arjan van de Ven <arjan@...ux.intel.com>,
	Cong Wang <amwang@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Luis R. Rodriguez" <lrodriguez@...eros.com>,
	Sam Ravnborg <sam@...nborg.org>,
	Vegard Nossum <vegard.nossum@...il.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	"Robert P. J. Day" <rpjday@...shcourse.ca>,
	Arnd Bergmann <arnd@...db.de>, Hui Zhu <teawater@...il.com>,
	Ozan Ãaglayan <ozan@...dus.org.tr>,
	Matthew Wilcox <willy@...ux.intel.com>,
	Li Hong <lihong.hi@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Matt Fleming <matt@...sole-pimps.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scripts: improve checkstack

Cleanup checkstack script:
  * Turn on strict checking
  * Fix resulting error message because the declaration syntax
    was incorrect.
  * Remove incorrect and misleading use of prototype
     - prototype not required for this type of sort function
       because $a and $b are being used in this contex
     - if prototype was being used it should be for both arguments
  * Use closure for sort function

Signed-off-by: Stephen Hemminger <shemminger@...tta.com>


--- a/scripts/checkstack.pl	2010-02-22 10:15:08.120323236 -0800
+++ b/scripts/checkstack.pl	2010-02-22 10:17:49.878421919 -0800
@@ -21,6 +21,8 @@
 #
 #	TODO :	Port to all architectures (one regex per arch)
 
+use strict;
+
 # check for arch
 #
 # $re is used for two matches:
@@ -104,19 +106,11 @@ my (@stack, $re, $dre, $x, $xs);
 	}
 }
 
-sub bysize($) {
-	my ($asize, $bsize);
-	($asize = $a) =~ s/.*:	*(.*)$/$1/;
-	($bsize = $b) =~ s/.*:	*(.*)$/$1/;
-	$bsize <=> $asize
-}
-
 #
 # main()
 #
 my $funcre = qr/^$x* <(.*)>:$/;
-my $func;
-my $file, $lastslash;
+my ($func, $file, $lastslash);
 
 while (my $line = <STDIN>) {
 	if ($line =~ m/$funcre/) {
@@ -173,4 +167,6 @@ while (my $line = <STDIN>) {
 	}
 }
 
-print sort bysize @stack;
+# Sort output by size (last field)
+print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack;
+
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ