Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: erlang/otp
base: master
...
head fork: k4t3r1n4/dt-percept2
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 20 commits
  • 14 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 01, 2013
@k4t3r1n4 k4t3r1n4 Added Percept2 as submodule 5fec220
@k4t3r1n4 k4t3r1n4 Added instructions on how to clone the repo e665235
Commits on Mar 23, 2013
@k4t3r1n4 k4t3r1n4 Added support for timestamps in DTrace probes 629e9b5
Commits on Mar 25, 2013
@k4t3r1n4 k4t3r1n4 Made DTrace probe message_queued correspond to Erlang trace message r…
…eceive
7902fb2
Commits on Mar 27, 2013
@k4t3r1n4 k4t3r1n4 Made DTrace probe message_send correspond to Erlang trace message send 0a4c144
@k4t3r1n4 k4t3r1n4 Made DTrace probes local_function_entry, global_function_entry, nif_e…
…ntry, bif_entry correspond to Erlang trace message call
2642465
@k4t3r1n4 k4t3r1n4 Made DTrace probes function_return, bif_return, nif_return correspond…
… to Erlang trace message return_from
0a056c9
@k4t3r1n4 k4t3r1n4 Made DTrace probe process_spawn correspond to Erlang trace message spawn 54ca361
@k4t3r1n4 k4t3r1n4 Forgot the parent PID in process_spawn 4233c38
Commits on Mar 28, 2013
@k4t3r1n4 k4t3r1n4 Made DTrace probe process_exit correspond to Erlang trace message exit 3bbaddf
@k4t3r1n4 k4t3r1n4 Added dtrace_portid_str 24ff05b
@k4t3r1n4 k4t3r1n4 Made DTrace probes process_link, port_link correspond to Erlang trace…
… message link
0e8bd98
@k4t3r1n4 k4t3r1n4 Made DTrace probes process_unlink, port_unlink correspond to Erlang t…
…race message unlink
0081fd2
@k4t3r1n4 k4t3r1n4 Made DTrace probe process_getting_linked correspond to Erlang trace m…
…essage getting_linked
0514a44
@k4t3r1n4 k4t3r1n4 Made DTrace probes process_getting_unlinked, port_getting_unlinked co…
…rrespond to Erlang trace message getting_unlinked
153101a
Commits on Mar 29, 2013
@k4t3r1n4 k4t3r1n4 Made DTrace probes process_registered, port_registered correspond to …
…Erlang trace message register, Fixed bug with process_getting_unlinked
32eac1b
@k4t3r1n4 k4t3r1n4 Made DTrace probes process_unregistered, port_unregistered correspond…
… to Erlang trace message unregister
fff04a3
@k4t3r1n4 k4t3r1n4 Made DTrace probe process_scheduled correspond to Erlang trace messag…
…e in
1115612
@k4t3r1n4 k4t3r1n4 Made DTrace probe process_unscheduled correspond to Erlang trace mess…
…age out, Fixed process_scheduled to contain 0 in case MFA cannot be determined
867a4e9
@k4t3r1n4 k4t3r1n4 Made DTrace probes gc_major_start, gc_minor_start correspond to Erlan…
…g trace message gc_start, Made DTrace probes gc_major_end, gc_minor_end correspond to Erlang trace message gc_end
0949b6d
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "lib/percept2"]
+ path = lib/percept2
+ url = https://github.com/k4t3r1n4/percept2.git
View
80 README.md
@@ -1,78 +1,12 @@
-Erlang/OTP
-==========
+`dt-percept2` - DTrace/SystemTap back-end for Percept2.
-**Erlang** is a programming language used to build massively scalable soft
-real-time systems with requirements on high availability. Some of its
-uses are in telecom, banking, e-commerce, computer telephony and
-instant messaging. Erlang's runtime system has built-in support for
-concurrency, distribution and fault tolerance.
+### How to clone this repo ###
-**OTP** is set of Erlang libraries and design principles providing
-middle-ware to develop these systems. It includes its own distributed
-database, applications to interface towards other languages, debugging
-and release handling tools.
+In order to clone `dt-percept2`, execute the following commands:
-More information can be found at [erlang.org] [1].
+ $ git clone https://github.com/k4t3r1n4/dt-percept2.git
+ $ cd dt-percept2
+ $ git submodule init
+ $ git submodule update
-Building and Installing
------------------------
-Information on building and installing Erlang/OTP can be found
-in the [$ERL_TOP/HOWTO/INSTALL.md] [5] document.
-
-Contributing to Erlang/OTP
---------------------------
-
-Here are the [instructions for submitting patches] [2].
-
-In short:
-
-* We prefer to receive proposed updates via email on the
- [`erlang-patches`] [3] mailing list rather than through a pull request.
- Pull requests are not practical because we have a strict policy never to
- merge any untested changes to the development branch (the only exception
- being **obviously** correct changes, such as corrections of typos).
-
-* We merge all proposed updates to the `pu` (*proposed updates*) branch,
- typically within one working day.
-
-* At least once a day, the contents of the `pu` branch will be built on
- several platforms (Linux, Solaris, Mac OS X, Windows, and so on) and
- automatic test suites will be run. We will email you if any problems are
- found.
-
-* If a proposed change builds and passes the tests, it will be reviewed
- by one or more members of the Erlang/OTP team at Ericsson. The reviewer
- may suggest improvements that are needed before the change can be accepted
- and merged.
-
-* Once or twice a week, a status email called ["What's cooking in Erlang/OTP"] [4]
- will be sent to the [`erlang-patches`] [3] mailing list.
-
-Copyright and License
----------------------
-
-> %CopyrightBegin%
->
-> Copyright Ericsson AB 2010-2012. All Rights Reserved.
->
-> The contents of this file are subject to the Erlang Public License,
-> Version 1.1, (the "License"); you may not use this file except in
-> compliance with the License. You should have received a copy of the
-> Erlang Public License along with this software. If not, it can be
-> retrieved online at http://www.erlang.org/.
->
-> Software distributed under the License is distributed on an "AS IS"
-> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-> the License for the specific language governing rights and limitations
-> under the License.
->
-> %CopyrightEnd%
-
-
-
- [1]: http://www.erlang.org
- [2]: http://wiki.github.com/erlang/otp/submitting-patches
- [3]: http://www.erlang.org/static/doc/mailinglist.html
- [4]: http://erlang.github.com/otp/
- [5]: HOWTO/INSTALL.md
View
58 erts/emulator/beam/beam_emu.c
@@ -999,7 +999,8 @@ init_emulator(void)
int depth = STACK_START(p) - STACK_TOP(p); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE3(local_function_entry, process_name, mfa, depth); \
+ DTRACE4(local_function_entry, process_name, mfa, depth, \
+ dtrace_ts()); \
}
#define DTRACE_GLOBAL_CALL(p, m, f, a) \
@@ -1009,7 +1010,8 @@ init_emulator(void)
int depth = STACK_START(p) - STACK_TOP(p); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE3(global_function_entry, process_name, mfa, depth); \
+ DTRACE4(global_function_entry, process_name, mfa, depth, \
+ dtrace_ts()); \
}
#define DTRACE_RETURN(p, m, f, a) \
@@ -1019,7 +1021,8 @@ init_emulator(void)
int depth = STACK_START(p) - STACK_TOP(p); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE3(function_return, process_name, mfa, depth); \
+ DTRACE4(function_return, process_name, mfa, depth, \
+ dtrace_ts()); \
}
#define DTRACE_BIF_ENTRY(p, m, f, a) \
@@ -1028,7 +1031,7 @@ init_emulator(void)
DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE2(bif_entry, process_name, mfa); \
+ DTRACE3(bif_entry, process_name, mfa, dtrace_ts()); \
}
#define DTRACE_BIF_RETURN(p, m, f, a) \
@@ -1037,7 +1040,7 @@ init_emulator(void)
DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE2(bif_return, process_name, mfa); \
+ DTRACE3(bif_return, process_name, mfa, dtrace_ts()); \
}
#define DTRACE_NIF_ENTRY(p, m, f, a) \
@@ -1046,7 +1049,7 @@ init_emulator(void)
DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE2(nif_entry, process_name, mfa); \
+ DTRACE3(nif_entry, process_name, mfa, dtrace_ts()); \
}
#define DTRACE_NIF_RETURN(p, m, f, a) \
@@ -1055,9 +1058,26 @@ init_emulator(void)
DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
dtrace_fun_decode(p, m, f, a, \
process_name, mfa); \
- DTRACE2(nif_return, process_name, mfa); \
+ DTRACE3(nif_return, process_name, mfa, dtrace_ts()); \
}
+#define DTRACE_MESSAGE_QUEUED(r, m, s) \
+ if (DTRACE_ENABLED(message_queued)) { \
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE); \
+ Sint tok_label = 0; \
+ Sint tok_lastcnt = 0; \
+ Sint tok_serial = 0; \
+ dtrace_proc_str(r, receiver_name); \
+ if (s != NIL && is_tuple(s)) { \
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(s)); \
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(s)); \
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(s)); \
+ } \
+ DTRACE7(message_queued, receiver_name, size_object(m), \
+ r->msg.len, tok_label, tok_lastcnt, tok_serial, \
+ dtrace_ts()); \
+ }
+
#else /* USE_VM_PROBES */
#define DTRACE_LOCAL_CALL(p, m, f, a) do {} while (0)
@@ -1067,6 +1087,7 @@ init_emulator(void)
#define DTRACE_BIF_RETURN(p, m, f, a) do {} while (0)
#define DTRACE_NIF_ENTRY(p, m, f, a) do {} while (0)
#define DTRACE_NIF_RETURN(p, m, f, a) do {} while (0)
+#define DTRACE_MESSAGE_QUEUED(r, m, s) do {} while (0)
#endif /* USE_VM_PROBES */
@@ -1249,12 +1270,10 @@ void process_main(void)
(Eterm)fptr[1], (Uint)fptr[2],
NULL, fun_buf);
} else {
- erts_snprintf(fun_buf, sizeof(fun_buf),
- "<unknown/%p>", next);
+ erts_snprintf(fun_buf, sizeof(fun_buf), "0");
}
}
-
- DTRACE2(process_scheduled, process_buf, fun_buf);
+ DTRACE3(process_scheduled, process_buf, fun_buf, dtrace_ts());
}
#endif
Goto(next);
@@ -1476,8 +1495,8 @@ void process_main(void)
*/
#ifdef USE_VM_CALL_PROBES
if (DTRACE_ENABLED(global_function_entry)) {
- BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
- DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
}
#endif
Dispatchx();
@@ -1491,8 +1510,8 @@ void process_main(void)
SET_CP(c_p, I+2);
#ifdef USE_VM_CALL_PROBES
if (DTRACE_ENABLED(global_function_entry)) {
- BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
- DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
}
#endif
Dispatchx();
@@ -1504,8 +1523,8 @@ void process_main(void)
OpCase(i_call_ext_only_e):
#ifdef USE_VM_CALL_PROBES
if (DTRACE_ENABLED(global_function_entry)) {
- BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
- DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
}
#endif
Dispatchx();
@@ -2078,6 +2097,7 @@ void process_main(void)
BeamInstr *next;
PreFetch(0, next);
+ DTRACE_MESSAGE_QUEUED(c_p, am_timeout, NIL);
if (IS_TRACED_FL(c_p, F_TRACE_RECEIVE)) {
trace_receive(c_p, am_timeout);
}
@@ -5808,7 +5828,7 @@ apply(Process* p, Eterm module, Eterm function, Eterm args, Eterm* reg)
#ifdef USE_VM_CALL_PROBES
if (DTRACE_ENABLED(global_function_entry)) {
BeamInstr *fptr = (BeamInstr *) ep->addressv[erts_active_code_ix()];
- DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
+ DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
}
#endif
return ep->addressv[erts_active_code_ix()];
@@ -5863,7 +5883,7 @@ fixed_apply(Process* p, Eterm* reg, Uint arity)
#ifdef USE_VM_CALL_PROBES
if (DTRACE_ENABLED(global_function_entry)) {
BeamInstr *fptr = (BeamInstr *) ep->addressv[erts_active_code_ix()];
- DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
+ DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
}
#endif
return ep->addressv[erts_active_code_ix()];
View
60 erts/emulator/beam/bif.c
@@ -40,6 +40,7 @@
#define ERTS_PTAB_WANT_BIF_IMPL__
#include "erl_ptab.h"
#include "erl_bits.h"
+#include "dtrace-wrapper.h"
static Export* flush_monitor_message_trap = NULL;
static Export* set_cpu_topology_trap = NULL;
@@ -128,6 +129,16 @@ static int insert_internal_link(Process* p, Eterm rpid)
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
trace_proc(p, rp, am_getting_linked, p->common.id);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_getting_linked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(linked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_proc_str(p, linked_process_name);
+ DTRACE3(process_getting_linked, process_name, linked_process_name, dtrace_ts());
+ }
+#endif
+
if (p == rp)
erts_smp_proc_unlock(p, rp_locks & ~ERTS_PROC_LOCK_MAIN);
else {
@@ -147,6 +158,25 @@ BIF_RETTYPE link_1(BIF_ALIST_1)
if (IS_TRACED_FL(BIF_P, F_TRACE_PROCS)) {
trace_proc(BIF_P, BIF_P, am_link, BIF_ARG_1);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_link) &&
+ (is_internal_pid(BIF_ARG_1) || is_external_pid(BIF_ARG_1))) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(link_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(BIF_P, process_name);
+ dtrace_pid_str(BIF_ARG_1, link_process_name);
+ DTRACE3(process_link, process_name, link_process_name, dtrace_ts());
+ }
+ else if(DTRACE_ENABLED(port_link) &&
+ (is_internal_port(BIF_ARG_1) || is_external_port(BIF_ARG_1))) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(link_port_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(BIF_P, process_name);
+ dtrace_portid_str(BIF_ARG_1, link_port_name);
+ DTRACE3(port_link, process_name, link_port_name, dtrace_ts());
+ }
+#endif
+
/* check that the pid or port which is our argument is OK */
if (is_internal_pid(BIF_ARG_1)) {
@@ -959,6 +989,25 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
trace_proc(BIF_P, BIF_P, am_unlink, BIF_ARG_1);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_unlink) &&
+ (is_internal_pid(BIF_ARG_1) || is_external_pid(BIF_ARG_1))) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(link_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(BIF_P, process_name);
+ dtrace_pid_str(BIF_ARG_1, link_process_name);
+ DTRACE3(process_unlink, process_name, link_process_name, dtrace_ts());
+ }
+ else if(DTRACE_ENABLED(port_unlink) &&
+ (is_internal_port(BIF_ARG_1) || is_external_port(BIF_ARG_1))) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(link_port_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(BIF_P, process_name);
+ dtrace_portid_str(BIF_ARG_1, link_port_name);
+ DTRACE3(port_unlink, process_name, link_port_name, dtrace_ts());
+ }
+#endif
+
if (is_internal_port(BIF_ARG_1)) {
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_LINK|ERTS_PROC_LOCK_STATUS);
#ifdef ERTS_SMP
@@ -1093,6 +1142,17 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
trace_proc(BIF_P, rp, am_getting_unlinked, BIF_P->common.id);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_getting_unlinked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(BIF_P->common.id, unlinked_process_name);
+ DTRACE3(process_getting_unlinked, process_name,
+ unlinked_process_name, dtrace_ts());
+ }
+#endif
+
if (rp != BIF_P)
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
}
View
58 erts/emulator/beam/dist.c
@@ -333,6 +333,17 @@ static void doit_link_net_exits_sub(ErtsLink *sublnk, void *vlnecp)
/* We didn't exit the process and it is traced */
trace_proc(NULL, rp, am_getting_unlinked, sublnk->pid);
}
+#ifdef USE_VM_PROBES
+ if (xres >= 0 && DTRACE_ENABLED(process_getting_unlinked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(sublnk->pid, unlinked_process_name);
+ DTRACE3(process_getting_unlinked, process_name,
+ unlinked_process_name, dtrace_ts());
+ }
+#endif
+
}
erts_smp_proc_unlock(rp, rp_locks);
}
@@ -860,6 +871,10 @@ erts_dsig_send_msg(ErtsDSigData *dsdp, Eterm remote, Eterm message)
tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
}
+ DTRACE7(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial, dtrace_ts());
+ DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial);
}
#endif
@@ -868,10 +883,6 @@ erts_dsig_send_msg(ErtsDSigData *dsdp, Eterm remote, Eterm message)
make_small(DOP_SEND_TT), am_Cookie, remote, token);
else
ctl = TUPLE3(&ctl_heap[0], make_small(DOP_SEND), am_Cookie, remote);
- DTRACE6(message_send, sender_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
- DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
res = dsig_send(dsdp, ctl, message, 0);
UnUseTmpHeapNoproc(5);
return res;
@@ -918,6 +929,10 @@ erts_dsig_send_reg_msg(ErtsDSigData *dsdp, Eterm remote_name, Eterm message)
tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
}
+ DTRACE7(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial, dtrace_ts());
+ DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial);
}
#endif
@@ -927,10 +942,6 @@ erts_dsig_send_reg_msg(ErtsDSigData *dsdp, Eterm remote_name, Eterm message)
else
ctl = TUPLE4(&ctl_heap[0], make_small(DOP_REG_SEND),
sender->common.id, am_Cookie, remote_name);
- DTRACE6(message_send, sender_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
- DTRACE7(message_send_remote, sender_name, node_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
res = dsig_send(dsdp, ctl, message, 0);
UnUseTmpHeapNoproc(6);
return res;
@@ -1238,6 +1249,16 @@ int erts_net_message(Port *prt,
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
trace_proc(NULL, rp, am_getting_linked, from);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_getting_linked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(linked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(from, linked_process_name);
+ DTRACE3(process_getting_linked, process_name, linked_process_name,
+ dtrace_ts());
+ }
+#endif
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
break;
@@ -1264,6 +1285,16 @@ int erts_net_message(Port *prt,
if (IS_TRACED_FL(rp, F_TRACE_PROCS) && lnk != NULL) {
trace_proc(NULL, rp, am_getting_unlinked, from);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_getting_unlinked) && lnk != NULL) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(from, unlinked_process_name);
+ DTRACE3(process_getting_unlinked, process_name,
+ unlinked_process_name, dtrace_ts());
+ }
+#endif
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
@@ -1592,6 +1623,17 @@ int erts_net_message(Port *prt,
/* We didn't exit the process and it is traced */
trace_proc(NULL, rp, am_getting_unlinked, from);
}
+#ifdef USE_VM_PROBES
+ if (xres >= 0 && DTRACE_ENABLED(process_getting_unlinked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(from, unlinked_process_name);
+ DTRACE3(process_getting_unlinked, process_name,
+ unlinked_process_name, dtrace_ts());
+ }
+#endif
+
}
erts_smp_proc_unlock(rp, rp_locks);
}
View
16 erts/emulator/beam/erl_gc.c
@@ -410,13 +410,21 @@ erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
*/
while (!done) {
if ((FLAGS(p) & F_NEED_FULLSWEEP) != 0) {
- DTRACE2(gc_major_start, pidbuf, need);
+#ifdef USE_VM_PROBES
+ DTRACE3(gc_major_start, pidbuf, need, dtrace_ts());
+#endif
done = major_collection(p, need, objv, nobj, &reclaimed_now);
- DTRACE2(gc_major_end, pidbuf, reclaimed_now);
+#ifdef USE_VM_PROBES
+ DTRACE3(gc_major_end, pidbuf, reclaimed_now, dtrace_ts());
+#endif
} else {
- DTRACE2(gc_minor_start, pidbuf, need);
+#ifdef USE_VM_PROBES
+ DTRACE3(gc_minor_start, pidbuf, need, dtrace_ts());
+#endif
done = minor_collection(p, need, objv, nobj, &reclaimed_now);
- DTRACE2(gc_minor_end, pidbuf, reclaimed_now);
+#ifdef USE_VM_PROBES
+ DTRACE3(gc_minor_end, pidbuf, reclaimed_now, dtrace_ts());
+#endif
}
}
reset_active_writer(p);
View
48 erts/emulator/beam/erl_message.c
@@ -362,9 +362,9 @@ erts_queue_dist_message(Process *rcvr,
tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
}
- DTRACE6(message_queued,
+ DTRACE7(message_queued,
receiver_name, size_object(msg), rcvr->msg.len,
- tok_label, tok_lastcnt, tok_serial);
+ tok_label, tok_lastcnt, tok_serial, dtrace_ts());
}
#endif
erts_queue_message(rcvr, rcvr_locks, mbuf, msg, token
@@ -403,8 +403,8 @@ erts_queue_dist_message(Process *rcvr,
* TODO: We don't know the real size of the external message here.
* -1 will appear to a D script as 4294967295.
*/
- DTRACE6(message_queued, receiver_name, -1, rcvr->msg.len + 1,
- tok_label, tok_lastcnt, tok_serial);
+ DTRACE7(message_queued, receiver_name, -1, rcvr->msg.len + 1,
+ tok_label, tok_lastcnt, tok_serial, dtrace_ts());
}
#endif
mp->data.dist_ext = dist_ext;
@@ -528,9 +528,9 @@ queue_message(Process *c_p,
tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(seq_trace_token));
tok_serial = signed_val(SEQ_TRACE_T_SERIAL(seq_trace_token));
}
- DTRACE6(message_queued,
+ DTRACE7(message_queued,
receiver_name, size_object(message), receiver->msg.len,
- tok_label, tok_lastcnt, tok_serial);
+ tok_label, tok_lastcnt, tok_serial, dtrace_ts());
}
#endif
@@ -962,8 +962,8 @@ erts_send_message(Process* sender,
tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(stoken));
tok_serial = signed_val(SEQ_TRACE_T_SERIAL(stoken));
}
- DTRACE6(message_send, sender_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
+ DTRACE7(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial, dtrace_ts());
}
#endif
res = queue_message(NULL,
@@ -999,8 +999,9 @@ erts_send_message(Process* sender,
{
ErlMessage* mp = message_alloc();
- DTRACE6(message_send, sender_name, receiver_name,
- size_object(message), tok_label, tok_lastcnt, tok_serial);
+ DTRACE7(message_send, sender_name, receiver_name,
+ size_object(message), tok_label, tok_lastcnt, tok_serial,
+ dtrace_ts());
mp->data.attached = NULL;
ERL_MESSAGE_TERM(mp) = message;
ERL_MESSAGE_TOKEN(mp) = NIL;
@@ -1022,6 +1023,16 @@ erts_send_message(Process* sender,
res = receiver->msg.len;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_queued)) {
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(receiver, receiver_name);
+ DTRACE7(message_queued,
+ receiver_name, size_object(message), receiver->msg.len,
+ tok_label, tok_lastcnt, tok_serial, dtrace_ts());
+ }
+#endif
+
if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
trace_receive(receiver, message);
}
@@ -1046,8 +1057,8 @@ erts_send_message(Process* sender,
message = copy_struct(message, msize, &hp, ohp);
BM_MESSAGE_COPIED(msz);
BM_SWAP_TIMER(copy,send);
- DTRACE6(message_send, sender_name, receiver_name,
- msize, tok_label, tok_lastcnt, tok_serial);
+ DTRACE7(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial, dtrace_ts());
res = queue_message(sender,
receiver,
receiver_locks,
@@ -1078,8 +1089,9 @@ erts_send_message(Process* sender,
message = copy_struct(message, msize, &hp, &receiver->off_heap);
BM_MESSAGE_COPIED(msize);
BM_SWAP_TIMER(copy,send);
- DTRACE6(message_send, sender_name, receiver_name,
- (uint32_t)msize, tok_label, tok_lastcnt, tok_serial);
+ DTRACE7(message_send, sender_name, receiver_name,
+ (uint32_t)msize, tok_label, tok_lastcnt, tok_serial,
+ dtrace_ts());
ERL_MESSAGE_TERM(mp) = message;
ERL_MESSAGE_TOKEN(mp) = NIL;
#ifdef USE_VM_PROBES
@@ -1091,6 +1103,14 @@ erts_send_message(Process* sender,
res = receiver->msg.len;
erts_proc_notify_new_message(receiver);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_queued)) {
+ DTRACE7(message_queued,
+ receiver_name, (uint32_t)msize, receiver->msg.len,
+ tok_label, tok_lastcnt, tok_serial, dtrace_ts());
+ }
+#endif
+
if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
trace_receive(receiver, message);
}
View
44 erts/emulator/beam/erl_process.c
@@ -6592,9 +6592,21 @@ Process *schedule(Process *p, int calls)
#ifdef USE_VM_PROBES
if (p != NULL && DTRACE_ENABLED(process_unscheduled)) {
DTRACE_CHARBUF(process_buf, DTRACE_TERM_BUF_SIZE);
-
+ DTRACE_CHARBUF(fun_buf, DTRACE_TERM_BUF_SIZE);
dtrace_proc_str(p, process_buf);
- DTRACE1(process_unscheduled, process_buf);
+ if (ERTS_PROC_IS_EXITING(p)) {
+ strcpy(fun_buf, "<exiting>");
+ } else {
+ BeamInstr *fptr = find_function_from_pc(p->i);
+ if (fptr) {
+ dtrace_fun_decode(p, (Eterm)fptr[0],
+ (Eterm)fptr[1], (Uint)fptr[2],
+ NULL, fun_buf);
+ } else {
+ erts_snprintf(fun_buf, sizeof(fun_buf), "0");
+ }
+ }
+ DTRACE3(process_unscheduled, process_buf, fun_buf, dtrace_ts());
}
#endif
@@ -7522,6 +7534,15 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
if (IS_TRACED_FL(parent, F_TRACE_PROCS)) {
trace_proc(parent, parent, am_link, p->common.id);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_link)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(link_process_name, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(parent, process_name);
+ dtrace_proc_str(p, link_process_name);
+ DTRACE3(process_link, process_name, link_process_name, dtrace_ts());
+ }
+#endif
#ifdef DEBUG
ret = erts_add_link(&ERTS_P_LINKS(parent), LINK_PID, p->common.id);
@@ -7585,10 +7606,12 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(process_spawn)) {
DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(parent_name, DTRACE_TERM_BUF_SIZE);
DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE);
dtrace_fun_decode(p, mod, func, arity, process_name, mfa);
- DTRACE2(process_spawn, process_name, mfa);
+ dtrace_proc_str(parent, parent_name);
+ DTRACE4(process_spawn, process_name, parent_name, mfa, dtrace_ts());
}
#endif
@@ -8515,6 +8538,19 @@ static void doit_exit_link(ErtsLink *lnk, void *vpcontext)
trace_proc(p, rp, am_getting_unlinked, p->common.id);
}
}
+#ifdef USE_VM_PROBES
+ if (xres >= 0 &&
+ DTRACE_ENABLED(process_getting_unlinked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_process_name,
+ DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_pid_str(p->common.id, unlinked_process_name);
+ DTRACE3(process_getting_unlinked, process_name,
+ unlinked_process_name, dtrace_ts());
+ }
+#endif
+
}
ASSERT(rp != p);
erts_smp_proc_unlock(rp, rp_locks);
@@ -8592,7 +8628,7 @@ erts_do_exit_process(Process* p, Eterm reason)
dtrace_proc_str(p, process_buf);
erts_snprintf(reason_buf, DTRACE_TERM_BUF_SIZE - 1, "%T", reason);
- DTRACE2(process_exit, process_buf, reason_buf);
+ DTRACE3(process_exit, process_buf, reason_buf, dtrace_ts());
}
#endif
View
165 erts/emulator/beam/erlang_dtrace.d
@@ -57,9 +57,11 @@ provider erlang {
* @param token_label for the sender's sequential trace token
* @param token_previous count for the sender's sequential trace token
* @param token_current count for the sender's sequential trace token
+ * @param ts timestamp
*/
probe message__send(char *sender, char *receiver, uint32_t size,
- int token_label, int token_previous, int token_current);
+ int token_label, int token_previous, int token_current,
+ uint64_t ts);
/**
* Fired when a message is sent from a local process to a remote process.
@@ -100,9 +102,11 @@ provider erlang {
* @param token_label for the sender's sequential trace token
* @param token_previous count for the sender's sequential trace token
* @param token_current count for the sender's sequential trace token
+ * @param ts timestamp
*/
probe message__queued(char *receiver, uint32_t size, uint32_t queue_len,
- int token_label, int token_previous, int token_current);
+ int token_label, int token_previous, int token_current,
+ uint64_t ts);
/**
* Fired when a message is 'receive'd by a local process and removed
@@ -154,8 +158,9 @@ provider erlang {
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
* @param depth the stack depth
+ * @param ts timestamp
*/
- probe local__function__entry(char *p, char *mfa, int depth);
+ probe local__function__entry(char *p, char *mfa, int depth, uint64_t ts);
/**
* Fired whenever a user function is called externally
@@ -164,8 +169,9 @@ provider erlang {
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
* @param depth the stack depth
+ * @param ts timestamp
*/
- probe global__function__entry(char *p, char *mfa, int depth);
+ probe global__function__entry(char *p, char *mfa, int depth, uint64_t ts);
/**
* Fired whenever a user function returns.
@@ -173,88 +179,100 @@ provider erlang {
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
* @param depth the stack depth
+ * @param ts timestamp
*/
- probe function__return(char *p, char *mfa, int depth);
+ probe function__return(char *p, char *mfa, int depth, uint64_t ts);
/**
* Fired whenever a Built In Function is called.
*
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
+ * @param ts timestamp
*/
- probe bif__entry(char *p, char *mfa);
+ probe bif__entry(char *p, char *mfa, uint64_t ts);
/**
* Fired whenever a Built In Function returns.
*
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
+ * @param ts timestamp
*/
- probe bif__return(char *p, char *mfa);
+ probe bif__return(char *p, char *mfa, uint64_t ts);
/**
* Fired whenever a Native Function is called.
*
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
+ * @param ts timestamp
*/
- probe nif__entry(char *p, char *mfa);
+ probe nif__entry(char *p, char *mfa, uint64_t ts);
/**
* Fired whenever a Native Function returns.
*
* @param p the PID (string form) of the process
* @param mfa the m:f/a of the function
+ * @param ts timestamp
*/
- probe nif__return(char *p, char *mfa);
+ probe nif__return(char *p, char *mfa, uint64_t ts);
/**
* Fired when a major GC is starting.
*
* @param p the PID (string form) of the exiting process
* @param need the number of words needed on the heap
+ * @param ts timestamp
*/
- probe gc_major__start(char *p, int need);
+ probe gc_major__start(char *p, int need, uint64_t ts);
/**
* Fired when a minor GC is starting.
*
* @param p the PID (string form) of the exiting process
* @param need the number of words needed on the heap
+ * @param ts timestamp
*/
- probe gc_minor__start(char *p, int need);
+ probe gc_minor__start(char *p, int need, uint64_t ts);
/**
* Fired when a major GC is starting.
*
* @param p the PID (string form) of the exiting process
* @param reclaimed the amount of space reclaimed
+ * @param ts timestamp
*/
- probe gc_major__end(char *p, int reclaimed);
+ probe gc_major__end(char *p, int reclaimed, uint64_t ts);
/**
* Fired when a minor GC is starting.
*
* @param p the PID (string form) of the exiting process
* @param reclaimed the amount of space reclaimed
+ * @param ts timestamp
*/
- probe gc_minor__end(char *p, int reclaimed);
+ probe gc_minor__end(char *p, int reclaimed, uint64_t ts);
/**
* Fired when a process is spawned.
*
* @param p the PID (string form) of the new process.
+ * @param p2 the PID (string form) of the parent process.
* @param mfa the m:f/a of the function
+ * @param ts timestamp
*/
- probe process__spawn(char *p, char *mfa);
+ probe process__spawn(char *p, char *p2, char *mfa, uint64_t ts);
/**
* Fired when a process is exiting.
*
* @param p the PID (string form) of the exiting process
* @param reason the reason for the exit (may be truncated)
+ * @param ts timestamp
*/
- probe process__exit(char *p, char *reason);
+ probe process__exit(char *p, char *reason, uint64_t ts);
/**
* Fired when exit signal is delivered to a local process.
@@ -285,16 +303,19 @@ provider erlang {
*
* @param p the PID (string form) of the newly scheduled process
* @param mfa the m:f/a of the function it should run next
+ * @param ts timestamp
*/
- probe process__scheduled(char *p, char *mfa);
+ probe process__scheduled(char *p, char *mfa, uint64_t ts);
/**
* Fired when a process is unscheduled.
*
* @param p the PID (string form) of the process that has been
- * unscheduled.
+ * unscheduled
+ * @param mfa the m:f/a of the function that was running
+ * @param ts timestamp
*/
- probe process__unscheduled(char *p);
+ probe process__unscheduled(char *p, char *mfa, uint64_t ts);
/**
* Fired when a process goes into hibernation.
@@ -331,6 +352,60 @@ provider erlang {
*/
probe process__heap_shrink(char *p, int old_size, int new_size);
+ /**
+ * Fired when a process links to another process.
+ *
+ * @param p the PID (string form) of the process
+ * @param p2 the PID (string form) of the process that p links to
+ * @param ts timestamp
+ */
+ probe process__link(char *p, char *p2, uint64_t ts);
+
+ /**
+ * Fired when a process gets linked to another process.
+ *
+ * @param p the PID (string form) of the process
+ * @param p2 the PID (string form) of the process that p gets linked to
+ * @param ts timestamp
+ */
+ probe process__getting_linked(char *p, char *p2, uint64_t ts);
+
+ /**
+ * Fired when a process gets unlinked from another process.
+ *
+ * @param p the PID (string form) of the process
+ * @param p2 the PID (string form) of the process that p gets unlinked from
+ * @param ts timestamp
+ */
+ probe process__getting_unlinked(char *p, char *p2, uint64_t ts);
+
+ /**
+ * Fired when a process removes the link to another process.
+ *
+ * @param p the PID (string form) of the process
+ * @param p2 the PID (string form) of the process that p removes the link to
+ * @param ts timestamp
+ */
+ probe process__unlink(char *p, char *p2, uint64_t ts);
+
+ /**
+ * Fired when a process is registered with a name.
+ *
+ * @param p the PID (string form) of the registered process
+ * @param name the name that is associated with the process
+ * @param ts timestamp
+ */
+ probe process__registered(char *p, char *name, uint64_t ts);
+
+ /**
+ * Fired when a process is unregistered.
+ *
+ * @param p the PID (string form) of the unregistered process
+ * @param name the name that was associated with the process
+ * @param ts timestamp
+ */
+ probe process__unregistered(char *p, char *name, uint64_t ts);
+
/* network distribution */
/**
@@ -459,6 +534,60 @@ provider erlang {
*/
probe port__not_busy(char *port);
+ /**
+ * Fired when a process links to a port.
+ *
+ * @param p the PID (string form) of the process
+ * @param port the ID of the port that p links to
+ * @param ts timestamp
+ */
+ probe port__link(char *p, char *port, uint64_t ts);
+
+ /**
+ * Fired when a process removes the link to a port.
+ *
+ * @param p the PID (string form) of the process
+ * @param port the ID of the port that p removes the link to
+ * @param ts timestamp
+ */
+ probe port__unlink(char *p, char *port, uint64_t ts);
+
+ /**
+ * Fired when a port gets linked to a process.
+ *
+ * @param p the PID (string form) of the process
+ * @param port the ID of the port that gets linked to p
+ * @param ts timestamp
+ */
+ probe port__getting_linked(char *p, char *port, uint64_t ts);
+
+ /**
+ * Fired when a port gets unlinked from a process.
+ *
+ * @param p the PID (string form) of the process
+ * @param port the ID of the port that gets unlinked from p
+ * @param ts timestamp
+ */
+ probe port__getting_unlinked(char *p, char *port, uint64_t ts);
+
+ /**
+ * Fired when a port is registered with a name.
+ *
+ * @param p the port ID of the registered port
+ * @param name the name that is associated with the port
+ * @param ts timestamp
+ */
+ probe port__registered(char *p, char *name, uint64_t ts);
+
+ /**
+ * Fired when a port is unregistered.
+ *
+ * @param p the port ID of the registered port
+ * @param name the name that was associated with the port
+ * @param ts timestamp
+ */
+ probe port__unregistered(char *p, char *name, uint64_t ts);
+
/* drivers */
/**
View
33 erts/emulator/beam/global.h
@@ -1114,6 +1114,14 @@ dtrace_pid_str(Eterm pid, char *process_buf)
}
ERTS_GLB_INLINE void
+dtrace_portid_str(Eterm portid, char *port_buf)
+{
+ erts_snprintf(port_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>",
+ port_channel_no(portid),
+ port_number(portid));
+}
+
+ERTS_GLB_INLINE void
dtrace_proc_str(Process *process, char *process_buf)
{
dtrace_pid_str(process->common.id, process_buf);
@@ -1122,9 +1130,7 @@ dtrace_proc_str(Process *process, char *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->common.id),
- port_number(port->common.id));
+ dtrace_portid_str(port->common.id, port_buf);
}
ERTS_GLB_INLINE void
@@ -1139,6 +1145,27 @@ dtrace_fun_decode(Process *process,
erts_snprintf(mfa_buf, DTRACE_TERM_BUF_SIZE, "%T:%T/%d",
module, function, arity);
}
+
+ERTS_GLB_INLINE Uint64
+dtrace_ts(void)
+{
+
+ Uint64 res;
+ Uint m, s, u;
+
+#ifdef HAVE_ERTS_NOW_CPU
+ erts_get_now_cpu(&m, &s, &u);
+#else
+ get_now(&m, &s, &u);
+#endif
+
+ res = u;
+ res += 1000000 * s;
+ res += (Uint64) 1000000 * (Uint64) 1000000 * (Uint64) m;
+
+ return res;
+}
+
#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
#endif /* !__GLOBAL_H__ */
View
11 erts/emulator/beam/io.c
@@ -2581,6 +2581,17 @@ port_link_failure(Eterm port_id, Eterm linker)
if (IS_TRACED_FL(rp, F_TRACE_PROCS))
trace_proc(NULL, rp, am_getting_unlinked, port_id);
}
+#ifdef USE_VM_PROBES
+ if (xres >= 0 && DTRACE_ENABLED(port_getting_unlinked)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(unlinked_port_name,
+ DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp, process_name);
+ dtrace_portid_str(port_id, unlinked_port_name);
+ DTRACE3(port_getting_unlinked, process_name,
+ unlinked_port_name, dtrace_ts());
+ }
+#endif
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
}
View
36 erts/emulator/beam/register.c
@@ -224,12 +224,30 @@ int erts_register_name(Process *c_p, Eterm name, Eterm id)
if (IS_TRACED_FL(proc, F_TRACE_PROCS)) {
trace_proc(c_p, proc, am_register, name);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_registered)) {
+ DTRACE_CHARBUF(pid, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(rname, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(proc, pid);
+ erts_snprintf(rname, DTRACE_TERM_BUF_SIZE - 1, "%T", name);
+ DTRACE3(process_registered, pid, rname, dtrace_ts());
+ }
+#endif
proc->common.u.alive.reg = rp;
}
else if (port && rp->pt == port) {
if (IS_TRACED_FL(port, F_TRACE_PORTS)) {
trace_port(port, am_register, name);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_registered)) {
+ DTRACE_CHARBUF(portid, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(rname, DTRACE_TERM_BUF_SIZE);
+ dtrace_port_str(port, portid);
+ erts_snprintf(rname, DTRACE_TERM_BUF_SIZE - 1, "%T", name);
+ DTRACE3(port_registered, portid, rname, dtrace_ts());
+ }
+#endif
port->common.u.alive.reg = rp;
}
@@ -534,6 +552,15 @@ int erts_unregister_name(Process *c_p,
if (IS_TRACED_FL(port, F_TRACE_PORTS)) {
trace_port(port, am_unregister, r.name);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_unregistered)) {
+ DTRACE_CHARBUF(portid, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(rname, DTRACE_TERM_BUF_SIZE);
+ dtrace_port_str(port, portid);
+ erts_snprintf(rname, DTRACE_TERM_BUF_SIZE - 1, "%T", r.name);
+ DTRACE3(port_unregistered, portid, rname, dtrace_ts());
+ }
+#endif
} else if (rp->p) {
@@ -550,6 +577,15 @@ int erts_unregister_name(Process *c_p,
if (IS_TRACED_FL(rp->p, F_TRACE_PROCS)) {
trace_proc(c_p, rp->p, am_unregister, r.name);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_unregistered)) {
+ DTRACE_CHARBUF(pid, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(rname, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(rp->p, pid);
+ erts_snprintf(rname, DTRACE_TERM_BUF_SIZE - 1, "%T", r.name);
+ DTRACE3(process_unregistered, pid, rname, dtrace_ts());
+ }
+#endif
#ifdef ERTS_SMP
if (rp->p != c_p) {
erts_smp_proc_unlock(rp->p, ERTS_PROC_LOCK_MAIN);
View
2  lib/Makefile
@@ -30,7 +30,7 @@ ifdef BUILD_ALL
pman public_key ssl toolbar tv observer odbc diameter \
cosTransactions cosEvent cosTime cosNotification \
cosProperty cosFileTransfer cosEventDomain et megaco webtool \
- eunit ssh typer percept eldap dialyzer hipe
+ eunit ssh typer percept percept2 eldap dialyzer hipe
EXTRA_FILE := $(wildcard EXTRA-APPLICATIONS)
EXTRA_APPLICATIONS := $(if $(EXTRA_FILE),$(shell cat $(EXTRA_FILE)))
endif
1  lib/percept2
@@ -0,0 +1 @@
+Subproject commit 0a8fb0f411e498e3d351b18cbfe9c9b645dce48f

No commit comments for this range

Something went wrong with that request. Please try again.