Changeset c49b79c
- Timestamp:
- 06/01/15 05:20:33 (9 years ago)
- Branches:
- master
- Children:
- 77ebdb8
- Parents:
- 4598848
- git-author:
- Hal Finkel <hfinkel@…> (06/01/15 05:20:33)
- git-committer:
- Hal Finkel <hfinkel@…> (06/01/15 05:20:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memlog_analyze
r4598848 rc49b79c 2 2 use strict; 3 3 use File::Basename; 4 use Getopt::Long; 5 6 my $print_raw_proc_name = 0; 7 my $quiet = 0; 8 my $help = 0; 9 10 sub print_usage($) { 11 my $ec = $_[0]; 12 my $usage = <<EOM; 13 Usage: $0 [options] <memlog file> [<output directory>] 14 options: 15 --print-symbol-names 16 Include symbol names and offsets in the output 17 --quiet or -q 18 Don't print status messages while running 19 EOM 20 21 print $usage; 22 exit($ec); 23 } 24 25 GetOptions("help|?" => \$help, 26 "print-symbol-names" => \$print_raw_proc_name, 27 "quiet|q" => \$quiet) 28 or print_usage(1); 29 30 if ($help) { 31 print_usage(0); 32 } 4 33 5 34 my $memlog_fn = $ARGV[0]; 6 35 my $out_dir = $ARGV[1] || '.'; 7 36 8 my $print_raw_proc_name = 0;9 10 37 if (! -f $memlog_fn) { 11 print "Usage: $0 <memlog file> [<output directory>]\n"; 12 exit 1; 38 print_usage(1); 13 39 } 14 40 … … 152 178 my $pdf_fn = "$out_dir/" . basename($memlog_fn) . ".pdf"; 153 179 180 if (!$quiet) { 181 print "Creating $txt_fn\n"; 182 } 183 154 184 open(TXT, ">$txt_fn") || die "Can't open $txt_fn: $!"; 185 186 if (!$quiet) { 187 print "Creating $dot_fn\n"; 188 } 189 155 190 open(DOT, ">$dot_fn") || die "Can't open $dot_fn: $!"; 156 191 … … 355 390 close(DOT); 356 391 392 if (!$quiet) { 393 print "Creating $ps_fn\n"; 394 } 395 357 396 system("dot -Tps2 < '$dot_fn' > '$ps_fn'"); 397 398 if (!$quiet) { 399 print "Creating $pdf_fn\n"; 400 } 401 358 402 system("ps2pdf '$ps_fn' '$pdf_fn'"); 359 403
Note: See TracChangeset
for help on using the changeset viewer.