hotkernel revision 1
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# hotkernel - sample on-CPU kernel-level functions and modules.
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# Written using Perl and DTrace (Solaris 10 03/05)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# This samples the on-CPU function at 1001 Hertz, for a simple yet
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# effective kernel-level profiling tool for sampling exclusive function time.
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# The output will identify which function is on the CPU the most - which is
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# the hottest. See Notes/ALLexclusive_notes.txt for an explanation of
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# exclusive time.
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# $Id: hotkernel 65 2007-10-04 11:09:40Z brendan $
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# USAGE: hotkernel [-hm]
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# -h # help
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# -m # match modules, not functions
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# hotkernel # sample kernel functions
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# hotkernel -m # sample kernel modules
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl# FUNCTION Function name
use strict;
my $args;
my %Count;
my $total;
next if $line =~ /^\s*$/;