linux-3.12 fixes
diff --git a/runtime/linux/alloc.c b/runtime/linux/alloc.c
index 7e7e5ce..c12c360 100644
--- a/runtime/linux/alloc.c
+++ b/runtime/linux/alloc.c
@@ -441,7 +441,7 @@ static void *_stp_alloc_percpu(size_t size)
#ifdef STAPCONF_ALLOC_PERCPU_ALIGN
ret = __alloc_percpu(size, 8);
#else
- ret = __alloc_percpu(size);
+ ret = __alloc_percpu(size, 8);
#endif
#ifdef DEBUG_MEM
if (likely(ret)) {
diff --git a/runtime/linux/regs.c b/runtime/linux/regs.c
index a7501dd..f8b910c 100644
--- a/runtime/linux/regs.c
+++ b/runtime/linux/regs.c
@@ -41,11 +41,11 @@
#if defined (__x86_64__)
#ifdef STAPCONF_X86_UNIREGS
-#define EREG(nm, regs) ((regs)->nm)
-#define RREG(nm, regs) ((regs)->nm)
-#else
#define EREG(nm, regs) ((regs)->e##nm)
#define RREG(nm, regs) ((regs)->r##nm)
+#else
+#define EREG(nm, regs) ((regs)->nm)
+#define RREG(nm, regs) ((regs)->nm)
#endif
static void _stp_print_regs(struct pt_regs * regs)
diff --git a/runtime/regs.h b/runtime/regs.h
index 2f027ad..b1d0743 100644
--- a/runtime/regs.h
+++ b/runtime/regs.h
@@ -11,7 +11,7 @@
#ifndef _REGS_H_ /* -*- linux-c -*- */
#define _REGS_H_
-#if defined (STAPCONF_X86_UNIREGS) && (defined (__x86_64__) || defined (__i386__))
+#if defined (STAPCONF_X86_UNIREGS) && defined (__i386__)
#define REG_IP(regs) regs->ip
#define REG_SP(regs) regs->sp
diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c
index 6c9815d..4e1e3cd 100644
--- a/runtime/transport/relay_v2.c
+++ b/runtime/transport/relay_v2.c
@@ -202,14 +202,13 @@ static int __stp_relay_remove_buf_file_callback(struct dentry *dentry)
debugfs_remove(dentry);
return 0;
}
-
static struct dentry *
__stp_relay_create_buf_file_callback(const char *filename,
struct dentry *parent,
#ifdef STAPCONF_RELAY_UMODE_T
umode_t mode,
#else
- int mode,
+ umode_t mode,
#endif
struct rchan_buf *buf,
int *is_global)
@@ -241,7 +240,7 @@ __stp_relay_create_buf_file_callback(const char *filename,
return file;
}
-static struct rchan_callbacks __stp_relay_callbacks = {
+static struct rchan_callbacks __stp_relay_callbacks = {
.subbuf_start = __stp_relay_subbuf_start_callback,
.create_buf_file = __stp_relay_create_buf_file_callback,
.remove_buf_file = __stp_relay_remove_buf_file_callback,
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index e81ac7d..ef52000 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -532,7 +532,7 @@ static struct dentry *_stp_get_root_dir(void)
sb = hlist_entry(fs->fs_supers.first, struct super_block,
s_instances);
#else
- sb = list_entry(fs->fs_supers.next, struct super_block,
+ sb = list_entry(fs->fs_supers.first, struct super_block,
s_instances);
#endif
_stp_lock_inode(sb->s_root->d_inode);
diff --git a/runtime/uidgid_compatibility.h b/runtime/uidgid_compatibility.h
index 017142c..6d01777 100644
--- a/runtime/uidgid_compatibility.h
+++ b/runtime/uidgid_compatibility.h
@@ -12,10 +12,10 @@
#define _UIDGID_COMPATIBILITY_H_
#ifndef STAPCONF_LINUX_UIDGID_H
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
#define KUIDT_INIT(value) ((uid_t) value)
#define KGIDT_INIT(value) ((gid_t) value)
-
+#endif
#else
#include <linux/cred.h>
diff --git a/tapsets.cxx b/tapsets.cxx
index 9755bf3..292700f 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -24,6 +24,7 @@
#include "dwflpp.h"
#include "setupdwfl.h"
#include <gelf.h>
+#include <linux/elf-em.h>
#include "sdt_types.h"
Хеловорд работает :) C остальными позже... В общем шаблоны переделывать нужно.
#stap -ve 'probe begin { log("hello world") exit () }'