]> sourceware.org Git - systemtap.git/commitdiff
PR30434 complete: Further removal of "if" branches related to old distros/kernel...
authorHousam Alamour <halamour@redhat.com>
Wed, 16 Aug 2023 18:35:20 +0000 (14:35 -0400)
committerHousam Alamour <halamour@redhat.com>
Thu, 24 Aug 2023 15:31:38 +0000 (11:31 -0400)
ons. Removal of runtime/linux/autoconf-utrace-regset.c. Patch to previous commits to fix testcase errors.

27 files changed:
buildrun.cxx
runtime/linux/autoconf-utrace-regset.c [deleted file]
runtime/linux/loc2c-runtime.h
runtime/linux/namespaces.h
runtime/linux/runtime.h
runtime/linux/timer.h
runtime/linux/uprobes-inode.c
runtime/proc_fs_compatibility.h
runtime/time.c
runtime/transport/symbols.c
runtime/transport/transport.c
tapset-utrace.cxx
tapset/linux/context.stp
tapset/linux/dentry.stp
tapset/linux/ipmib.stp
tapset/linux/kretprobe.stp
tapset/linux/nfsderrno.stp
tapset/linux/rlimit.stp
tapset/linux/s390/sysc_execve.stp
tapset/linux/task.stp
tapset/linux/tcp.stp
tapset/linux/tcpmib.stp
tapset/linux/timestamp_monotonic.stp
tapsets.cxx
testsuite/systemtap.syscall/futimes.c
testsuite/systemtap.syscall/uselib.c
translate.cxx

index dfa84f098791d6a61472ba4f80c1df4236d20593..7e070bc162616de9696546be9c1a42deb9286aa4 100644 (file)
@@ -385,7 +385,6 @@ compile_pass (systemtap_session& s)
   output_autoconf(s, o, cs, "autoconf-grsecurity.c", "STAPCONF_GRSECURITY", NULL);
   output_autoconf(s, o, cs, "autoconf-trace-printk.c", "STAPCONF_TRACE_PRINTK", NULL);
   output_autoconf(s, o, cs, "autoconf-regset.c", "STAPCONF_REGSET", NULL);
-  output_autoconf(s, o, cs, "autoconf-utrace-regset.c", "STAPCONF_UTRACE_REGSET", NULL);
   output_autoconf(s, o, cs, "autoconf-hlist-4args.c", "STAPCONF_HLIST_4ARGS", NULL);
   output_autoconf(s, o, cs, "autoconf-get-kretprobe.c", "STAPCONF_GET_KRETPROBE", NULL);
   output_exportconf(s, o2, "tsc_khz", "STAPCONF_TSC_KHZ");
diff --git a/runtime/linux/autoconf-utrace-regset.c b/runtime/linux/autoconf-utrace-regset.c
deleted file mode 100644 (file)
index 1728f23..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <linux/tracehook.h>
-
-/* old rhel5 utrace regset */
-int foobar(int n) { 
-  const struct utrace_regset_view *rsv = utrace_native_view(current);  
-  const struct utrace_regset *rs = & rsv->regsets[0];
-  return rsv->n + n + (rs->get)(current, rs, 0, 0, NULL, NULL);
-}
index 0710606fe6fca2fb3b280c83c554f5f59ddf77d2..4d25a86c93bfba63227ea60a831b9a20f8a047f8 100644 (file)
 
 /* PR 10601: user-space (user_regset) register access.
    Needs arch specific code, only i386 and x86_64 for now.  */
-#if ((defined(STAPCONF_REGSET) || defined(STAPCONF_UTRACE_REGSET)) \
+#if ((defined(STAPCONF_REGSET)) \
      && (defined (__i386__) || defined (__x86_64__)))
 
 #if defined(STAPCONF_REGSET)
 #include <linux/regset.h>
 #endif
 
-#if defined(STAPCONF_UTRACE_REGSET)
-#include <linux/tracehook.h>
-/* adapt new names to old decls */
-#define user_regset_view utrace_regset_view
-#define user_regset utrace_regset
-#define task_user_regset_view utrace_native_view
-
-#else // PR13489, inodes-uprobes export kludge
+// PR13489, inodes-uprobes export kludge
 #if !defined(STAPCONF_TASK_USER_REGSET_VIEW_EXPORTED)
 // First typedef from the original decl, then #define it as a typecasted call.
 // NB: not all archs actually have the function, but the decl is universal in regset.h
