]> sourceware.org Git - systemtap.git/commitdiff
Remove STAPCONF_UTRACE_VIA_FTRACE.
authorDavid Smith <dsmith@redhat.com>
Fri, 8 Jun 2012 17:38:57 +0000 (12:38 -0500)
committerDavid Smith <dsmith@redhat.com>
Fri, 8 Jun 2012 17:38:57 +0000 (12:38 -0500)
* 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.

buildrun.cxx
runtime/autoconf-utrace-via-ftrace.c [deleted file]
runtime/runtime.h
runtime/stp_utrace.c
runtime/task_finder.c
tapsets.cxx
testsuite/lib/systemtap.exp

index 386bd432edaecbadf766c86a0b1b7c505da1fc05..8ef7fa495cba8f806d4f93efe9a3ee0963b698b5 100644 (file)
@@ -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 (file)
index 8e1b4f9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <trace/events/sched.h>
-#include <trace/events/syscalls.h>
-#include <linux/ftrace.h>
-#include <linux/task_work.h>
-
-// The utrace-less task_finder needs either:
-// - 5 specific tracepoints
-// - 4 specific tracepoints and ftrace_set_filter()
-// Both scenarios need <linux/task_work.h>.
-//
-// 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);
-}
index f8c20a736a2100f3c7dc7b042401d8aa0c7e71e9..40d9a920c2d10f951b61cad50c20ba9e6681da35 100644 (file)
@@ -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
index bac586824028fe7852b81893ef8c46e562a4ea5d..d4538d91066416a4a4517ea09ef1e66eff7ca81b 100644 (file)
 #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 <linux/list.h>
 #include <linux/sched.h>
 #include <linux/freezer.h>
 #include <linux/slab.h>
-#ifdef STAPCONF_UTRACE_VIA_FTRACE
-#include <linux/ftrace.h>
-#endif /* STAPCONF_UTRACE_VIA_FTRACE */
 #include <linux/spinlock.h>
 #include <trace/events/sched.h>
 #include <trace/events/syscalls.h>
@@ -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)) {
index ad8d353e0d030f6bc0756fbb8b8f5f1e7530d2b7..7cae6fde7d0f62a574a850c4e8a351755d14776a 100644 (file)
@@ -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.
  */
index dae6aadc4fd3b83534b47757adac97c14449b7c5..722b8dddbcd455ed29447437f71ded8d36605972 100644 (file)
@@ -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.
index 7d2c0dfdbe894ce5e34f8205bf378753eb727eb2..c8bdc959369669be773049e90e75b4fd68674c96 100644 (file)
@@ -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
This page took 0.039987 seconds and 5 git commands to generate.