3 * py_mallocstk.d - Python libc malloc analysis with full stack traces.
4 * Written for the Python DTrace provider.
6 * $Id: py_mallocstk.d 19 2007-09-12 07:47:59Z brendan $
8 * USAGE: py_mallocstk.d { -p PID | -c cmd } # hit Ctrl-C to end
10 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
14 * The contents of this file are subject to the terms of the
15 * Common Development and Distribution License, Version 1.0 only
16 * (the "License"). You may not use this file except in compliance
19 * You can obtain a copy of the license at Docs/cddl1.txt
20 * or http://www.opensolaris.org/os/licensing.
21 * See the License for the specific language governing permissions
22 * and limitations under the License.
26 * 09-Sep-2007 Brendan Gregg Created this.
29 #pragma D option quiet
31 /* tune as desired, */
32 #pragma D option jstackframes=64
33 #pragma D option jstackstrsize=1024
37 printf("Tracing... Hit Ctrl-C to end.\n");
40 pid$target:libc:malloc:entry
42 @mallocs[jstack()] = quantize(arg0);
47 printf("\nPython malloc byte distributions by stack trace,\n\n");