@@ -86,7 +79,6 @@ typedef typeof(&task_user_regset_view) task_user_regset_view_fn;
                                   (* (task_user_regset_view_fn)(kallsyms_task_user_regset_view))((t)) : \
                                   NULL)
 #endif
-#endif
 
 struct usr_regset_lut {
   char *name;
index 21b30e650581ef34c1332d6f3e7a7333482417da..c26c2e44332a5221a841ac88fd64816a9a7f7b46 100644 (file)
@@ -191,15 +191,8 @@ static struct user_namespace *get_user_namespace(int target_ns)
   if (!target_ns_task)
     return NULL;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
-  target_user_ns = target_ns_task->nsproxy->user_ns;
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
-  target_user_ns = (task_cred_xxx(target_ns_task, user))->user_ns;
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) */
+ /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) */
   target_user_ns = task_cred_xxx(target_ns_task, user_ns);
-#endif
-#endif
 
   if (target_user_ns)
     get_user_ns(target_user_ns);
index 8ed3cad4cd878e6f5b910a2fa90cf1f7c26c80dd..4652bca27cf1bf0798082a9f28ed37fade1d1ebd 100644 (file)
@@ -85,10 +85,7 @@ static void *kallsyms_nmi_uaccess_okay = NULL;
 #endif
 #endif
 
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 #include <linux/user_namespace.h>
-#endif
 
 #if !defined (CONFIG_DEBUG_FS)  && !defined (CONFIG_DEBUG_FS_MODULE)
 #error "DebugFS is required and was not found in the kernel."
index e7e0bb6f00558924e6c2555c3ea783cc5228df22..f71b168a1a2b370c96c1ccd88f282eb7564318a3 100644 (file)
@@ -12,9 +12,6 @@
 #define _LINUX_TIMER_H_
 
 // If we're on kernels < 2.6.17, then hrtimers are not supported.
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
-#error "hrtimers not implemented"
-#else /* kernel version >= 2.6.17 */
 #include <linux/hrtimer.h>
 
 static unsigned long stap_hrtimer_resolution = 0;
@@ -46,6 +43,4 @@ typedef enum hrtimer_restart hrtimer_return_t;
 #define HRTIMER_MODE_REL HRTIMER_REL
 #endif
 
-#endif /* kernel version >= 2.6.17 */
-
 #endif /* _LINUX_TIMER_H_ */
