From 1e653c3539423e4cfdeab1d232483bcac0e8b073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 21 Mar 2012 14:26:47 +0100 Subject: Use distinct function-entry probes for local and global calls It seems useful to be able to filter out (for example) just the global calls. --- lib/runtime_tools/examples/function-calls.d | 10 ++++++++-- lib/runtime_tools/examples/function-calls.systemtap | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/runtime_tools/examples') diff --git a/lib/runtime_tools/examples/function-calls.d b/lib/runtime_tools/examples/function-calls.d index 238c5211ac..3e015dc2d2 100644 --- a/lib/runtime_tools/examples/function-calls.d +++ b/lib/runtime_tools/examples/function-calls.d @@ -18,9 +18,15 @@ * %CopyrightEnd% */ -erlang*:::function-entry +erlang*:::local-function-entry { - printf("pid %s enter %s depth %d\n", + printf("pid %s enter (local) %s depth %d\n", + copyinstr(arg0), copyinstr(arg1), arg2); +} + +erlang*:::global-function-entry +{ + printf("pid %s enter (global) %s depth %d\n", copyinstr(arg0), copyinstr(arg1), arg2); } diff --git a/lib/runtime_tools/examples/function-calls.systemtap b/lib/runtime_tools/examples/function-calls.systemtap index 8fc4375135..16c9c04918 100644 --- a/lib/runtime_tools/examples/function-calls.systemtap +++ b/lib/runtime_tools/examples/function-calls.systemtap @@ -28,9 +28,15 @@ * environment. */ -probe process("beam").mark("function-entry") +probe process("beam").mark("local-function-entry") { - printf("pid %s enter %s depth %d\n", + printf("pid %s enter (local) %s depth %d\n", + user_string($arg1), user_string($arg2), $arg3); +} + +probe process("beam").mark("global-function-entry") +{ + printf("pid %s enter (global) %s depth %d\n", user_string($arg1), user_string($arg2), $arg3); } -- cgit v1.2.3