1999-12-14 02:07:27 +00:00
|
|
|
#!/usr/bin/perl
|
2021-06-03 08:37:05 +02:00
|
|
|
|
2000-02-03 23:50:32 +00:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2012-06-29 11:39:47 +10:00
|
|
|
#
|
2000-02-03 23:50:32 +00:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
2021-06-03 08:37:05 +02:00
|
|
|
#
|
2000-02-03 23:50:32 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
#
|
2000-02-03 23:50:32 +00: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 (<>) {
|
2024-09-09 13:59:43 +02:00
|
|
|
$gets{$1.$2} = $_ if (/add (?:0x)?([0-9a-f]+) size (?:0x)?([0-9]+) func/);
|
|
|
|
delete $gets{$1.$2} if /del (?:0x)?([0-9a-f]+) size (?:0x)?([0-9]+) func/;
|
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);
|