ons. Removal of runtime/linux/autoconf-utrace-regset.c. Patch to previous commits to fix testcase errors.
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");
+++ /dev/null
-#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);
-}
/* 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
(* (task_user_regset_view_fn)(kallsyms_task_user_regset_view))((t)) : \
NULL)
#endif
-#endif
struct usr_regset_lut {
char *name;
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);
#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."
#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;
#define HRTIMER_MODE_REL HRTIMER_REL
#endif
-#endif /* kernel version >= 2.6.17 */
-
#endif /* _LINUX_TIMER_H_ */
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) {
#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
#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
/* 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 */
/* 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;
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) */
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)
}
#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.
#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
}
#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
}
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) << "}";
}
*/
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
%}
/**
*/
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
%}
/**
%{
// 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
}
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
%{
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))) +
STAP_RETVALUE=(long)kread(&(skb->network_header)) +
(long)sizeof(struct tcphdr);
#endif
- #endif
CATCH_DEREF_FAULT();
%}
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;
}
%}
#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
%}
/**
{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"},
{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]));
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;
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
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
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 ?
{
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)
%{
#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
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;
}) %})
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));
%{ /* 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));
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();
%}
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();
%}
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();
%}
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();
%}
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
#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));
// 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
// 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)) {";
#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;
// 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)]]]]
// 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) << "}";
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.
// 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