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-next>] [day] [month] [year] [list]
Date:	Thu, 18 Mar 2010 19:49:55 +0200
From:	Aaro Koskinen <aaro.koskinen@...ia.com>
To:	linux-kernel@...r.kernel.org, arjan@...ux.intel.com
Subject: [PATCH] scripts/bootgraph.pl: ignore times until the clock is running

The clock used for printk.time=1 does not necessarily start running
from zero. On such platforms the bootgraph does not work properly as
the calculated boottime will be too long.

To correct this, the patch modifies the script to accept only non-zero
start times. This ensures the report contains entries only from the
period when the clock was running.

Signed-off-by: Aaro Koskinen <aaro.koskinen@...ia.com>
---
 scripts/bootgraph.pl |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 12caa82..ec57dd4 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -44,7 +44,7 @@ my %end;
 my %type;
 my $done = 0;
 my $maxtime = 0;
-my $firsttime = 100;
+my $firsttime = undef;
 my $count = 0;
 my %pids;
 my %pidctr;
@@ -54,10 +54,12 @@ while (<>) {
 	if ($line =~ /([0-9\.]+)\] calling  ([a-zA-Z0-9\_\.]+)\+/) {
 		my $func = $2;
 		if ($done == 0) {
-			$start{$func} = $1;
+			my $time = $1;
+			next unless $time =~ /[1-9]/;
+			$start{$func} = $time;
 			$type{$func} = 0;
-			if ($1 < $firsttime) {
-				$firsttime = $1;
+			if (not defined $firsttime) {
+				$firsttime = $time;
 			}
 		}
 		if ($line =~ /\@ ([0-9]+)/) {
@@ -77,10 +79,12 @@ while (<>) {
 			$func = "wait_" . $pid . "_" . $pidctr{$pid};
 		}
 		if ($done == 0) {
-			$start{$func} = $1;
+			my $time = $1;
+			next unless $time =~ /[1-9]/;
+			$start{$func} = $time;
 			$type{$func} = 1;
-			if ($1 < $firsttime) {
-				$firsttime = $1;
+			if (not defined $firsttime) {
+				$firsttime = $time;
 			}
 		}
 		$pids{$func} = $pid;
-- 
1.5.6.5

--
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