From: David Smith Date: Fri, 8 Jun 2012 17:38:57 +0000 (-0500) Subject: Remove STAPCONF_UTRACE_VIA_FTRACE. X-Git-Tag: release-1.8~35 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=b266d31863cdba02ef99f3669a1dd2402f69985c;p=systemtap.git Remove STAPCONF_UTRACE_VIA_FTRACE. * buildrun.cxx (compile_pass): Removed autoconf-utrace-via-ftrace.c test compilation. * runtime/autoconf-utrace-via-ftrace.c: Removed. * tapsets.cxx (check_process_probe_kernel_support): Updated comment to remove mention of STAPCONF_UTRACE_VIA_FTRACE. * runtime/task_finder.c: Ditto. * runtime/runtime.h: Removed STAPCONF_UTRACE_VIA_FTRACE reference. * runtime/stp_utrace.c: Removed all STAPCONF_UTRACE_VIA_FTRACE code. * testsuite/lib/systemtap.exp (utrace_p): Updated requirement list for utrace-via-tracepoints. --- diff --git a/buildrun.cxx b/buildrun.cxx index 386bd432e..8ef7fa495 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -311,7 +311,6 @@ compile_pass (systemtap_session& s) output_autoconf(s, o, "autoconf-module-sect-attrs.c", "STAPCONF_MODULE_SECT_ATTRS", NULL); output_autoconf(s, o, "autoconf-utrace-via-tracepoints.c", "STAPCONF_UTRACE_VIA_TRACEPOINTS", NULL); - output_autoconf(s, o, "autoconf-utrace-via-ftrace.c", "STAPCONF_UTRACE_VIA_FTRACE", NULL); output_autoconf(s, o, "autoconf-vm-area-pte.c", "STAPCONF_VM_AREA_PTE", NULL); output_autoconf(s, o, "autoconf-relay-umode_t.c", "STAPCONF_RELAY_UMODE_T", NULL); output_autoconf(s, o, "autoconf-fs_supers-hlist.c", "STAPCONF_FS_SUPERS_HLIST", NULL); diff --git a/runtime/autoconf-utrace-via-ftrace.c b/runtime/autoconf-utrace-via-ftrace.c deleted file mode 100644 index 8e1b4f9a3..000000000 --- a/runtime/autoconf-utrace-via-ftrace.c +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include -#include -#include - -// The utrace-less task_finder needs either: -// - 5 specific tracepoints -// - 4 specific tracepoints and ftrace_set_filter() -// Both scenarios need . -// -// Check scenario #2. - -void __sched_process_fork(void *cb_data __attribute__((unused)), - struct task_struct *parent __attribute__((unused)), - struct task_struct *child __attribute__((unused))) -{ - return; -} - -void __sched_process_exit(void *cb_data __attribute__((unused)), - struct task_struct *task __attribute__((unused))) -{ - return; -} - -void __sys_enter(void *cb_data __attribute__ ((unused)), - struct pt_regs *regs __attribute__((unused)), - long id __attribute__((unused))) -{ - return; -} - -void __sys_exit(void *cb_data __attribute__ ((unused)), - struct pt_regs *regs __attribute__((unused)), - long ret __attribute__((unused))) -{ - return; -} - -struct ftrace_ops __ftrace_ops; - -void __autoconf_func(void) -{ - char *report_exec_name; - struct task_work work; - - (void) register_trace_sched_process_fork(__sched_process_fork, NULL); - (void) register_trace_sched_process_exit(__sched_process_exit, NULL); - (void) register_trace_sys_enter(__sys_enter, NULL); - (void) register_trace_sys_exit(__sys_exit, NULL); - - report_exec_name = "*" __stringify(proc_exec_connector); - ftrace_set_filter(&__ftrace_ops, report_exec_name, - strlen(report_exec_name), 1); - (void) register_ftrace_function(&__ftrace_ops); - init_task_work(&work, NULL, NULL); -} diff --git a/runtime/runtime.h b/runtime/runtime.h index f8c20a736..40d9a920c 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -161,8 +161,7 @@ void *kallsyms_task_work_cancel; #include "regs.c" #include "regs-ia64.c" -#if (defined(CONFIG_UTRACE) || defined(STAPCONF_UTRACE_VIA_TRACEPOINTS) \ - || defined(STAPCONF_UTRACE_VIA_FTRACE)) +#if (defined(CONFIG_UTRACE) || defined(STAPCONF_UTRACE_VIA_TRACEPOINTS)) #define HAVE_TASK_FINDER #include "task_finder.c" #endif diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c index bac586824..d4538d910 100644 --- a/runtime/stp_utrace.c +++ b/runtime/stp_utrace.c @@ -13,30 +13,15 @@ #ifndef _STP_UTRACE_C #define _STP_UTRACE_C -/* - * Which internal utrace implementation shall we use? - * (1) STAPCONF_UTRACE_VIA_TRACEPOINTS - Pure tracepoints (preferred). - * (2) STAPCONF_UTRACE_VIA_FTRACE - Tracepoints, plus a bit of ftrace. - */ - -#if (!defined(STAPCONF_UTRACE_VIA_TRACEPOINTS) \ - && !defined(STAPCONF_UTRACE_VIA_FTRACE)) -#error "STAPCONF_UTRACE_VIA_TRACEPOINTS or STAPCONF_UTRACE_VIA_FTRACE must be defined." +#if (!defined(STAPCONF_UTRACE_VIA_TRACEPOINTS)) +#error "STAPCONF_UTRACE_VIA_TRACEPOINTS must be defined." #endif -#if (defined(STAPCONF_UTRACE_VIA_TRACEPOINTS) \ - && defined(STAPCONF_UTRACE_VIA_FTRACE)) -/* If we've got both, prefer STAPCONF_UTRACE_VIA_TRACEPOINTS. */ -#undef STAPCONF_UTRACE_VIA_FTRACE -#endif /* STAPCONF_UTRACE_VIA_TRACEPOINTS and STAPCONF_UTRACE_VIA_FTRACE */ #include "stp_utrace.h" #include #include #include #include -#ifdef STAPCONF_UTRACE_VIA_FTRACE -#include -#endif /* STAPCONF_UTRACE_VIA_FTRACE */ #include #include #include @@ -111,20 +96,10 @@ static void utrace_report_syscall_entry(void *cb_data __attribute__ ((unused)), static void utrace_report_syscall_exit(void *cb_data __attribute__ ((unused)), struct pt_regs *regs, long ret); -#ifdef STAPCONF_UTRACE_VIA_TRACEPOINTS static void utrace_report_exec(void *cb_data __attribute__ ((unused)), struct task_struct *task, pid_t old_pid __attribute__((unused)), struct linux_binprm *bprm __attribute__ ((unused))); -#else /* STAPCONF_UTRACE_VIA_FTRACE */ -static void utrace_report_exec(unsigned long ip __attribute__ ((unused)), - unsigned long parent_ip __attribute__ ((unused))); - -static struct ftrace_ops utrace_report_exec_ops __read_mostly = -{ - .func = utrace_report_exec, -}; -#endif /* STAPCONF_UTRACE_VIA_FTRACE */ #define __UTRACE_UNREGISTERED 0 #define __UTRACE_REGISTERED 1 @@ -143,9 +118,6 @@ int utrace_init(void) { int i; int rc = -1; -#ifdef STAPCONF_UTRACE_VIA_FTRACE - char *report_exec_name; -#endif #if !defined(STAPCONF_TASK_WORK_ADD_EXPORTED) /* The task_work_add()/task_work_cancel() functions aren't @@ -199,25 +171,13 @@ int utrace_init(void) goto error4; } -#ifdef STAPCONF_UTRACE_VIA_TRACEPOINTS rc = register_trace_sched_process_exec(utrace_report_exec, NULL); if (unlikely(rc != 0)) { _stp_error("register_sched_process_exec failed: %d", rc); goto error5; } -#else /* STAPCONF_UTRACE_VIA_FTRACE */ - report_exec_name = "*" __stringify(proc_exec_connector); - ftrace_set_filter(&utrace_report_exec_ops, report_exec_name, - strlen(report_exec_name), 1); - rc = register_ftrace_function(&utrace_report_exec_ops); - if (unlikely(rc != 0)) { - _stp_error("register_ftrace_function failed: %d", rc); - goto error5; - } -#endif /* STAPCONF_UTRACE_VIA_FTRACE */ atomic_set(&utrace_state, __UTRACE_REGISTERED); - return 0; error5: @@ -309,11 +269,7 @@ void utrace_shutdown(void) #ifdef STP_TF_DEBUG printk(KERN_ERR "%s:%d entry\n", __FUNCTION__, __LINE__); #endif -#ifdef STAPCONF_UTRACE_VIA_TRACEPOINTS unregister_trace_sched_process_exec(utrace_report_exec, NULL); -#else /* STAPCONF_UTRACE_VIA_FTRACE */ - unregister_ftrace_function(&utrace_report_exec_ops); -#endif /* STAPCONF_UTRACE_VIA_FTRACE */ unregister_trace_sched_process_fork(utrace_report_clone, NULL); unregister_trace_sched_process_exit(utrace_report_death, NULL); unregister_trace_sys_enter(utrace_report_syscall_entry, NULL); @@ -1834,19 +1790,11 @@ static const struct utrace_engine_ops *start_callback( /* * Called iff UTRACE_EVENT(EXEC) flag is set. */ -#ifdef STAPCONF_UTRACE_VIA_TRACEPOINTS static void utrace_report_exec(void *cb_data __attribute__ ((unused)), struct task_struct *task, pid_t old_pid __attribute__((unused)), struct linux_binprm *bprm __attribute__ ((unused))) -#else /* STAPCONF_UTRACE_VIA_FTRACE */ -static void utrace_report_exec(unsigned long ip __attribute__ ((unused)), - unsigned long parent_ip __attribute__ ((unused))) -#endif /* STAPCONF_UTRACE_VIA_FTRACE */ { -#ifdef STAPCONF_UTRACE_VIA_FTRACE - struct task_struct *task = current; -#endif struct utrace *utrace = task_utrace_struct(task); if (utrace && utrace->utrace_flags & UTRACE_EVENT(EXEC)) { diff --git a/runtime/task_finder.c b/runtime/task_finder.c index ad8d353e0..7cae6fde7 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -5,8 +5,7 @@ * Which utrace shall we use? * (1) Built-in kernel utrace (preferred), indicated by * CONFIG_UTRACE. - * (2) Internal utrace. Requires either - * STAPCONF_UTRACE_VIA_TRACEPOINTS or STAPCONF_UTRACE_VIA_FTRACE. + * (2) Internal utrace. Requires STAPCONF_UTRACE_VIA_TRACEPOINTS. * (3) If we don't have either (old kernels or new kernels without all * the pre-requisites), error. */ diff --git a/tapsets.cxx b/tapsets.cxx index dae6aadc4..722b8dddb 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4120,9 +4120,8 @@ check_process_probe_kernel_support(systemtap_session& s) // We don't have utrace. For process probes that aren't // uprobes-based, we just need the task_finder. The task_finder - // needs CONFIG_TRACEPOINTS and specific tracepoints (and perhaps - // some CONFIG_FTRACE support). There are specific autoconf tests - // for its needs. + // needs CONFIG_TRACEPOINTS and specific tracepoints. There is a + // specific autoconf test for its needs. // // We'll just require CONFIG_TRACEPOINTS here as a quick-and-dirty // approximation. diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 7d2c0dfdb..c8bdc9593 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -18,21 +18,16 @@ proc utrace_p {} { if {! [catch {exec grep -q utrace_attach $path} dummy]} { return 1 - # (2) Tracepoint-based utrace. Check for either: - # (2a) the set of 5 tracepoints we need (see - # runtime/autoconf-utrace-via-ftrace.c) - # (2b) the 4 tracepoints and the ftrace function we need (see - # runtime/autoconf-utrace-via-ftrace.c) - # - # Since 4 tracepoints are shared between the 2 methods, that makes - # things a bit easier. + # (2) Tracepoint-based utrace. Check for the set of 5 tracepoints + # we need and task_work_add() (see + # runtime/autoconf-utrace-via-tracepoints.c for details). } elseif {! [catch {exec grep -q tracepoint_sched_process_fork $path} dummy] && ! [catch {exec grep -q tracepoint_sched_process_exit $path} dummy] && ! [catch {exec grep -q tracepoint_sys_enter $path} dummy] && ! [catch {exec grep -q tracepoint_sys_exit $path} dummy] - && (! [catch {exec grep -q tracepoint_sched_process_exec $path} dummy] - || ! [catch {exec grep -q ftrace_set_filter $path} dummy])} { + && ! [catch {exec grep -q tracepoint_sched_process_exec $path} dummy] + && ! [catch {exec grep -q tasK_worK_add $path} dummy]} { return 1 } return 0