runtime/linux/uprobes2/uprobes_x86.h - systemtap
Data types defined
Functions defined
Macros defined
Source code
#ifndef _ASM_UPROBES_H
#define _ASM_UPROBES_H
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <asm/thread_info.h>
#define CONFIG_URETPROBES 1
#define CONFIG_UPROBES_SSOL 1
typedef u8 uprobe_opcode_t;
#define BREAKPOINT_INSTRUCTION 0xcc
#define BP_INSN_SIZE 1
#define MAX_UINSN_BYTES 16
#ifdef CONFIG_X86_32
#define SLOT_IP(tsk) 12
#else
#define SLOT_IP(tsk) (test_tsk_thread_flag(tsk, TIF_IA32) ? 12 : 16)
#endif
#define BREAKPOINT_SIGNAL SIGTRAP
#define SSTEP_SIGNAL SIGTRAP
#define ARCH_BP_INST_PTR(inst_ptr) (inst_ptr - BP_INSN_SIZE)
#define UPFIX_RIP_RAX 0x1 #define UPFIX_RIP_RCX 0x2 #define UPFIX_ABS_IP 0x4 #define UPFIX_RETURN 0x8
#ifdef CONFIG_X86_64
struct uprobe_probept_arch_info {
unsigned long flags;
unsigned long rip_target_address;
};
struct uprobe_task_arch_info {
unsigned long saved_scratch_register;
};
#else
struct uprobe_probept_arch_info {
unsigned long flags;
};
struct uprobe_task_arch_info {};
#endif
struct uprobe_probept;
struct uprobe_task;
static int arch_validate_probed_insn(struct uprobe_probept *ppt,
struct task_struct *tsk);
static inline unsigned long arch_get_probept(struct pt_regs *regs)
{
return (unsigned long) (regs->ip - BP_INSN_SIZE);
}
static inline void arch_reset_ip_for_sstep(struct pt_regs *regs)
{
regs->ip -= BP_INSN_SIZE;
}
static inline void arch_restore_uret_addr(unsigned long ret_addr,
struct pt_regs *regs)
{
regs->ip = ret_addr;
}
static inline unsigned long arch_get_cur_sp(struct pt_regs *regs)
{
return (unsigned long) regs->sp;
}
#define STRUCT_RETURN_SLOP 4
static inline unsigned long arch_predict_sp_at_ret(struct pt_regs *regs,
struct task_struct *tsk)
{
if (test_tsk_thread_flag(tsk, TIF_IA32))
return (unsigned long) (regs->sp + 4 + STRUCT_RETURN_SLOP);
else
return (unsigned long) (regs->sp + 8);
}
static unsigned long arch_hijack_uret_addr(unsigned long trampoline_addr,
struct pt_regs*, struct uprobe_task*);
#endif