diff options
Diffstat (limited to 'lib/dtrace/examples')
-rw-r--r-- | lib/dtrace/examples/dist.d | 14 | ||||
-rw-r--r-- | lib/dtrace/examples/port1.d | 8 | ||||
-rw-r--r-- | lib/dtrace/examples/process-scheduling.d | 2 |
3 files changed, 13 insertions, 11 deletions
diff --git a/lib/dtrace/examples/dist.d b/lib/dtrace/examples/dist.d index f37c827f14..550e10d363 100644 --- a/lib/dtrace/examples/dist.d +++ b/lib/dtrace/examples/dist.d @@ -30,13 +30,13 @@ erlang*:::dist-port_busy { printf("dist port_busy: node %s, port %s, remote_node %s, blocked pid %s\n", copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3)); - blocked_procs[copyinstr(arg3)] = timestamp; -} - -erlang*:::dist-port_busy -{ - printf("dist port_busy: node %s, port %s, remote_node %s, blocked pid %s\n", - copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3)); + /* + * For variable use advice, see: + * http://dtrace.org/blogs/brendan/2011/11/25/dtrace-variable-types/ + * + * Howevever, it's quite possible for the blocked events to span + * threads, so we'll use globals. + */ blocked_procs[copyinstr(arg3)] = timestamp; } diff --git a/lib/dtrace/examples/port1.d b/lib/dtrace/examples/port1.d index b82e783a14..204abbd3b8 100644 --- a/lib/dtrace/examples/port1.d +++ b/lib/dtrace/examples/port1.d @@ -99,10 +99,12 @@ erlang*:::port-command erlang*:::port-control { - cmd = driver_map[copyinstr(arg2), arg3]; - cmd_str = (cmd == 0) ? "unknown" : cmd; + /* http://dtrace.org/blogs/brendan/2011/11/25/dtrace-variable-types/ */ + this->cmd = driver_map[copyinstr(arg2), arg3]; + this->cmd_str = (this->cmd == 0) ? "unknown" : this->cmd; printf("port control pid %s port %s port name %s command %d %s\n", - copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3, cmd_str); + copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3, + this->cmd_str); } /* port-exit is fired as a result of port_close() or exit signal */ diff --git a/lib/dtrace/examples/process-scheduling.d b/lib/dtrace/examples/process-scheduling.d index 9e31da2774..79e9cc598c 100644 --- a/lib/dtrace/examples/process-scheduling.d +++ b/lib/dtrace/examples/process-scheduling.d @@ -31,5 +31,5 @@ erlang*:::process-unscheduled erlang*:::process-hibernate { printf(" Hibernate pid %s resume mfa %s\n", - copyinstr(arg0), copyinstr(arg1)); + copyinstr(arg0), copyinstr(arg1)); } |