diff options
author | Scott Lystig Fritchie <[email protected]> | 2011-11-17 00:45:50 -0600 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2012-03-22 18:16:13 +0100 |
commit | 2f532f889a6bd31f74122bd223277d7c609f7bdc (patch) | |
tree | 8c0463bf781059147caeb31c2594ed211d4854e6 /erts/emulator/beam/copy.c | |
parent | 0331c29e0e494d4c1e4fdd05e48a3f88a8caea0b (diff) | |
download | otp-2f532f889a6bd31f74122bd223277d7c609f7bdc.tar.gz otp-2f532f889a6bd31f74122bd223277d7c609f7bdc.tar.bz2 otp-2f532f889a6bd31f74122bd223277d7c609f7bdc.zip |
Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 3/4
Add probes to the virtual machine, except (mostly) the efile_drv.c
driver and other file I/O-related source files.
Diffstat (limited to 'erts/emulator/beam/copy.c')
-rw-r--r-- | erts/emulator/beam/copy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c index 1d968fb147..4ee60807d9 100644 --- a/erts/emulator/beam/copy.c +++ b/erts/emulator/beam/copy.c @@ -30,6 +30,7 @@ #include "big.h" #include "erl_binary.h" #include "erl_bits.h" +#include "dtrace-wrapper.h" #ifdef HYBRID MA_STACK_DECLARE(src); @@ -59,6 +60,12 @@ copy_object(Eterm obj, Process* to) Eterm* hp = HAlloc(to, size); Eterm res; + if (DTRACE_ENABLED(copy_object)) { + DTRACE_CHARBUF(proc_name, 64); + + erts_snprintf(proc_name, sizeof(proc_name), "%T", to->id); + DTRACE2(copy_object, proc_name, size); + } res = copy_struct(obj, size, &hp, &to->off_heap); #ifdef DEBUG if (eq(obj, res) == 0) { @@ -213,6 +220,8 @@ Eterm copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) if (IS_CONST(obj)) return obj; + DTRACE1(copy_struct, (int32_t)sz); + hp = htop = *hpp; hbot = htop + sz; hstart = (char *)htop; |