Guest User

Untitled

a guest
Nov 2nd, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.61 KB | None | 0 0
  1. my @binaries = qw[
  2.     /boot/vmlinuz-linux
  3.     /usr/bin/bash
  4.     /usr/bin/tar
  5.     /usr/bin/gzip
  6.     /usr/bin/geany
  7.     /usr/bin/python
  8.     /usr/bin/perl
  9.     /usr/bin/thunar
  10.     /usr/bin/firefox
  11.     /usr/lib/xorg/modules/drivers/radeon_drv.so
  12.     /usr/bin/git
  13. ];
  14.  
  15. for $input (sort @binaries) {
  16.     unless (-e $input) {
  17.         warn "Skipping $input.\n";
  18.         next;
  19.     }
  20.     open STDIN, "-|", "objdump -d $input";
  21.  
  22.     my $sum = 0;
  23.     my $count = 0;
  24.     for (<>) {
  25.         unless (m/\(bad\)/) {
  26.             if (m/:\t([^\t]*)\t/) {
  27.                 $sum += scalar(split / /, ($1 =~ s/ *$//r));
  28.                 ++$count;
  29.             }
  30.         }
  31.     }
  32.  
  33.     print "Average for $input = ", $sum / $count, "\n";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment