diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-29 16:29:14 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-29 16:29:14 -0800 |
commit | b204513bbfbac10a826e485f677c7ed77e342d52 (patch) | |
tree | 38365209cd12a8f67f506011e81baa1397990645 /functions | |
parent | 7c4f84496228c1ef73b4926d426588de8318125b (diff) | |
download | vyatta-op-b204513bbfbac10a826e485f677c7ed77e342d52.tar.gz vyatta-op-b204513bbfbac10a826e485f677c7ed77e342d52.zip |
Change name of cpu summary script and rearrange
Final answer.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/cpu-info | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/functions/cpu-info b/functions/cpu-info deleted file mode 100755 index 1839a5d..0000000 --- a/functions/cpu-info +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/perl -# implement "show cpu-info" - -open my $cpuinfo, '<', '/proc/cpuinfo' - or die "Can't open /proc/cpuinfo : $!"; - -my %models; -my %packages; -my %cores; - -my %map = ( - 'model name' => \%models, - 'physical id' => \%packages, - 'core id' => \%cores -); - -my $cpu = 0; -while (<$cpuinfo>) { - chomp; - my ( $tag, $val ) = split /:/; - if ( !$tag ) { - ++$cpu; - next; - } - - $tag =~ s/\s+$//; - $val =~ s/^\s+//; - - my $ref = $map{$tag}; - $ref->{$val} = $cpu if ($ref); -} -close $cpuinfo; - -print "CPU ", join( " \n", keys %models ), "\n"; -print "Packages ", scalar keys %packages, "\n"; -print "Cores ", scalar keys %cores, "\n"; -print "Threads ", $cpu, "\n"; |