From 27811db5cff9cb78e8efec026d936ace38ec1c76 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Wed, 23 Jan 2013 04:50:06 -0500 Subject: [PATCH] dtrace: remove incorrect FBT support code Code that was supporting an early implementation of FBT was still left hanging in the source code tree. This patch removes it in preparation for a more generic and above all, correct (and stable) implementation. Signed-off-by: Kris Van Hees --- include/linux/dtrace_os.h | 9 ------ kernel/dtrace/dtrace_os.c | 59 --------------------------------------- 2 files changed, 68 deletions(-) diff --git a/include/linux/dtrace_os.h b/include/linux/dtrace_os.h index c0d0ed33fa3b..4a828489770b 100644 --- a/include/linux/dtrace_os.h +++ b/include/linux/dtrace_os.h @@ -72,13 +72,4 @@ typedef struct stacktrace_state { extern void dtrace_stacktrace(stacktrace_state_t *); -#define FBT_PUSHL_EBP 0x55 -#define FBT_RET 0xc3 -#define FBT_RET_IMM16 0xc2 - -typedef void *(fbt_provide_fn)(struct module *, char *, uint8_t, - uint8_t *, void *); - -extern void dtrace_fbt_init(fbt_provide_fn); - #endif /* _DTRACE_OS_H_ */ diff --git a/kernel/dtrace/dtrace_os.c b/kernel/dtrace/dtrace_os.c index 6bf95f1c2787..f55bfd0a024e 100644 --- a/kernel/dtrace/dtrace_os.c +++ b/kernel/dtrace/dtrace_os.c @@ -910,62 +910,3 @@ long dtrace_rt_sigreturn(struct pt_regs *regs) return rc; } - -/*---------------------------------------------------------------------------*\ -(* FUNCTION BOUNDARY TRACING (FBT) SUPPORT *) -\*---------------------------------------------------------------------------*/ - -void dtrace_fbt_init(fbt_provide_fn *pfn) -{ - loff_t pos = 0; - struct kallsym_iter iter, sym; - - kallsyms_iter_update(&iter, 0); - if (!kallsyms_iter_update(&iter, pos++)) - return; - - while (pos > 0) { - sym = iter; - if (!kallsyms_iter_update(&iter, pos++)) - pos = 0; - - if (sym.module_name[0] != '\0') - break; - - if (sym.type == 'T' || sym.type == 't' || sym.type == 'W') { - uint8_t *addr, *end; - - addr = (uint8_t *)sym.value; - end = (uint8_t *)iter.value; - - if (*addr == FBT_PUSHL_EBP) { - struct insn insn; - void *pfbt = NULL; - - (*pfn)(dtrace_kmod, sym.name, FBT_PUSHL_EBP, - addr, NULL); - - while (addr < end) { - uint8_t opc; - - insn_init(&insn, addr, 1); - insn_get_opcode(&insn); - - opc = insn.opcode.bytes[0]; - - if (opc == FBT_RET || - opc == FBT_RET_IMM16) { - pfbt = (*pfn)(dtrace_kmod, - sym.name, opc, - addr, pfbt); - } - - insn_get_length(&insn); - - addr += insn.length; - } - } - } - } -} -EXPORT_SYMBOL(dtrace_fbt_init); -- 2.50.1