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
15 GetOptions
("object=s");
19 usage
: filter
-log-for.pl
< logfile
20 --object
<obj
> The address of the object to examine
(required
)
23 warn "object $::opt_object\n";
26 next LINE
if (! /^</);
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);
39 # The lines in the stack trace
40 CALLSITE
: while (<>) {
42 last CALLSITE
if (/^$/);