Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 #!/usr/bin/perl -w
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # Filter a refcount log to show only the entries for a single object.
8 # Useful when manually examining refcount logs containing multiple
9 # objects.
11 use 5.004;
12 use strict;
13 use Getopt::Long;
15 GetOptions("object=s");
17 $::opt_object ||
18 die qq{
19 usage: filter-log-for.pl < logfile
20 --object <obj> The address of the object to examine (required)
21 };
23 warn "object $::opt_object\n";
25 LINE: while (<>) {
26 next LINE if (! /^</);
27 my $line = $_;
28 my @fields = split(/ /, $_);
30 my $class = shift(@fields);
31 my $obj = shift(@fields);
32 next LINE unless ($obj eq $::opt_object);
33 my $sno = shift(@fields);
34 my $op = shift(@fields);
35 my $cnt = shift(@fields);
37 print $line;
39 # The lines in the stack trace
40 CALLSITE: while (<>) {
41 print;
42 last CALLSITE if (/^$/);
43 }
44 }