From: Aaro Koskinen <aaro.koskinen@nokia.com>
To: linux-kernel@vger.kernel.org, arjan@linux.intel.com
Subject: [PATCH] scripts/bootgraph.pl: ignore times until the clock is running
Date: Thu, 18 Mar 2010 19:49:55 +0200 [thread overview]
Message-ID: <1268934595-22544-1-git-send-email-aaro.koskinen@nokia.com> (raw)
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@nokia.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
next reply other threads:[~2010-03-18 17:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-18 17:49 Aaro Koskinen [this message]
2010-03-18 18:24 ` Arjan van de Ven
2010-03-19 14:15 ` Aaro Koskinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1268934595-22544-1-git-send-email-aaro.koskinen@nokia.com \
--to=aaro.koskinen@nokia.com \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®