diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-13 03:22:27 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-13 03:22:27 +0200 |
commit | 321d03c86732e45f5f33ad0db5b68e2e1364acb9 (patch) | |
tree | 19007efbd4ea1a09df9e3067d142ca2253fff266 /scripts/bootgraph.pl | |
parent | sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue (diff) | |
parent | scripts/coccinelle: Use PTR_ERR_OR_ZERO (diff) | |
download | linux-321d03c86732e45f5f33ad0db5b68e2e1364acb9.tar.xz linux-321d03c86732e45f5f33ad0db5b68e2e1364acb9.zip |
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull misc kbuild changes from Michal Marek:
"Here is the non-critical part of kbuild:
- One bogus coccinelle check removed, one check fixed not to suggest
the obsolete PTR_RET macro
- scripts/tags.sh does not index the generated *.mod.c files
- new objdiff tool to list differences between two versions of an
object file
- A fix for scripts/bootgraph.pl"
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
scripts/coccinelle: Use PTR_ERR_OR_ZERO
scripts/bootgraph.pl: Add graphic header
scripts: objdiff: detect object code changes between two commits
Coccicheck: Remove memcpy to struct assignment test
scripts/tags.sh: Ignore *.mod.c
Diffstat (limited to 'scripts/bootgraph.pl')
-rw-r--r-- | scripts/bootgraph.pl | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index b78fca994a15..9ca667bcaee9 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl @@ -38,6 +38,31 @@ # use strict; +use Getopt::Long; +my $header = 0; + +sub help { + my $text = << "EOM"; +Usage: +1) dmesg | perl scripts/bootgraph.pl [OPTION] > output.svg +2) perl scripts/bootgraph.pl -h + +Options: + -header Insert kernel version and date +EOM + my $std=shift; + if ($std == 1) { + print STDERR $text; + } else { + print $text; + } + exit; +} + +GetOptions( + 'h|help' =>\&help, + 'header' =>\$header +); my %start; my %end; @@ -49,6 +74,11 @@ my $count = 0; my %pids; my %pidctr; +my $headerstep = 20; +my $xheader = 15; +my $yheader = 25; +my $cyheader = 0; + while (<>) { my $line = $_; if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) { @@ -112,15 +142,23 @@ if ($count == 0) { print STDERR <<END; No data found in the dmesg. Make sure that 'printk.time=1' and 'initcall_debug' are passed on the kernel command line. -Usage: - dmesg | perl scripts/bootgraph.pl > output.svg END + help(1); exit 1; } print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; + +if ($header) { + my $version = `uname -a`; + my $date = `date`; + print "<text transform=\"translate($xheader,$yheader)\">Kernel version: $version</text>\n"; + $cyheader = $yheader+$headerstep; + print "<text transform=\"translate($xheader,$cyheader)\">Date: $date</text>\n"; +} + my @styles; $styles[0] = "fill:rgb(0,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; |