diff options
author | Patrik Nyblom <[email protected]> | 2012-03-22 19:08:07 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2012-03-22 19:08:07 +0100 |
commit | 8a886bda04b7656f9f6ced9be14a98d6b6df0a0a (patch) | |
tree | a0a201c8b1ee29169aca97e3befa133da867d5cd /erts/emulator/beam/global.h | |
parent | aa0d3a28d6f8350965d43cd13014125a63ac25d9 (diff) | |
parent | 5957a8338fe1f4e79a39277174094bbd9e978896 (diff) | |
download | otp-8a886bda04b7656f9f6ced9be14a98d6b6df0a0a.tar.gz otp-8a886bda04b7656f9f6ced9be14a98d6b6df0a0a.tar.bz2 otp-8a886bda04b7656f9f6ced9be14a98d6b6df0a0a.zip |
Merge branch 'maint'
Conflicts:
erts/emulator/beam/beam_emu.c
erts/emulator/beam/bif.tab
erts/preloaded/ebin/prim_file.beam
lib/hipe/cerl/erl_bif_types.erl
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r-- | erts/emulator/beam/global.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index b259ef3694..12e40288bd 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -1988,4 +1988,46 @@ erts_alloc_message_heap(Uint size, # define UseTmpHeapNoproc(Size) /* Nothing */ # define UnUseTmpHeapNoproc(Size) /* Nothing */ #endif /* HEAP_ON_C_STACK */ + +#if ERTS_GLB_INLINE_INCL_FUNC_DEF + +#include "dtrace-wrapper.h" + +ERTS_GLB_INLINE void +dtrace_pid_str(Eterm pid, char *process_buf) +{ + erts_snprintf(process_buf, DTRACE_TERM_BUF_SIZE, "<%lu.%lu.%lu>", + pid_channel_no(pid), + pid_number(pid), + pid_serial(pid)); +} + +ERTS_GLB_INLINE void +dtrace_proc_str(Process *process, char *process_buf) +{ + dtrace_pid_str(process->id, process_buf); +} + +ERTS_GLB_INLINE void +dtrace_port_str(Port *port, char *port_buf) +{ + erts_snprintf(port_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>", + port_channel_no(port->id), + port_number(port->id)); +} + +ERTS_GLB_INLINE void +dtrace_fun_decode(Process *process, + Eterm module, Eterm function, int arity, + char *process_buf, char *mfa_buf) +{ + if (process_buf) { + dtrace_proc_str(process, process_buf); + } + + erts_snprintf(mfa_buf, DTRACE_TERM_BUF_SIZE, "%T:%T/%d", + module, function, arity); +} +#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */ + #endif /* !__GLOBAL_H__ */ |