Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (123 commits)
perf: Remove the nmi parameter from the oprofile_perf backend
x86, perf: Make copy_from_user_nmi() a library function
perf: Remove perf_event_attr::type check
x86, perf: P4 PMU - Fix typos in comments and style cleanup
perf tools: Make test use the preset debugfs path
perf tools: Add automated tests for events parsing
perf tools: De-opt the parse_events function
perf script: Fix display of IP address for non-callchain path
perf tools: Fix endian conversion reading event attr from file header
perf tools: Add missing 'node' alias to the hw_cache[] array
perf probe: Support adding probes on offline kernel modules
perf probe: Add probed module in front of function
perf probe: Introduce debuginfo to encapsulate dwarf information
perf-probe: Move dwarf library routines to dwarf-aux.{c, h}
perf probe: Remove redundant dwarf functions
perf probe: Move strtailcmp to string.c
perf probe: Rename DIE_FIND_CB_FOUND to DIE_FIND_CB_END
tracing/kprobe: Update symbol reference when loading module
tracing/kprobes: Support module init function probing
kprobes: Return -ENOENT if probe point doesn't exist
...
This commit is contained in:
commit
4d4abdcb1d
140 changed files with 4666 additions and 2677 deletions
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include <asm/ftrace.h>
|
||||
|
||||
struct ftrace_hash;
|
||||
|
||||
#ifdef CONFIG_FUNCTION_TRACER
|
||||
|
||||
extern int ftrace_enabled;
|
||||
|
|
@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
|
|||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
|
||||
|
||||
struct ftrace_hash;
|
||||
|
||||
enum {
|
||||
FTRACE_OPS_FL_ENABLED = 1 << 0,
|
||||
FTRACE_OPS_FL_GLOBAL = 1 << 1,
|
||||
|
|
@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write,
|
|||
struct ftrace_func_command {
|
||||
struct list_head list;
|
||||
char *name;
|
||||
int (*func)(char *func, char *cmd,
|
||||
int (*func)(struct ftrace_hash *hash,
|
||||
char *func, char *cmd,
|
||||
char *params, int enable);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ struct trace_iterator {
|
|||
struct trace_entry *ent;
|
||||
unsigned long lost_events;
|
||||
int leftover;
|
||||
int ent_size;
|
||||
int cpu;
|
||||
u64 ts;
|
||||
|
||||
|
|
@ -129,6 +130,10 @@ void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
|
|||
void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc);
|
||||
void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc,
|
||||
struct pt_regs *regs);
|
||||
void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
|
||||
struct ring_buffer_event *event);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
|
|||
extern struct perf_event *
|
||||
register_user_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context,
|
||||
struct task_struct *tsk);
|
||||
|
||||
/* FIXME: only change from the attr, and don't unregister */
|
||||
|
|
@ -85,11 +86,13 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
|
|||
extern struct perf_event *
|
||||
register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context,
|
||||
int cpu);
|
||||
|
||||
extern struct perf_event * __percpu *
|
||||
register_wide_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered);
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context);
|
||||
|
||||
extern int register_perf_hw_breakpoint(struct perf_event *bp);
|
||||
extern int __register_perf_hw_breakpoint(struct perf_event *bp);
|
||||
|
|
@ -115,6 +118,7 @@ static inline int __init init_hw_breakpoint(void) { return 0; }
|
|||
static inline struct perf_event *
|
||||
register_user_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context,
|
||||
struct task_struct *tsk) { return NULL; }
|
||||
static inline int
|
||||
modify_user_hw_breakpoint(struct perf_event *bp,
|
||||
|
|
@ -122,10 +126,12 @@ modify_user_hw_breakpoint(struct perf_event *bp,
|
|||
static inline struct perf_event *
|
||||
register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context,
|
||||
int cpu) { return NULL; }
|
||||
static inline struct perf_event * __percpu *
|
||||
register_wide_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered) { return NULL; }
|
||||
perf_overflow_handler_t triggered,
|
||||
void *context) { return NULL; }
|
||||
static inline int
|
||||
register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
|
||||
static inline int
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ enum perf_hw_id {
|
|||
/*
|
||||
* Generalized hardware cache events:
|
||||
*
|
||||
* { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x
|
||||
* { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
|
||||
* { read, write, prefetch } x
|
||||
* { accesses, misses }
|
||||
*/
|
||||
|
|
@ -72,6 +72,7 @@ enum perf_hw_cache_id {
|
|||
PERF_COUNT_HW_CACHE_DTLB = 3,
|
||||
PERF_COUNT_HW_CACHE_ITLB = 4,
|
||||
PERF_COUNT_HW_CACHE_BPU = 5,
|
||||
PERF_COUNT_HW_CACHE_NODE = 6,
|
||||
|
||||
PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
|
||||
};
|
||||
|
|
@ -536,6 +537,16 @@ struct perf_branch_stack {
|
|||
|
||||
struct task_struct;
|
||||
|
||||
/*
|
||||
* extra PMU register associated with an event
|
||||
*/
|
||||
struct hw_perf_event_extra {
|
||||
u64 config; /* register value */
|
||||
unsigned int reg; /* register address or index */
|
||||
int alloc; /* extra register already allocated */
|
||||
int idx; /* index in shared_regs->regs[] */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hw_perf_event - performance event hardware details:
|
||||
*/
|
||||
|
|
@ -549,9 +560,7 @@ struct hw_perf_event {
|
|||
unsigned long event_base;
|
||||
int idx;
|
||||
int last_cpu;
|
||||
unsigned int extra_reg;
|
||||
u64 extra_config;
|
||||
int extra_alloc;
|
||||
struct hw_perf_event_extra extra_reg;
|
||||
};
|
||||
struct { /* software */
|
||||
struct hrtimer hrtimer;
|
||||
|
|
@ -680,36 +689,9 @@ enum perf_event_active_state {
|
|||
};
|
||||
|
||||
struct file;
|
||||
|
||||
#define PERF_BUFFER_WRITABLE 0x01
|
||||
|
||||
struct perf_buffer {
|
||||
atomic_t refcount;
|
||||
struct rcu_head rcu_head;
|
||||
#ifdef CONFIG_PERF_USE_VMALLOC
|
||||
struct work_struct work;
|
||||
int page_order; /* allocation order */
|
||||
#endif
|
||||
int nr_pages; /* nr of data pages */
|
||||
int writable; /* are we writable */
|
||||
|
||||
atomic_t poll; /* POLL_ for wakeups */
|
||||
|
||||
local_t head; /* write position */
|
||||
local_t nest; /* nested writers */
|
||||
local_t events; /* event limit */
|
||||
local_t wakeup; /* wakeup stamp */
|
||||
local_t lost; /* nr records lost */
|
||||
|
||||
long watermark; /* wakeup watermark */
|
||||
|
||||
struct perf_event_mmap_page *user_page;
|
||||
void *data_pages[0];
|
||||
};
|
||||
|
||||
struct perf_sample_data;
|
||||
|
||||
typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
|
||||
typedef void (*perf_overflow_handler_t)(struct perf_event *,
|
||||
struct perf_sample_data *,
|
||||
struct pt_regs *regs);
|
||||
|
||||
|
|
@ -745,6 +727,8 @@ struct perf_cgroup {
|
|||
};
|
||||
#endif
|
||||
|
||||
struct ring_buffer;
|
||||
|
||||
/**
|
||||
* struct perf_event - performance event kernel representation:
|
||||
*/
|
||||
|
|
@ -834,7 +818,7 @@ struct perf_event {
|
|||
atomic_t mmap_count;
|
||||
int mmap_locked;
|
||||
struct user_struct *mmap_user;
|
||||
struct perf_buffer *buffer;
|
||||
struct ring_buffer *rb;
|
||||
|
||||
/* poll related */
|
||||
wait_queue_head_t waitq;
|
||||
|
|
@ -855,6 +839,7 @@ struct perf_event {
|
|||
u64 id;
|
||||
|
||||
perf_overflow_handler_t overflow_handler;
|
||||
void *overflow_handler_context;
|
||||
|
||||
#ifdef CONFIG_EVENT_TRACING
|
||||
struct ftrace_event_call *tp_event;
|
||||
|
|
@ -919,8 +904,8 @@ struct perf_event_context {
|
|||
u64 parent_gen;
|
||||
u64 generation;
|
||||
int pin_count;
|
||||
struct rcu_head rcu_head;
|
||||
int nr_cgroups; /* cgroup events present */
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -945,13 +930,11 @@ struct perf_cpu_context {
|
|||
|
||||
struct perf_output_handle {
|
||||
struct perf_event *event;
|
||||
struct perf_buffer *buffer;
|
||||
struct ring_buffer *rb;
|
||||
unsigned long wakeup;
|
||||
unsigned long size;
|
||||
void *addr;
|
||||
int page;
|
||||
int nmi;
|
||||
int sample;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
|
|
@ -972,13 +955,15 @@ extern void perf_pmu_disable(struct pmu *pmu);
|
|||
extern void perf_pmu_enable(struct pmu *pmu);
|
||||
extern int perf_event_task_disable(void);
|
||||
extern int perf_event_task_enable(void);
|
||||
extern int perf_event_refresh(struct perf_event *event, int refresh);
|
||||
extern void perf_event_update_userpage(struct perf_event *event);
|
||||
extern int perf_event_release_kernel(struct perf_event *event);
|
||||
extern struct perf_event *
|
||||
perf_event_create_kernel_counter(struct perf_event_attr *attr,
|
||||
int cpu,
|
||||
struct task_struct *task,
|
||||
perf_overflow_handler_t callback);
|
||||
perf_overflow_handler_t callback,
|
||||
void *context);
|
||||
extern u64 perf_event_read_value(struct perf_event *event,
|
||||
u64 *enabled, u64 *running);
|
||||
|
||||
|
|
@ -1018,7 +1003,7 @@ extern void perf_prepare_sample(struct perf_event_header *header,
|
|||
struct perf_event *event,
|
||||
struct pt_regs *regs);
|
||||
|
||||
extern int perf_event_overflow(struct perf_event *event, int nmi,
|
||||
extern int perf_event_overflow(struct perf_event *event,
|
||||
struct perf_sample_data *data,
|
||||
struct pt_regs *regs);
|
||||
|
||||
|
|
@ -1037,7 +1022,7 @@ static inline int is_software_event(struct perf_event *event)
|
|||
|
||||
extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
|
||||
|
||||
extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64);
|
||||
extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
|
||||
|
||||
#ifndef perf_arch_fetch_caller_regs
|
||||
static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { }
|
||||
|
|
@ -1059,7 +1044,7 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs)
|
|||
}
|
||||
|
||||
static __always_inline void
|
||||
perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
|
||||
perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
|
||||
{
|
||||
struct pt_regs hot_regs;
|
||||
|
||||
|
|
@ -1068,7 +1053,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
|
|||
perf_fetch_caller_regs(&hot_regs);
|
||||
regs = &hot_regs;
|
||||
}
|
||||
__perf_sw_event(event_id, nr, nmi, regs, addr);
|
||||
__perf_sw_event(event_id, nr, regs, addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1082,7 +1067,7 @@ static inline void perf_event_task_sched_in(struct task_struct *task)
|
|||
|
||||
static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)
|
||||
{
|
||||
perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0);
|
||||
perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
|
||||
|
||||
__perf_event_task_sched_out(task, next);
|
||||
}
|
||||
|
|
@ -1143,8 +1128,7 @@ extern void perf_bp_event(struct perf_event *event, void *data);
|
|||
#endif
|
||||
|
||||
extern int perf_output_begin(struct perf_output_handle *handle,
|
||||
struct perf_event *event, unsigned int size,
|
||||
int nmi, int sample);
|
||||
struct perf_event *event, unsigned int size);
|
||||
extern void perf_output_end(struct perf_output_handle *handle);
|
||||
extern void perf_output_copy(struct perf_output_handle *handle,
|
||||
const void *buf, unsigned int len);
|
||||
|
|
@ -1166,10 +1150,13 @@ static inline void perf_event_delayed_put(struct task_struct *task) { }
|
|||
static inline void perf_event_print_debug(void) { }
|
||||
static inline int perf_event_task_disable(void) { return -EINVAL; }
|
||||
static inline int perf_event_task_enable(void) { return -EINVAL; }
|
||||
static inline int perf_event_refresh(struct perf_event *event, int refresh)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
perf_sw_event(u32 event_id, u64 nr, int nmi,
|
||||
struct pt_regs *regs, u64 addr) { }
|
||||
perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { }
|
||||
static inline void
|
||||
perf_bp_event(struct perf_event *event, void *data) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void ring_buffer_set_clock(struct ring_buffer *buffer,
|
|||
size_t ring_buffer_page_len(void *page);
|
||||
|
||||
|
||||
void *ring_buffer_alloc_read_page(struct ring_buffer *buffer);
|
||||
void *ring_buffer_alloc_read_page(struct ring_buffer *buffer, int cpu);
|
||||
void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
|
||||
int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page,
|
||||
size_t len, int cpu, int full);
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ struct stack_trace {
|
|||
};
|
||||
|
||||
extern void save_stack_trace(struct stack_trace *trace);
|
||||
extern void save_stack_trace_regs(struct stack_trace *trace,
|
||||
struct pt_regs *regs);
|
||||
extern void save_stack_trace_regs(struct pt_regs *regs,
|
||||
struct stack_trace *trace);
|
||||
extern void save_stack_trace_tsk(struct task_struct *tsk,
|
||||
struct stack_trace *trace);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue