Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: tools/memory_watcher/scripts/finditem.pl

Issue 314253003: Remove memory_watcher tool as well as --memory-profile command line flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile issue on non-ChromeOS platforms Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/perl
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 sub process_raw($$) {
7 my $file = shift;
8 my $search = shift;
9
10 my %leaks = ();
11
12 my $save = 0;
13 my $print = 0;
14 my $bytes = 0;
15 my $calls = 0;
16 my $sum_bytes = 0;
17 my $sum_calls = 0;
18
19 open (LOGFILE, "$file") or die("could not open $file");
20 while(<LOGFILE>) {
21 my $line = $_;
22 if ($line =~ m/([0-9]*) bytes, ([0-9]*) allocs/) {
23 $save = "";
24 $print = 0;
25 $bytes = $1;
26 $calls = $2;
27 }
28 elsif ($line =~ m/$search/) {
29 $print = 1;
30 }
31 elsif ($line =~ m/=============/) {
32 $save .= $line;
33 if ($print) {
34 print "$bytes bytes ($calls calls)\n";
35 print $save;
36 $sum_bytes += $bytes;
37 $sum_calls += $calls;
38 $save = "";
39 $print = 0;
40 $calls = 0;
41 }
42 }
43 $save .= $line;
44 }
45 print("TOTAL: $sum_bytes bytes ($sum_calls calls)\n");
46 }
47
48
49 # ----- Main ------------------------------------------------
50
51 # Get the command line argument
52 my $filename = shift;
53 my $search = shift;
54
55 # Process the file.
56 process_raw($filename, $search);
OLDNEW
« no previous file with comments | « tools/memory_watcher/preamble_patcher_with_stub.cc ('k') | tools/memory_watcher/scripts/memprof.pl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698