index 411d2188442d68f31d045525b834daed048ba76a..9267eee4f297f3ea2732bc706a94fc074434327e 100644 (file)
@@ -323,13 +323,9 @@ stapiu_decrement_process_semaphores(struct stapiu_process *p,
     struct task_struct *task;
     rcu_read_lock();
     
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
-    /* We'd like to call find_task_by_pid_ns() here, but it isn't
-     * exported.  So, we call what it calls...  */
-    task = pid_task(find_pid_ns(p->tgid, &init_pid_ns), PIDTYPE_PID);
-#else
-    task = find_task_by_pid(p->tgid);
-#endif
+  /* We'd like to call find_task_by_pid_ns() here, but it isn't
+    * exported.  So, we call what it calls...  */
+  task = pid_task(find_pid_ns(p->tgid, &init_pid_ns), PIDTYPE_PID);
 
     /* The task may have exited while we weren't watching.  */
     if (task) {
index 0e200c7ffbafbd8d8ca9fadb64fc9f8f5ff723e0..f19698df29dedfba0ff161fcd6209686385412ee 100644 (file)
@@ -34,11 +34,7 @@ static void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid)
 #endif
 
 // 2.6.24 fixed proc_dir_entry refcounting.
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
-#define LAST_ENTRY_COUNT 0
-#else
 #define LAST_ENTRY_COUNT 1
-#endif
 
 /* Notice that this proc_remove() compatibility function isn't
  * exactly like the original, since it can remove entire
index 67003486c86301c69dba86138b514bd9048b1a51..84bebbce4aa180a0dd1994849d2884e42d033709 100644 (file)
@@ -34,11 +34,6 @@ static int64_t _stp_gettimeofday_ns(void) {
 #if defined (__i386__) || defined (__x86_64__)
 #include <asm/cpufeature.h>
 #endif
-#if defined (STAPCONF_TSC_KHZ) && \
-    !(defined (__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
-// x86_64 didn't need a specific header until 2.6.21.  Otherwise:
-#include <asm/tsc.h>
-#endif
 #ifdef STAPCONF_KTIME_GET_REAL
 #include <linux/ktime.h>
 #endif
index b5951deff6df0b0967de7c29cc75eb66e9289ff2..64ade9e0f79b98c250570876d46a2468186a954a 100644 (file)
@@ -324,9 +324,7 @@ static int _stp_module_notifier (struct notifier_block * nb,
         /* Give the probes a chance to update themselves. */
         /* Proper kprobes support for this appears to be relatively
            recent.  Example prerequisite commits: 0deddf436a f24659d9 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
-        systemtap_module_refresh(mod->name);
-#endif
+systemtap_module_refresh(mod->name);
 
 #endif /* skipped for ancient or kallsyms-free kernels */
 
@@ -339,7 +337,7 @@ static int _stp_module_update_self (void)
   /* Or if we need to figure out the addr->file:line mapping */
 #if (defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)) \
     || defined(STP_NEED_LINE_DATA)
-#if defined(CONFIG_KALLSYMS)  && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+#if defined(CONFIG_KALLSYMS)
 
        bool found_eh_frame = false;
        struct module *mod = THIS_MODULE;
@@ -427,7 +425,7 @@ static int _stp_module_update_self (void)
 
         put_module_sect_attrs (&attrs);
         
-#endif /* defined(CONFIG_KALLSYMS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) */
+#endif /* defined(CONFIG_KALLSYMS) */
 #endif /* (defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA))
           || defined(STP_NEED_LINE_DATA) */
 
index cf57d42867821abd8578c72bb7ec30872874a727..c2b86e6d3c9a69bff05532bcea6d51582b5d3791 100644 (file)
@@ -236,23 +236,6 @@ static void _stp_handle_start(struct _stp_msg_start *st)
        if (handle_startup) {
                dbug_trans(1, "stp_handle_start\n");
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) // linux commit #5f4352fb
-#if LINUX_VERSION_CODE <  KERNEL_VERSION(2,6,29) // linux commit #9be260a6
-#ifdef STAPCONF_VM_AREA
-               { /* PR9740: workaround for kernel valloc bug. */
-                  /* PR14611: not required except within above kernel range. */
-                       void *dummy;
-#ifdef STAPCONF_VM_AREA_PTE
-                       dummy = alloc_vm_area (PAGE_SIZE, NULL);
-#else
-                       dummy = alloc_vm_area (PAGE_SIZE);
-#endif
-                       free_vm_area (dummy);
-               }
-#endif
-#endif
-#endif
-
                _stp_target = st->target;
 
 #if defined(CONFIG_USER_NS)
@@ -341,7 +324,7 @@ static int _stp_handle_kallsyms_lookups(void)
   }
 #endif
   /* PR13489, missing inode-uprobes symbol-export workaround */
-#if !defined(STAPCONF_TASK_USER_REGSET_VIEW_EXPORTED) && !defined(STAPCONF_UTRACE_REGSET) /* RHEL5 era utrace */
+#if !defined(STAPCONF_TASK_USER_REGSET_VIEW_EXPORTED) /* RHEL5 era utrace */
         kallsyms_task_user_regset_view = (void*) kallsyms_lookup_name ("task_user_regset_view");
         /* There exist interesting kernel versions without task_user_regset_view(), like ARM before 3.0.
            For these kernels, uprobes etc. are out of the question, but plain kernel stap works fine.
@@ -693,12 +676,8 @@ static inline void _stp_lock_inode(struct inode *inode)
 #ifdef STAPCONF_INODE_RWSEM
        inode_lock(inode);
 #else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
        might_sleep();
        mutex_lock(&inode->i_mutex);
-#else
-       down(&inode->i_sem);
-#endif
 #endif
 }
 
@@ -707,11 +686,7 @@ static inline void _stp_unlock_inode(struct inode *inode)
 #ifdef STAPCONF_INODE_RWSEM
        inode_unlock(inode);
 #else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
        mutex_unlock(&inode->i_mutex);
-#else
-       up(&inode->i_sem);
-#endif
 #endif
 }
 
index 60cdba8d7513e55bb5d802e603fab4d375e37411..498bd56550e105288042497d0375dbd3ea85512f 100644 (file)
@@ -1263,10 +1263,6 @@ utrace_derived_probe_group::emit_module_linux_exit (systemtap_session& s)
   s.op->newline() << "/* ---- utrace probes ---- */";
   s.op->newline() << "for (i=0; i<ARRAY_SIZE(stap_utrace_probes); i++) {";
   s.op->newline(1) << "struct stap_utrace_probe *p = &stap_utrace_probes[i];";
