From patchwork Wed Apr 2 19:19:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 3930161 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEB7F9F2F7 for ; Wed, 2 Apr 2014 19:17:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FC06202E9 for ; Wed, 2 Apr 2014 19:17:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6B4F202C8 for ; Wed, 2 Apr 2014 19:17:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932868AbaDBTRs (ORCPT ); Wed, 2 Apr 2014 15:17:48 -0400 Received: from mailrelay012.isp.belgacom.be ([195.238.6.179]:21298 "EHLO mailrelay012.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932723AbaDBTRr (ORCPT ); Wed, 2 Apr 2014 15:17:47 -0400 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArobALxhPFNbtAq4/2dsb2JhbABZgwY7qxmZIgICgSAXdIJmHCMYF2skE4d9Ac9BjHKBfoQ/BI5biXwBgTORBoMyOw Received: from 184.10-180-91.adsl-dyn.isp.belgacom.be (HELO localhost) ([91.180.10.184]) by relay.skynet.be with SMTP; 02 Apr 2014 21:17:45 +0200 Date: Wed, 2 Apr 2014 21:19:33 +0200 From: Fabian Frederick To: linux-kernel Cc: akpm , linux-kbuild@vger.kernel.org Subject: [PATCH 1/1] scripts/bootgraph.pl: Add graphic header Message-Id: <20140402211933.00d5e51ae27dc46318d2c9f7@skynet.be> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding -header + help function like other .pl in /scripts. Cc: linux-kbuild@vger.kernel.org Cc: Andrew Morton Signed-off-by: Fabian Frederick --- scripts/bootgraph.pl | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index b78fca9..b8f2cd3 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 < output.svg END + help(1); exit 1; } print " \n"; print "\n"; + +if ($header) { + my $version = `uname -a`; + my $date = `date`; + print "Kernel version: $version\n"; + $cyheader = $yheader+$headerstep; + print "Date: $date\n"; +} + my @styles; $styles[0] = "fill:rgb(0,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";