aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 10:41:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 10:41:01 -0400
commite0972916e8fe943f342b0dd1c9d43dbf5bc261c2 (patch)
tree690c436f1f9b839c4ba34d17ab3efa63b97a2dce /include/linux
parent1f889ec62c3f0d8913f3c32f9aff2a1e15099346 (diff)
parent5ac2b5c2721501a8f5c5e1cd4116cbc31ace6886 (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar: "Features: - Add "uretprobes" - an optimization to uprobes, like kretprobes are an optimization to kprobes. "perf probe -x file sym%return" now works like kretprobes. By Oleg Nesterov. - Introduce per core aggregation in 'perf stat', from Stephane Eranian. - Add memory profiling via PEBS, from Stephane Eranian. - Event group view for 'annotate' in --stdio, --tui and --gtk, from Namhyung Kim. - Add support for AMD NB and L2I "uncore" counters, by Jacob Shin. - Add Ivy Bridge-EP uncore support, by Zheng Yan - IBM zEnterprise EC12 oprofile support patchlet from Robert Richter. - Add perf test entries for checking breakpoint overflow signal handler issues, from Jiri Olsa. - Add perf test entry for for checking number of EXIT events, from Namhyung Kim. - Add perf test entries for checking --cpu in record and stat, from Jiri Olsa. - Introduce perf stat --repeat forever, from Frederik Deweerdt. - Add --no-demangle to report/top, from Namhyung Kim. - PowerPC fixes plus a couple of cleanups/optimizations in uprobes and trace_uprobes, by Oleg Nesterov. Various fixes and refactorings: - Fix dependency of the python binding wrt libtraceevent, from Naohiro Aota. - Simplify some perf_evlist methods and to allow 'stat' to share code with 'record' and 'trace', by Arnaldo Carvalho de Melo. - Remove dead code in related to libtraceevent integration, from Namhyung Kim. - Revert "perf sched: Handle PERF_RECORD_EXIT events" to get 'perf sched lat' back working, by Arnaldo Carvalho de Melo - We don't use Newt anymore, just plain libslang, by Arnaldo Carvalho de Melo. - Kill a bunch of die() calls, from Namhyung Kim. - Fix build on non-glibc systems due to libio.h absence, from Cody P Schafer. - Remove some perf_session and tracing dead code, from David Ahern. - Honor parallel jobs, fix from Borislav Petkov - Introduce tools/lib/lk library, initially just removing duplication among tools/perf and tools/vm. from Borislav Petkov ... and many more I missed to list, see the shortlog and git log for more details." * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (136 commits) perf/x86/intel/P4: Robistify P4 PMU types perf/x86/amd: Fix AMD NB and L2I "uncore" support perf/x86/amd: Remove old-style NB counter support from perf_event_amd.c perf/x86: Check all MSRs before passing hw check perf/x86/amd: Add support for AMD NB and L2I "uncore" counters perf/x86/intel: Add Ivy Bridge-EP uncore support perf/x86/intel: Fix SNB-EP CBO and PCU uncore PMU filter management perf/x86: Avoid kfree() in CPU_{STARTING,DYING} uprobes/perf: Avoid perf_trace_buf_prepare/submit if ->perf_events is empty uprobes/tracing: Don't pass addr=ip to perf_trace_buf_submit() uprobes/tracing: Change create_trace_uprobe() to support uretprobes uprobes/tracing: Make seq_printf() code uretprobe-friendly uprobes/tracing: Make register_uprobe_event() paths uretprobe-friendly uprobes/tracing: Make uprobe_{trace,perf}_print() uretprobe-friendly uprobes/tracing: Introduce is_ret_probe() and uretprobe_dispatcher() uprobes/tracing: Introduce uprobe_{trace,perf}_print() helpers uprobes/tracing: Generalize struct uprobe_trace_entry_head uprobes/tracing: Kill the pointless local_save_flags/preempt_count calls uprobes/tracing: Kill the pointless seq_print_ip_sym() call uprobes/tracing: Kill the pointless task_pt_regs() calls ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler.h6
-rw-r--r--include/linux/kprobes.h6
-rw-r--r--include/linux/perf_event.h24
-rw-r--r--include/linux/uprobes.h8
4 files changed, 22 insertions, 22 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 10b8f23fab0f..92669cd182a6 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -351,4 +351,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
351 */ 351 */
352#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) 352#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
353 353
354/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
355#ifdef CONFIG_KPROBES
356# define __kprobes __attribute__((__section__(".kprobes.text")))
357#else
358# define __kprobes
359#endif
354#endif /* __LINUX_COMPILER_H */ 360#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 4b6ef4d33cc2..ca1d27a0d6a6 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -29,6 +29,7 @@
29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi 29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
30 * <prasanna@in.ibm.com> added function-return probes. 30 * <prasanna@in.ibm.com> added function-return probes.
31 */ 31 */
32#include <linux/compiler.h> /* for __kprobes */
32#include <linux/linkage.h> 33#include <linux/linkage.h>
33#include <linux/list.h> 34#include <linux/list.h>
34#include <linux/notifier.h> 35#include <linux/notifier.h>
@@ -49,16 +50,11 @@
49#define KPROBE_REENTER 0x00000004 50#define KPROBE_REENTER 0x00000004
50#define KPROBE_HIT_SSDONE 0x00000008 51#define KPROBE_HIT_SSDONE 0x00000008
51 52
52/* Attach to insert probes on any functions which should be ignored*/
53#define __kprobes __attribute__((__section__(".kprobes.text")))
54
55#else /* CONFIG_KPROBES */ 53#else /* CONFIG_KPROBES */
56typedef int kprobe_opcode_t; 54typedef int kprobe_opcode_t;
57struct arch_specific_insn { 55struct arch_specific_insn {
58 int dummy; 56 int dummy;
59}; 57};
60#define __kprobes
61
62#endif /* CONFIG_KPROBES */ 58#endif /* CONFIG_KPROBES */
63 59
64struct kprobe; 60struct kprobe;
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1d795df6f4cf..e0373d26c244 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -21,7 +21,6 @@
21 */ 21 */
22 22
23#ifdef CONFIG_PERF_EVENTS 23#ifdef CONFIG_PERF_EVENTS
24# include <linux/cgroup.h>
25# include <asm/perf_event.h> 24# include <asm/perf_event.h>
26# include <asm/local64.h> 25# include <asm/local64.h>
27#endif 26#endif
@@ -128,6 +127,7 @@ struct hw_perf_event {
128 int event_base_rdpmc; 127 int event_base_rdpmc;
129 int idx; 128 int idx;
130 int last_cpu; 129 int last_cpu;
130 int flags;
131 131
132 struct hw_perf_event_extra extra_reg; 132 struct hw_perf_event_extra extra_reg;
133 struct hw_perf_event_extra branch_reg; 133 struct hw_perf_event_extra branch_reg;
@@ -299,22 +299,7 @@ struct swevent_hlist {
299#define PERF_ATTACH_GROUP 0x02 299#define PERF_ATTACH_GROUP 0x02
300#define PERF_ATTACH_TASK 0x04 300#define PERF_ATTACH_TASK 0x04
301 301
302#ifdef CONFIG_CGROUP_PERF 302struct perf_cgroup;
303/*
304 * perf_cgroup_info keeps track of time_enabled for a cgroup.
305 * This is a per-cpu dynamically allocated data structure.
306 */
307struct perf_cgroup_info {
308 u64 time;
309 u64 timestamp;
310};
311
312struct perf_cgroup {
313 struct cgroup_subsys_state css;
314 struct perf_cgroup_info *info; /* timing info, one per cpu */
315};
316#endif
317
318struct ring_buffer; 303struct ring_buffer;
319 304
320/** 305/**
@@ -583,11 +568,13 @@ struct perf_sample_data {
583 u32 reserved; 568 u32 reserved;
584 } cpu_entry; 569 } cpu_entry;
585 u64 period; 570 u64 period;
571 union perf_mem_data_src data_src;
586 struct perf_callchain_entry *callchain; 572 struct perf_callchain_entry *callchain;
587 struct perf_raw_record *raw; 573 struct perf_raw_record *raw;
588 struct perf_branch_stack *br_stack; 574 struct perf_branch_stack *br_stack;
589 struct perf_regs_user regs_user; 575 struct perf_regs_user regs_user;
590 u64 stack_user_size; 576 u64 stack_user_size;
577 u64 weight;
591}; 578};
592 579
593static inline void perf_sample_data_init(struct perf_sample_data *data, 580static inline void perf_sample_data_init(struct perf_sample_data *data,
@@ -601,6 +588,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
601 data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; 588 data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE;
602 data->regs_user.regs = NULL; 589 data->regs_user.regs = NULL;
603 data->stack_user_size = 0; 590 data->stack_user_size = 0;
591 data->weight = 0;
592 data->data_src.val = 0;
604} 593}
605 594
606extern void perf_output_sample(struct perf_output_handle *handle, 595extern void perf_output_sample(struct perf_output_handle *handle,
@@ -831,6 +820,7 @@ do { \
831struct perf_pmu_events_attr { 820struct perf_pmu_events_attr {
832 struct device_attribute attr; 821 struct device_attribute attr;
833 u64 id; 822 u64 id;
823 const char *event_str;
834}; 824};
835 825
836#define PMU_EVENT_ATTR(_name, _var, _id, _show) \ 826#define PMU_EVENT_ATTR(_name, _var, _id, _show) \
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 02b83db8e2c5..06f28beed7c2 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -38,6 +38,8 @@ struct inode;
38#define UPROBE_HANDLER_REMOVE 1 38#define UPROBE_HANDLER_REMOVE 1
39#define UPROBE_HANDLER_MASK 1 39#define UPROBE_HANDLER_MASK 1
40 40
41#define MAX_URETPROBE_DEPTH 64
42
41enum uprobe_filter_ctx { 43enum uprobe_filter_ctx {
42 UPROBE_FILTER_REGISTER, 44 UPROBE_FILTER_REGISTER,
43 UPROBE_FILTER_UNREGISTER, 45 UPROBE_FILTER_UNREGISTER,
@@ -46,6 +48,9 @@ enum uprobe_filter_ctx {
46 48
47struct uprobe_consumer { 49struct uprobe_consumer {
48 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); 50 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
51 int (*ret_handler)(struct uprobe_consumer *self,
52 unsigned long func,
53 struct pt_regs *regs);
49 bool (*filter)(struct uprobe_consumer *self, 54 bool (*filter)(struct uprobe_consumer *self,
50 enum uprobe_filter_ctx ctx, 55 enum uprobe_filter_ctx ctx,
51 struct mm_struct *mm); 56 struct mm_struct *mm);
@@ -68,6 +73,8 @@ struct uprobe_task {
68 enum uprobe_task_state state; 73 enum uprobe_task_state state;
69 struct arch_uprobe_task autask; 74 struct arch_uprobe_task autask;
70 75
76 struct return_instance *return_instances;
77 unsigned int depth;
71 struct uprobe *active_uprobe; 78 struct uprobe *active_uprobe;
72 79
73 unsigned long xol_vaddr; 80 unsigned long xol_vaddr;
@@ -100,6 +107,7 @@ struct uprobes_state {
100extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); 107extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
101extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); 108extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
102extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); 109extern bool __weak is_swbp_insn(uprobe_opcode_t *insn);
110extern bool __weak is_trap_insn(uprobe_opcode_t *insn);
103extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 111extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
104extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); 112extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool);
105extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 113extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);