-
-  s.op->newline() << "if (p->engine_attached) {";
-
-  s.op->newline(-1) << "}";
   s.op->newline(-1) << "}";
 }
 
index 0bcab5365efb714db990f363b0f6f1e37c0b3a15..7f47bfd8be7d88dbb7ce05cbdcacb912f3150e20 100644 (file)
@@ -114,13 +114,7 @@ function ns_ppid:long()
  */
 function pgrp:long ()
 %{ /* pure */ /* unprivileged */ /* stable */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
-       struct signal_struct *ss = kread( &(current->signal) );
-       STAP_RETVALUE = kread ( &(ss->pgrp) );
-       CATCH_DEREF_FAULT();
-#else
        STAP_RETVALUE = task_pgrp_nr_ns(current, &init_pid_ns);
-#endif
 %}
 
 /**
@@ -145,13 +139,7 @@ function ns_pgrp:long ()
  */
 function sid:long ()
 %{ /* pure */ /* unprivileged */ /* stable */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
-       struct signal_struct *ss = kread( &(current->signal) );
-       STAP_RETVALUE = kread ( &(ss->session) );
-       CATCH_DEREF_FAULT();
-#else
        STAP_RETVALUE = task_session_nr_ns(current, &init_pid_ns);
-#endif
 %}
 
 /**
index 02c781cdd0c3747a64d320b5a84aef0c91bd0e1d..4d012161ca4251eafb52936578d5e17f39d20e47 100644 (file)
@@ -9,9 +9,7 @@
 
 %{
 // Make sure the filesystem "magic" constants we use are defined.
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
 #include <linux/magic.h>
-#endif
 #ifndef PIPEFS_MAGIC
 #define PIPEFS_MAGIC            0x50495045
 #endif
@@ -274,18 +272,6 @@ function task_dentry_path:string(task:long,dentry:long,vfsmnt:long)
                                }
                                break
                        }
-                       /* RHEL6-era kernels */
-                       else {
-                               /* Global root? */
-                               if (vfsmnt->mnt_parent == vfsmnt)
-                                       return sprintf("%s%s",
-                                                      d_name(vfsmnt->mnt_mountpoint),
-                                                      name)
-
-                               dentry = vfsmnt->mnt_mountpoint
-                               vfsmnt = vfsmnt->mnt_parent
-                               continue
-                       }
                }
                name = __dentry_prepend(dentry, name)
                dentry = dentry->d_parent
index 6f51dfd5224a8f31797279581723ac30dcf17a31..c9ef9a3c5baa1127af65f7f3b0ee40bc8d1ada5a 100644 (file)
@@ -136,10 +136,6 @@ function ipmib_get_proto:long (skb:long)
 %{
        struct sk_buff *skb = (struct sk_buff *)(uintptr_t)STAP_ARG_skb;
        /* as done by skb_network_header() */
-       #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
-               STAP_RETVALUE=(long)kread(&(skb->nh.raw)) +
-                       (long)sizeof(struct tcphdr);
-       #else
        #ifdef NET_SKBUFF_DATA_USES_OFFSET
                STAP_RETVALUE=(long)kread(&(skb->network_header)) +
                (long)(kread(&(skb->head))) +
@@ -148,7 +144,6 @@ function ipmib_get_proto:long (skb:long)
                STAP_RETVALUE=(long)kread(&(skb->network_header)) +
                (long)sizeof(struct tcphdr);
        #endif
-       #endif
        CATCH_DEREF_FAULT();
 %}
 
index 43b82feb010c1bc348e34eeaa8d2703b47a10ba1..045bea709de7daf292c77d5dff72a3498ca15307 100644 (file)
 static void *
 _kretprobe_data(struct kretprobe_instance *pi, size_t offset, size_t length)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
        size_t end = offset + length;
        if (end > offset && pi && end <= pi->rp->data_size)
                return &pi->data[offset];
-#endif
        return NULL;
 }
 %}
