Changeset 5df7203 for memlog_analyze
- Timestamp:
- 06/01/15 06:25:13 (9 years ago)
- Branches:
- master
- Children:
- d270799
- Parents:
- 0109b01
- git-author:
- Hal Finkel <hfinkel@…> (06/01/15 06:25:13)
- git-committer:
- Hal Finkel <hfinkel@…> (06/01/15 06:25:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memlog_analyze
r9fcaba3 r5df7203 12 12 my $ec = $_[0]; 13 13 my $usage = <<EOM; 14 Usage: $0 [options] <memlog file > [<output directory>]14 Usage: $0 [options] <memlog file or glob> [<output directory>] 15 15 options: 16 16 --leaks … … 40 40 41 41 if (! -f $memlog_fn) { 42 my @pot_fns = glob($memlog_fn); 43 if (scalar(@pot_fns)) { 44 if (!$quiet) { 45 print "Searching all files matching '$memlog_fn'\n"; 46 } 47 48 my $pot_max_rss = 0; 49 my $pos_max_rss_fn; 50 foreach my $pot_fn (@pot_fns) { 51 my $last_line = `tail -n 1 '$pot_fn'`; 52 chomp($last_line); 53 54 my @parts = split(/\t/, $last_line); 55 56 my $op = shift(@parts); 57 my $state = shift(@parts); 58 59 my ($time, $then_max_rss, $tid) = split(/\s+/, $state); 60 if ($pot_max_rss < $then_max_rss) { 61 $pot_max_rss = $then_max_rss; 62 $pos_max_rss_fn = $pot_fn; 63 } 64 } 65 66 if (defined $pos_max_rss_fn) { 67 $memlog_fn = $pos_max_rss_fn; 68 goto have_memlog_fn; 69 } 70 } 71 42 72 print_usage(1); 43 73 } 74 have_memlog_fn: 44 75 45 76 # The version of addr2line and friends that you use can make a big difference,
Note: See TracChangeset
for help on using the changeset viewer.