Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
uprobes.c File Reference
#include <linux/kernel.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/rmap.h>
#include <linux/mmu_notifier.h>
#include <linux/swap.h>
#include <linux/ptrace.h>
#include <linux/kdebug.h>
#include "../../mm/internal.h"
#include <linux/uprobes.h>

Go to the source code of this file.

Data Structures

struct  uprobe
 
struct  map_info
 

Macros

#define UINSNS_PER_PAGE   (PAGE_SIZE/UPROBE_XOL_SLOT_BYTES)
 
#define MAX_UPROBE_XOL_SLOTS   UINSNS_PER_PAGE
 
#define UPROBES_HASH_SZ   13
 
#define uprobes_hash(v)   (&uprobes_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])
 
#define uprobes_mmap_hash(v)   (&uprobes_mmap_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])
 
#define UPROBE_COPY_INSN   0
 
#define UPROBE_RUN_HANDLER   1
 
#define UPROBE_SKIP_SSTEP   2
 

Functions

bool __weak is_swbp_insn (uprobe_opcode_t *insn)
 
int __weak set_swbp (struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
 
int __weak set_orig_insn (struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
 
int uprobe_register (struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
 
void uprobe_unregister (struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
 
int uprobe_mmap (struct vm_area_struct *vma)
 
void uprobe_munmap (struct vm_area_struct *vma, unsigned long start, unsigned long end)
 
void uprobe_clear_state (struct mm_struct *mm)
 
void uprobe_dup_mmap (struct mm_struct *oldmm, struct mm_struct *newmm)
 
unsigned long __weak uprobe_get_swbp_addr (struct pt_regs *regs)
 
void uprobe_free_utask (struct task_struct *t)
 
void uprobe_copy_process (struct task_struct *t)
 
bool uprobe_deny_signal (void)
 
void __weak arch_uprobe_enable_step (struct arch_uprobe *arch)
 
void __weak arch_uprobe_disable_step (struct arch_uprobe *arch)
 
void uprobe_notify_resume (struct pt_regs *regs)
 
int uprobe_pre_sstep_notifier (struct pt_regs *regs)
 
int uprobe_post_sstep_notifier (struct pt_regs *regs)
 
 module_init (init_uprobes)
 
 module_exit (exit_uprobes)
 

Macro Definition Documentation

#define MAX_UPROBE_XOL_SLOTS   UINSNS_PER_PAGE

Definition at line 40 of file uprobes.c.

#define UINSNS_PER_PAGE   (PAGE_SIZE/UPROBE_XOL_SLOT_BYTES)

Definition at line 39 of file uprobes.c.

#define UPROBE_COPY_INSN   0

Definition at line 82 of file uprobes.c.

#define UPROBE_RUN_HANDLER   1

Definition at line 84 of file uprobes.c.

#define UPROBE_SKIP_SSTEP   2

Definition at line 86 of file uprobes.c.

#define uprobes_hash (   v)    (&uprobes_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])

Definition at line 68 of file uprobes.c.

#define UPROBES_HASH_SZ   13

Definition at line 46 of file uprobes.c.

#define uprobes_mmap_hash (   v)    (&uprobes_mmap_mutex[((unsigned long)(v)) % UPROBES_HASH_SZ])

Definition at line 72 of file uprobes.c.

Function Documentation

void __weak arch_uprobe_disable_step ( struct arch_uprobe arch)

Definition at line 1438 of file uprobes.c.

void __weak arch_uprobe_enable_step ( struct arch_uprobe arch)

Definition at line 1433 of file uprobes.c.

bool __weak is_swbp_insn ( uprobe_opcode_t insn)

is_swbp_insn - check if instruction is breakpoint instruction. : instruction to be checked. Default implementation of is_swbp_insn Returns true if is a breakpoint instruction.

Definition at line 194 of file uprobes.c.

module_exit ( exit_uprobes  )
module_init ( init_uprobes  )
int __weak set_orig_insn ( struct arch_uprobe auprobe,
struct mm_struct mm,
unsigned long  vaddr 
)

set_orig_insn - Restore the original instruction. : the probed process address space. : arch specific probepoint information. : the virtual address to insert the opcode.

For mm , restore the original opcode (opcode) at . Return 0 (success) or a negative errno.

Definition at line 322 of file uprobes.c.

int __weak set_swbp ( struct arch_uprobe auprobe,
struct mm_struct mm,
unsigned long  vaddr 
)

set_swbp - store breakpoint at a given address. : arch specific probepoint information. : the probed process address space. : the virtual address to insert the opcode.

For mm , store the breakpoint instruction at . Return 0 (success) or a negative errno.

Definition at line 307 of file uprobes.c.

void uprobe_clear_state ( struct mm_struct mm)

Definition at line 1122 of file uprobes.c.

void uprobe_copy_process ( struct task_struct t)

Definition at line 1278 of file uprobes.c.

bool uprobe_deny_signal ( void  )

Definition at line 1322 of file uprobes.c.

void uprobe_dup_mmap ( struct mm_struct oldmm,
struct mm_struct newmm 
)

Definition at line 1134 of file uprobes.c.

void uprobe_free_utask ( struct task_struct t)

Definition at line 1260 of file uprobes.c.

unsigned long __weak uprobe_get_swbp_addr ( struct pt_regs regs)

uprobe_get_swbp_addr - compute address of swbp given post-swbp regs : Reflects the saved state of the task after it has hit a breakpoint instruction. Return the address of the breakpoint instruction.

Definition at line 1251 of file uprobes.c.

int uprobe_mmap ( struct vm_area_struct vma)

Definition at line 969 of file uprobes.c.

void uprobe_munmap ( struct vm_area_struct vma,
unsigned long  start,
unsigned long  end 
)

Definition at line 1019 of file uprobes.c.

void uprobe_notify_resume ( struct pt_regs regs)

Definition at line 1550 of file uprobes.c.

int uprobe_post_sstep_notifier ( struct pt_regs regs)

Definition at line 1580 of file uprobes.c.

int uprobe_pre_sstep_notifier ( struct pt_regs regs)

Definition at line 1567 of file uprobes.c.

int uprobe_register ( struct inode inode,
loff_t  offset,
struct uprobe_consumer uc 
)

Definition at line 836 of file uprobes.c.

void uprobe_unregister ( struct inode inode,
loff_t  offset,
struct uprobe_consumer uc 
)

Definition at line 876 of file uprobes.c.