index 5ce7331c72a9f97948f912af6c5919d8cbe65f54..63ca019abbc4438b9147ae5f5400dfd831b0da38 100644 (file)
@@ -73,7 +73,6 @@
 #define        nfserr_cb_path_down     __constant_htonl(NFSERR_CB_PATH_DOWN)
 #define        nfserr_locked           __constant_htonl(NFSERR_LOCKED)
 #define        nfserr_wrongsec         __constant_htonl(NFSERR_WRONGSEC)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
 #define nfserr_badiomode               __constant_htonl(NFS4ERR_BADIOMODE)
 #define nfserr_badlayout               __constant_htonl(NFS4ERR_BADLAYOUT)
 #define nfserr_bad_session_digest      __constant_htonl(NFS4ERR_BAD_SESSION_DIGEST)
 #define nfserr_reject_deleg            __constant_htonl(NFS4ERR_REJECT_DELEG)
 #define nfserr_returnconflict          __constant_htonl(NFS4ERR_RETURNCONFLICT)
 #define nfserr_deleg_revoked           __constant_htonl(NFS4ERR_DELEG_REVOKED)
-#endif
 %}
 
 /**
@@ -191,7 +189,6 @@ function nfsderror:string(err:long)
                {nfserr_cb_path_down, "NFSERR_CB_PATH_DOWN"},
                {nfserr_locked, "NFSERR_LOCKED"},
                {nfserr_wrongsec, "NFSERR_WRONGSEC"},
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
                {nfserr_badiomode, "NFS4ERR_BADIOMODE"},
                {nfserr_badlayout, "NFS4ERR_BADLAYOUT"},
                {nfserr_bad_session_digest, "NFS4ERR_BAD_SESSION_DIGEST"},
@@ -230,7 +227,6 @@ function nfsderror:string(err:long)
                {nfserr_reject_deleg, "NFS4ERR_REJECT_DELEG"},
                {nfserr_returnconflict, "NFS4ERR_RETURNCONFLICT"},
                {nfserr_deleg_revoked, "NFS4ERR_DELEG_REVOKED"},
-#endif
        };
        int     i;
        int tabsz = (sizeof(nfs_errtbl)/sizeof(nfs_errtbl[0]));
index c4c426f7975ccaebe00c6af01b8795c972302678..3c49167d716a9674575ed09efd63aea52b9da770 100644 (file)
@@ -33,19 +33,13 @@ function rlimit_from_str:long (lim_str:string)
     aux_rlimit(RLIMIT_AS);
     aux_rlimit(RLIMIT_LOCKS);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,8)
     aux_rlimit(RLIMIT_SIGPENDING);
     aux_rlimit(RLIMIT_MSGQUEUE);
-#endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
     aux_rlimit(RLIMIT_NICE);
     aux_rlimit(RLIMIT_RTPRIO);
-#endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
     aux_rlimit(RLIMIT_RTTIME);
-#endif
 
     STAP_RETVALUE = -1;
 
index 76d091195642c6538acd5942df14f28b1045687f..16b15478889c23b0308a4e2d78396ecc7cb18586 100644 (file)
@@ -46,18 +46,9 @@ probe syscall.execve.return = dw_syscall.execve.return !,
 probe dw_syscall.execve = kernel.function("sys_execve").call
 {
        @_SYSCALL_EXECVE_NAME
-%( kernel_v < "2.6.32" %?
-       # The fact that the struct is passed in instead of a pointer
-       # confuses things.
-       __regs = &@cast(ulong_arg(1), "pt_regs", "kernel<asm/ptrace.h>")
-       filename = user_string_quoted(__regs->orig_gpr2)
-       args = __get_argv(__regs->gprs[3], 0)
-       env_str = __get_argv(__regs->gprs[4], 0)
-%:
        filename = user_string_quoted(@choose_defined($name, $filename))
        args = __get_argv($argv, 0)
        env_str = __get_argv($envp, 0)
-%)
        @_SYSCALL_EXECVE_ARGSTR
 }
 probe dw_syscall.execve.return = kernel.function("sys_execve").return
@@ -71,16 +62,9 @@ probe dw_syscall.execve.return = kernel.function("sys_execve").return
 probe nd_syscall.execve = kprobe.function("sys_execve")
 {
        @_SYSCALL_EXECVE_NAME
-%( kernel_v < "2.6.32" %?
-       __regs = &@cast(ulong_arg(1), "pt_regs", "kernel<asm/ptrace.h>")
-       filename = user_string_quoted(__regs->orig_gpr2)
-       args = __get_argv(__regs->gprs[3], 0)
-       env_str = __get_argv(__regs->gprs[4], 0)
-%:
        filename = user_string_quoted(pointer_arg(1))
        args = __get_argv(pointer_arg(2), 0)
        env_str = __get_argv(pointer_arg(3), 0)
-%)
        @_SYSCALL_EXECVE_ARGSTR
 }
 probe nd_syscall.execve.return = kprobe.function("sys_execve").return
@@ -104,18 +88,9 @@ probe syscall.compat_execve.return = dw_syscall.compat_execve.return !,
 probe dw_syscall.compat_execve = kernel.function("sys32_execve").call ?
 {
        @_SYSCALL_EXECVE_NAME
-%( kernel_v < "2.6.32" %?
-       # The fact that the struct is passed in instead of a pointer
-       # confuses things.
-       __regs = &@cast(ulong_arg(1), "pt_regs", "kernel<asm/ptrace.h>")
-       filename = user_string_quoted(__regs->orig_gpr2 & 0x7fffffff)
-       args = __get_compat_argv(__regs->gprs[3] & 0x7fffffff, 0)
-       env_str = __get_compat_argv(__regs->gprs[4] & 0x7fffffff, 0)
-%:
        filename = user_string_quoted(@choose_defined($name, $filename))
        args = __get_compat_argv($argv, 0)
        env_str = __get_compat_argv($envp, 0)
-%)
        @_SYSCALL_EXECVE_ARGSTR
 }
 probe dw_syscall.compat_execve.return = kernel.function("sys32_execve").return ?
@@ -130,12 +105,6 @@ probe nd_syscall.compat_execve = kprobe.function("sys32_execve") ?
 {
        asmlinkage()
        @_SYSCALL_EXECVE_NAME
-%( kernel_v < "2.6.32" %?
-       __regs = &@cast(ulong_arg(1), "pt_regs", "kernel<asm/ptrace.h>")
-       filename = user_string_quoted(__regs->orig_gpr2 & 0x7fffffff)
-       args = __get_compat_argv(__regs->gprs[3] & 0x7fffffff, 0)
-       env_str = __get_compat_argv(__regs->gprs[4] & 0x7fffffff, 0)
-%:
        filename = user_string_quoted(pointer_arg(1))
        args = __get_compat_argv(pointer_arg(2), 0)
        env_str = __get_compat_argv(pointer_arg(3), 0)
index d47462513e962eae352eb94a69a03f1e261ca815..ea75c0b869fcd08bd1a374241907b2e637c7b59c 100644 (file)
@@ -10,9 +10,7 @@
 %{
 #include <linux/version.h>
 #include <linux/file.h>
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
 #include <linux/fdtable.h>
-#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
 #include <linux/sched/rt.h>
 #endif
@@ -248,19 +246,10 @@ function pid2task:long (pid:long) {
     return & @task(%{ /* pure */ ({
         struct task_struct *t = NULL;
         pid_t t_pid  = (pid_t)(long)STAP_ARG_pid;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
         struct pid *p_pid = find_get_pid(t_pid);
         rcu_read_lock();
         t = pid_task(p_pid, PIDTYPE_PID);
         put_pid(p_pid);
-#else
-        rcu_read_lock();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
-        t = find_task_by_vpid (t_pid);
-#else
-        t = find_task_by_pid (t_pid);
-#endif /* 2.6.24 */
-#endif /* 2.6.31 */
         rcu_read_unlock();
         (unsigned long)t;
     }) %})
