From aa409a8f610cfeab5a0858e5f58faf594153b6c9 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Wed, 10 Apr 2013 04:40:53 -0400 Subject: [PATCH] Revert "stack() / jstack(): Send PID to userspace." This reverts commit d42235829341592e23996d727bc5c3beebec1e57. The bug with the PID not being passed is a bug in dtrace_isa.c instead, and there is a slot already reserved for that. So this patch was not necessary, and the bug will be fixed in dtrace_isa.c get_ufpstack and get_upcstack with a subsequent commit. Signed-off-by: Kris Van Hees --- dtrace/dtrace_ecb.c | 3 +-- dtrace/dtrace_probe.c | 16 ++++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/dtrace/dtrace_ecb.c b/dtrace/dtrace_ecb.c index c2c929324a64..596477c7e0af 100644 --- a/dtrace/dtrace_ecb.c +++ b/dtrace/dtrace_ecb.c @@ -278,8 +278,7 @@ static int dtrace_ecb_action_add(dtrace_ecb_t *ecb, dtrace_actdesc_t *desc) arg = DTRACE_USTACK_ARG(nframes, strsize); } - size = (nframes + 2) * sizeof(uint64_t); /* +1 for limit, - +1 for PID */ + size = (nframes + 1) * sizeof(uint64_t); size += DTRACE_USTACK_STRSIZE(arg); size = P2ROUNDUP(size, (uint32_t)(sizeof(uintptr_t))); diff --git a/dtrace/dtrace_probe.c b/dtrace/dtrace_probe.c index a161c9301d93..0a6cb394a61b 100644 --- a/dtrace/dtrace_probe.c +++ b/dtrace/dtrace_probe.c @@ -855,9 +855,7 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, continue; case DTRACEACT_JSTACK: - case DTRACEACT_USTACK: { - pid_t pid = current->pid; - + case DTRACEACT_USTACK: if (!dtrace_priv_proc(state)) continue; @@ -877,35 +875,29 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, continue; } - DTRACE_STORE(uint64_t, tomax, valoffs, - (uint64_t)pid); - if (DTRACE_USTACK_STRSIZE(rec->dtrd_arg) != 0 && current->dtrace_helpers != NULL) { /* * This is the slow path -- we have * allocated string space, and we're * getting the stack of a process that - * has helpers. Call into a separate + * has helpers. Call into a separate * routine to perform this processing. */ dtrace_action_ustack( &mstate, state, - (uint64_t *)(tomax + valoffs + - sizeof(uint64_t)), + (uint64_t *)(tomax + valoffs), rec->dtrd_arg); continue; } DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); dtrace_getupcstack( - (uint64_t *)(tomax + valoffs + - sizeof(uint64_t)), + (uint64_t *)(tomax + valoffs), DTRACE_USTACK_NFRAMES(rec->dtrd_arg) + 1); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); continue; - } default: break; -- 2.50.1