1999-12-14 02:07:27 +00:00
|
|
|
#!/usr/bin/perl
|
2021-06-03 08:37:05 +02:00
|
|
|
|
2018-02-23 09:53:12 +01:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2012-06-29 11:39:47 +10:00
|
|
|
#
|
2021-06-03 08:37:05 +02:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
#
|
2016-06-27 14:56:38 +10:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
2021-06-03 08:37:05 +02:00
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
#
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
# information regarding copyright ownership.
|
1999-12-14 02:07:27 +00:00
|
|
|
|
|
|
|
# Massage the output from ISC_MEM_DEBUG to extract mem_get() calls
|
|
|
|
# with no corresponding mem_put().
|
|
|
|
|
2000-01-14 00:33:14 +00:00
|
|
|
$mem_stats = '';
|
|
|
|
|
1999-12-14 02:07:27 +00:00
|
|
|
while (<>) {
|
2000-09-13 01:58:02 +00:00
|
|
|
$gets{$1.$2} = $_ if (/add (?:0x)?([0-9a-f]+) size (?:0x)?([0-9]+) file/);
|
|
|
|
delete $gets{$1.$2} if /del (?:0x)?([0-9a-f]+) size (?:0x)?([0-9]+) file/;
|
2000-01-14 00:33:14 +00:00
|
|
|
$mem_stats .= $_ if /\d+ gets, +(\d+) rem/ && $1 > 0;
|
1999-12-14 02:07:27 +00:00
|
|
|
}
|
|
|
|
print join('', values %gets);
|
2000-01-14 00:33:14 +00:00
|
|
|
print $mem_stats;
|
|
|
|
|
|
|
|
exit(0);
|