From 8771a2bb36e81dcbd41c1ba5516bec4b1c560e4b Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Tue, 27 Aug 2013 15:49:50 -0400 Subject: [PATCH] dtrace: fix retrieval of arg5 through arg9 Fix the retrieval of arguments passed on the stack for SDT, USDT, and direct call probes. This commit also adds trivial support for testcases related to this fix. Orabug: 17368166 Signed-off-by: Kris Van Hees --- include/linux/dtrace_cpu.h | 1 + kernel/dtrace/dtrace_cpu.c | 1 + kernel/dtrace/dtrace_os.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/include/linux/dtrace_cpu.h b/include/linux/dtrace_cpu.h index 02d5cf90bbd4..4fa09946edf6 100644 --- a/include/linux/dtrace_cpu.h +++ b/include/linux/dtrace_cpu.h @@ -16,6 +16,7 @@ typedef struct cpu_core { struct mutex cpuc_pid_lock; uintptr_t cpu_dtrace_caller; + struct pt_regs *cpu_dtrace_regs; ktime_t cpu_dtrace_chillmark; ktime_t cpu_dtrace_chilled; rwlock_t cpu_ft_lock; diff --git a/kernel/dtrace/dtrace_cpu.c b/kernel/dtrace/dtrace_cpu.c index 572c580fca72..994fca15201b 100644 --- a/kernel/dtrace/dtrace_cpu.c +++ b/kernel/dtrace/dtrace_cpu.c @@ -34,6 +34,7 @@ void dtrace_cpu_init(void) cpuc->cpuc_dcpc_intr_state = 0; cpuc->cpuc_dtrace_illval = 0; mutex_init(&cpuc->cpuc_pid_lock); + cpuc->cpu_dtrace_regs = NULL; cpuc->cpu_dtrace_caller = 0; rwlock_init(&cpuc->cpu_ft_lock); } diff --git a/kernel/dtrace/dtrace_os.c b/kernel/dtrace/dtrace_os.c index bee4c551a5db..1501908f59d8 100644 --- a/kernel/dtrace/dtrace_os.c +++ b/kernel/dtrace/dtrace_os.c @@ -194,6 +194,12 @@ static void psinfo_cleaner(struct work_struct *work) psinfo_free_list = NULL; spin_unlock_irqrestore(&psinfo_lock, flags); +#ifdef CONFIG_DT_DEBUG + DTRACE_PROBE8(test, uint64_t, 10, uint64_t, 20, uint64_t, 30, + uint64_t, 40, uint64_t, 50, uint64_t, 60, + uint64_t, 70, uint64_t, 80); +#endif + while (psinfo) { dtrace_psinfo_t *next = psinfo->next; -- 2.50.1