diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-14 15:35:57 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-14 15:37:27 +0200 |
commit | 3e6f813222057941515df9cdb1f5d89ac3dd9cf5 (patch) | |
tree | 41686f918047fa15ebe97d86a5496e73d192ca41 | |
parent | 04e79317308588af47f236469e9d286dccc177ec (diff) | |
download | otp-3e6f813222057941515df9cdb1f5d89ac3dd9cf5.tar.gz otp-3e6f813222057941515df9cdb1f5d89ac3dd9cf5.tar.bz2 otp-3e6f813222057941515df9cdb1f5d89ac3dd9cf5.zip |
erts: Don't use function location when process is terminating
-rw-r--r-- | erts/emulator/beam/erl_trace.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c index fb3f0d4e62..1654ea58d9 100644 --- a/erts/emulator/beam/erl_trace.c +++ b/erts/emulator/beam/erl_trace.c @@ -3020,6 +3020,7 @@ profile_runnable_proc(Process *p, Eterm status){ Eterm *hp, msg; Eterm where = am_undefined; ErlHeapFragment *bp = NULL; + int use_current = 1; #ifndef ERTS_SMP #define LOCAL_HEAP_SIZE (4 + 6 + ERTS_TRACE_PATCH_TS_MAX_SIZE) @@ -3032,12 +3033,19 @@ profile_runnable_proc(Process *p, Eterm status){ Uint hsz = 4 + 6 + patch_ts_size(erts_system_profile_ts_type)-1; #endif - if (!p->current) { - p->current = find_function_from_pc(p->i); + if (ERTS_PROC_IS_EXITING(p)) { + use_current = 0; + /* could probably set 'where' to 'exiting' here, + * though it's not documented as such */ + } else { + if (!p->current) { + p->current = find_function_from_pc(p->i); + } + use_current = p->current != NULL; } #ifdef ERTS_SMP - if (!p->current) { + if (!use_current) { hsz -= 4; } @@ -3045,7 +3053,7 @@ profile_runnable_proc(Process *p, Eterm status){ hp = bp->mem; #endif - if (p->current) { + if (use_current) { where = TUPLE3(hp, p->current[0], p->current[1], make_small(p->current[2])); hp += 4; } else { where = make_small(0); |