From: Frederic Weisbecker <fweisbec@gmail.com>
To: mingo@elte.hu
Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org,
arjan@infradead.org, alan-jenkins@tuffmail.co.uk
Subject: [PATCH -tip] Fastboot: fix initcalls disposition in bootgraph.pl
Date: Sat, 04 Oct 2008 21:35:48 +0200 [thread overview]
Message-ID: <48E7C594.4030400@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]
When bootgraph.pl parses a file, it gives one row
for each initcall's pid. But only few of them will
be displayed => the longest.
This patch corrects it by giving only a rows for pids
which have initcalls that will be displayed.
You can see the result in attachment, before and after the patch.
Ingo, could you please revert the commit b4bc656397071b18c99e85d9181f076e44de8a99 which was a false solution
to solve this problem. Thanks.
(I'm sorry if the patch doesn't look smart. I've
never touch a line in perl until now).
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
scripts/bootgraph.pl | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 2243353..5e7316e 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -37,13 +37,13 @@
# dmesg | perl scripts/bootgraph.pl > output.svg
#
-my @rows;
-my %start, %end, %row;
+my %start, %end;
my $done = 0;
-my $rowcount = 0;
my $maxtime = 0;
my $firsttime = 100;
my $count = 0;
+my %pids;
+
while (<>) {
my $line = $_;
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) {
@@ -54,14 +54,8 @@ while (<>) {
$firsttime = $1;
}
}
- $row{$func} = 1;
if ($line =~ /\@ ([0-9]+)/) {
- my $pid = $1;
- if (!defined($rows[$pid])) {
- $rowcount = $rowcount + 1;
- $rows[$pid] = $rowcount;
- }
- $row{$func} = $rows[$pid];
+ $pids{$func} = $1;
}
$count = $count + 1;
}
@@ -109,17 +103,25 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(
my $mult = 950.0 / ($maxtime - $firsttime);
my $threshold = ($maxtime - $firsttime) / 60.0;
my $stylecounter = 0;
+my %rows;
+my $rowscount = 1;
while (($key,$value) = each %start) {
my $duration = $end{$key} - $start{$key};
if ($duration >= $threshold) {
my $s, $s2, $e, $y;
+ $pid = $pids{$key};
+
+ if (!defined($rows{$pid})) {
+ $rows{$pid} = $rowscount;
+ $rowscount = $rowscount + 1;
+ }
$s = ($value - $firsttime) * $mult;
$s2 = $s + 6;
$e = ($end{$key} - $firsttime) * $mult;
$w = $e - $s;
- $y = $row{$key} * 150;
+ $y = $rows{$pid} * 150;
$y2 = $y + 4;
$style = $styles[$stylecounter];
[-- Attachment #2: before.svg --]
[-- Type: image/svg+xml, Size: 2315 bytes --]
[-- Attachment #3: after.svg --]
[-- Type: image/svg+xml, Size: 2309 bytes --]
next reply other threads:[~2008-10-04 19:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-04 19:35 Frederic Weisbecker [this message]
2008-10-04 20:19 ` [PATCH -tip] Fastboot: fix initcalls disposition in bootgraph.pl Arjan van de Ven
2008-10-04 20:28 ` Frédéric Weisbecker
2008-10-04 20:39 ` Arjan van de Ven
2008-10-05 9:55 ` Ingo Molnar
2008-10-05 11:22 ` Frédéric Weisbecker
[not found] ` <20081006071209.GB23506@elte.hu>
[not found] ` <c62985530810060213k189095e5xb791e98db45c370d@mail.gmail.com>
2008-10-06 12:20 ` Frederic Weisbecker
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=48E7C594.4030400@gmail.com \
--to=fweisbec@gmail.com \
--cc=alan-jenkins@tuffmail.co.uk \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.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