Skip to content
Snippets Groups Projects
  • Kamil Rytarowski's avatar
    cb77f0d6
    scripts: Switch to more portable Perl shebang · cb77f0d6
    Kamil Rytarowski authored
    
    The default NetBSD package manager is pkgsrc and it installs Perl
    along other third party programs under custom and configurable prefix.
    The default prefix for binary prebuilt packages is /usr/pkg, and the
    Perl executable lands in /usr/pkg/bin/perl.
    
    This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
    the most portable solution that should work for almost everybody.
    Perl's executable is detected automatically.
    
    This change switches -w option passed to the executable with more
    modern "use warnings;" approach. There is no functional change to the
    default behavior.
    
    While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).
    
    Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    cb77f0d6
    History
    scripts: Switch to more portable Perl shebang
    Kamil Rytarowski authored
    
    The default NetBSD package manager is pkgsrc and it installs Perl
    along other third party programs under custom and configurable prefix.
    The default prefix for binary prebuilt packages is /usr/pkg, and the
    Perl executable lands in /usr/pkg/bin/perl.
    
    This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
    the most portable solution that should work for almost everybody.
    Perl's executable is detected automatically.
    
    This change switches -w option passed to the executable with more
    modern "use warnings;" approach. There is no functional change to the
    default behavior.
    
    While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).
    
    Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
bootgraph.pl 6.28 KiB
#!/usr/bin/env perl

# Copyright 2008, Intel Corporation
#
# This file is part of the Linux kernel
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
# Authors:
# 	Arjan van de Ven <arjan@linux.intel.com>


#
# This script turns a dmesg output into a SVG graphic that shows which
# functions take how much time. You can view SVG graphics with various
# programs, including Inkscape, The Gimp and Firefox.
#
#
# For this script to work, the kernel needs to be compiled with the
# CONFIG_PRINTK_TIME configuration option enabled, and with
# "initcall_debug" passed on the kernel command line.
#
# usage:
# 	dmesg | perl scripts/bootgraph.pl > output.svg
#

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;
my %type;
my $done = 0;