@@ -609,21 +598,11 @@ function task_open_file_handles:long (task:long)
     int locked = 0;
     unsigned int count=0, fd, max;
     struct task_struct *t;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
-    /* Older kernels */
-    struct files_struct *f;
-#else
     struct files_struct *fs;
     struct fdtable *f;
-#endif
     t = (struct task_struct *)(uintptr_t)STAP_ARG_task;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
-    /* Older kernels */
-    f = kread(&(t->files));
-#else
     fs = kread(&(t->files));
     f = kread(&(fs->fdt));
-#endif
     rcu_read_lock();
     locked = 1;
     max = kread(&(f->max_fds));
@@ -648,19 +627,11 @@ function task_max_file_handles:long (task:long)
 %{ /* pure */
     int locked = 0;
     struct task_struct *t;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
-    struct files_struct *f;
-#else
     struct files_struct *fs;
     struct fdtable *f;
-#endif
     t = (struct task_struct *)(uintptr_t)STAP_ARG_task;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
-    f = kread(&(t->files));
-#else
     fs = kread (&(t->files));
     f = kread(&(fs->fdt));
-#endif
     rcu_read_lock();
     locked = 1;
     STAP_RETVALUE = kread(&(f->max_fds));
index c9712a89e964a3e2c1ff23fc511d4477e276cfd9..9faaa15899d5818dd65c8a12e54fd4addb95c9b9 100644 (file)
 function tcp_get_info_rto:long(sock:long)
 %{ /* pure */
        struct sock *sk = (struct sock *)(uintptr_t) STAP_ARG_sock;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-       struct tcp_opt *tp = tcp_sk(sk);
-       STAP_RETVALUE = (int64_t) jiffies_to_usecs(kread(&(tp->rto)));
-#else
        const struct inet_connection_sock *icsk = inet_csk(sk);
        STAP_RETVALUE = (int64_t) jiffies_to_usecs(kread(&(icsk->icsk_rto)));
-#endif
        CATCH_DEREF_FAULT();
 %}
 
@@ -47,11 +42,7 @@ function tcp_get_info_rto:long(sock:long)
 function tcp_get_info_snd_cwnd:long(sock:long)
 %{ /* pure */
        struct sock *sk = (struct sock *)(uintptr_t) STAP_ARG_sock;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-       struct tcp_opt *tp = tcp_sk(sk);
-#else
        struct tcp_sock *tp = tcp_sk(sk);
-#endif
        STAP_RETVALUE = (int64_t) kread(&(tp->snd_cwnd));
        CATCH_DEREF_FAULT();
 %}
@@ -196,11 +187,7 @@ function tcp_sockstate_str:string (state:long) {
 function tcp_ts_get_info_snd_ssthresh:long(sock:long)
 %{ /* pure */
        struct sock *sk = (struct sock *)(uintptr_t) STAP_ARG_sock;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-       struct tcp_opt *tp = tcp_sk(sk);
-#else
        struct tcp_sock *tp = tcp_sk(sk);
-#endif
        STAP_RETVALUE = (int64_t) kread(&(tp->snd_ssthresh));
        CATCH_DEREF_FAULT();
 %}
@@ -210,13 +197,8 @@ function tcp_ts_get_info_snd_ssthresh:long(sock:long)
 function tcp_ts_get_info_rcv_mss:long(sock:long)
 %{ /* pure */
        struct sock *sk = (struct sock *)(uintptr_t) STAP_ARG_sock;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-       struct tcp_opt *tp = tcp_sk(sk);
-       STAP_RETVALUE = (int64_t) kread(&(tp->ack.rcv_mss));
-#else
        const struct inet_connection_sock *icsk = inet_csk(sk);
        STAP_RETVALUE = (int64_t) kread(&(icsk->icsk_ack.rcv_mss));
-#endif
        CATCH_DEREF_FAULT();
 %}
 
index e87553e80f09814def8a72cd3e2906253567481e..87478f937897fda83d412a859af30b74c64f32b3 100644 (file)
@@ -249,16 +249,12 @@ tcpmib.OutRsts = __tcpmib.OutRsts.*
         struct sk_buff *skb = (struct sk_buff *)(uintptr_t)STAP_ARG_skb;
        struct tcphdr th_copy;
 
-       #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
-               th = (struct tcphdr *)kread(&(skb->h.th));
-       #else
 
        #ifdef NET_SKBUFF_DATA_USES_OFFSET
                th = (struct tcphdr *)(kread(&(skb->network_header)) + kread(&(skb->head)));
        #else
                th = (struct tcphdr *)kread(&(skb->network_header));
        #endif
-       #endif
 
        // We'd like to kread the 'rst' field here. But, it is a
        // bitfield (and you can't take the address of a
@@ -283,14 +279,9 @@ tcpmib.OutRsts = __tcpmib.OutRsts.*
        #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
                rt = (struct rtable *)kread(&(skb->_skb_dst));
        #else
-
-       #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-               rt = (struct rtable *)kread(&(skb->dst));
-       #else
                rt = (struct rtable *)kread(&(skb->rtable));
        #endif
        #endif
-       #endif
 
        if ( rt )
                STAP_RETVALUE = kread(&(rt->rt_type));
index c8d142369cba29520abd9e7afad752d45e2b404b..1dad9a7e4f6102530878c1f64755c8ec80291f5e 100644 (file)
@@ -17,8 +17,7 @@
 // HAVE_UNSTABLE_SCHED_CLOCK archs (included in 2.6.32), and commit b9f8fcd5
 // for the rest (included in 2.6.33).  So before that, we'll just pretend that
 // cpu_clock and local_clock don't exist.
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) \
-    || (!defined (CONFIG_HAVE_UNSTABLE_SCHED_CLOCK) \
+#if (!defined (CONFIG_HAVE_UNSTABLE_SCHED_CLOCK) \
         && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)))
 #undef STAPCONF_CPU_CLOCK
 #undef STAPCONF_LOCAL_CLOCK
