michael@0: #!/usr/bin/perl -w michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # Filter a refcount log to show only the entries for a single object. michael@0: # Useful when manually examining refcount logs containing multiple michael@0: # objects. michael@0: michael@0: use 5.004; michael@0: use strict; michael@0: use Getopt::Long; michael@0: michael@0: GetOptions("object=s"); michael@0: michael@0: $::opt_object || michael@0: die qq{ michael@0: usage: filter-log-for.pl < logfile michael@0: --object The address of the object to examine (required) michael@0: }; michael@0: michael@0: warn "object $::opt_object\n"; michael@0: michael@0: LINE: while (<>) { michael@0: next LINE if (! /^) { michael@0: print; michael@0: last CALLSITE if (/^$/); michael@0: } michael@0: }