index 79b27a357caa3cc015980bdd6fa354e8ee270729..9bd28a0f08b9eeac3fe4e297e3d8bdf707e6013f 100644 (file)
@@ -9964,13 +9964,9 @@ uprobe_derived_probe_group::emit_module_utrace_exit (systemtap_session& s)
   // Do a pid->task_struct* lookup.  For 2.6.24+, this code assumes
   // that the pid is always in the global namespace, not in any
   // private namespace.
-  s.op->newline() << "#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)";
   // We'd like to call find_task_by_pid_ns() here, but it isn't
   // exported.  So, we call what it calls...
   s.op->newline() << "  tsk = pid_task(find_pid_ns(pid, &init_pid_ns), PIDTYPE_PID);";
-  s.op->newline() << "#else";
-  s.op->newline() << "  tsk = find_task_by_pid (pid);";
-  s.op->newline() << "#endif /* 2.6.24 */";
 
   s.op->newline() << "if (tsk) {"; // just in case the thing exited while we weren't watching
   s.op->newline(1) << "if (__access_process_vm_noflush(tsk, sup->sdt_sem_address, &sdt_semaphore, sizeof(sdt_semaphore), 0)) {";
index 2b0ab4435e4bdfc665d17a1e73129f4806015922..f44d8a46e6e9a5b006dc7e1528a918c20f8a0ae0 100644 (file)
@@ -90,7 +90,7 @@ int main()
 #endif
 #endif /* __NR_futimesat */
 
-#if defined(__NR_utimensat) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#if defined(__NR_utimensat)
   ts[0].tv_sec = 1000000000;
   ts[0].tv_nsec = 123456789;
   ts[1].tv_sec = 2000000000;
index 1ed70eb1884557a9d47c39f268ac215622b9036e..fd0d57d82ef335fc60bfec0a7d38ce1330790a30 100644 (file)
@@ -15,7 +15,7 @@ int main()
     // set up to call 'quiet_ni_syscall()', which is an assembly
     // language function that we can't probe. This was changed in
     // 2.6.22.
-#if defined(__NR_uselib) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#if defined(__NR_uselib)
 #define uselib(x) syscall(__NR_uselib,x)
     uselib("blah");
     //staptest// [[[[uselib ("blah") = -NNNN!!!!ni_syscall () = -NNNN (ENOSYS)]]]]
index e76fa9f9a3078f857ff1a8c27c8b23179791886f..76fa056390ca2b36dc4bc6e2f5cfc18b596a9472 100644 (file)
@@ -1200,11 +1200,7 @@ c_unparser::emit_common_header ()
       // to enable/disable probes.
       o->newline( 0)  << "#include <linux/workqueue.h>";
       o->newline( 0)  << "static struct work_struct module_refresher_work;";
-      o->newline( 0)  << "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)";
-      o->newline( 0)  << "static void module_refresher(void *data) {";
-      o->newline( 0)  << "#else";
       o->newline( 0)  << "static void module_refresher(struct work_struct *work) {";
-      o->newline( 0)  << "#endif";
       o->newline( 1)  <<    "systemtap_module_refresh(NULL);";
       o->newline(-1)  << "}";
 
@@ -2050,11 +2046,7 @@ c_unparser::emit_module_init ()
   if (!session->runtime_usermode_p())
     {
       // Initialize workqueue needed for on-the-fly arming/disarming
-      o->newline() << "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)";
-      o->newline() << "INIT_WORK(&module_refresher_work, module_refresher, NULL);";
-      o->newline() << "#else";
       o->newline() << "INIT_WORK(&module_refresher_work, module_refresher);";
-      o->newline() << "#endif";
     }
 
   // Run all probe registrations.  This actually runs begin probes.
@@ -8422,9 +8414,7 @@ translate_pass (systemtap_session& s)
           // background timer (module_refresh_timer). We need to disable that
           // part if hrtimers are not supported.
           s.op->newline() << "#include <linux/version.h>";
-          s.op->newline() << "#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)";
           s.op->newline() << "#define STP_ON_THE_FLY_TIMER_ENABLE";
-          s.op->newline() << "#endif";
         }
 
       // Emit embeds ahead of time, in case they affect context layout
This page took 0.061896 seconds and 5 git commands to generate.