diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace.h | 12 | ||||
-rw-r--r-- | include/linux/mm.h | 4 | ||||
-rw-r--r-- | include/linux/perf_event.h | 51 | ||||
-rw-r--r-- | include/linux/ptrace.h | 12 | ||||
-rw-r--r-- | include/linux/sched.h | 9 | ||||
-rw-r--r-- | include/trace/ftrace.h | 23 |
6 files changed, 61 insertions, 50 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 01e6adea07ec..cc12b3c556b3 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -504,18 +504,6 @@ extern int ftrace_dump_on_oops; | |||
504 | #define INIT_TRACE_RECURSION | 504 | #define INIT_TRACE_RECURSION |
505 | #endif | 505 | #endif |
506 | 506 | ||
507 | #ifdef CONFIG_HW_BRANCH_TRACER | ||
508 | |||
509 | void trace_hw_branch(u64 from, u64 to); | ||
510 | void trace_hw_branch_oops(void); | ||
511 | |||
512 | #else /* CONFIG_HW_BRANCH_TRACER */ | ||
513 | |||
514 | static inline void trace_hw_branch(u64 from, u64 to) {} | ||
515 | static inline void trace_hw_branch_oops(void) {} | ||
516 | |||
517 | #endif /* CONFIG_HW_BRANCH_TRACER */ | ||
518 | |||
519 | #ifdef CONFIG_FTRACE_SYSCALLS | 507 | #ifdef CONFIG_FTRACE_SYSCALLS |
520 | 508 | ||
521 | unsigned long arch_syscall_addr(int nr); | 509 | unsigned long arch_syscall_addr(int nr); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 462acaf36f3a..fb19bb92b809 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -19,7 +19,6 @@ struct anon_vma; | |||
19 | struct file_ra_state; | 19 | struct file_ra_state; |
20 | struct user_struct; | 20 | struct user_struct; |
21 | struct writeback_control; | 21 | struct writeback_control; |
22 | struct rlimit; | ||
23 | 22 | ||
24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 23 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
25 | extern unsigned long max_mapnr; | 24 | extern unsigned long max_mapnr; |
@@ -1449,9 +1448,6 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
1449 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1448 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1450 | void vmemmap_populate_print_last(void); | 1449 | void vmemmap_populate_print_last(void); |
1451 | 1450 | ||
1452 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | ||
1453 | size_t size); | ||
1454 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | ||
1455 | 1451 | ||
1456 | enum mf_flags { | 1452 | enum mf_flags { |
1457 | MF_COUNT_INCREASED = 1 << 0, | 1453 | MF_COUNT_INCREASED = 1 << 0, |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c8e375440403..ace31fbac513 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -203,8 +203,9 @@ struct perf_event_attr { | |||
203 | enable_on_exec : 1, /* next exec enables */ | 203 | enable_on_exec : 1, /* next exec enables */ |
204 | task : 1, /* trace fork/exit */ | 204 | task : 1, /* trace fork/exit */ |
205 | watermark : 1, /* wakeup_watermark */ | 205 | watermark : 1, /* wakeup_watermark */ |
206 | precise : 1, /* OoO invariant counter */ | ||
206 | 207 | ||
207 | __reserved_1 : 49; | 208 | __reserved_1 : 48; |
208 | 209 | ||
209 | union { | 210 | union { |
210 | __u32 wakeup_events; /* wakeup every n events */ | 211 | __u32 wakeup_events; /* wakeup every n events */ |
@@ -287,11 +288,19 @@ struct perf_event_mmap_page { | |||
287 | __u64 data_tail; /* user-space written tail */ | 288 | __u64 data_tail; /* user-space written tail */ |
288 | }; | 289 | }; |
289 | 290 | ||
290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 291 | #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) |
291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 292 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 293 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
293 | #define PERF_RECORD_MISC_USER (2 << 0) | 294 | #define PERF_RECORD_MISC_USER (2 << 0) |
294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 295 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
296 | #define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0) | ||
297 | #define PERF_RECORD_MISC_GUEST_USER (5 << 0) | ||
298 | |||
299 | #define PERF_RECORD_MISC_EXACT (1 << 14) | ||
300 | /* | ||
301 | * Reserve the last bit to indicate some extended misc field | ||
302 | */ | ||
303 | #define PERF_RECORD_MISC_EXT_RESERVED (1 << 15) | ||
295 | 304 | ||
296 | struct perf_event_header { | 305 | struct perf_event_header { |
297 | __u32 type; | 306 | __u32 type; |
@@ -439,6 +448,12 @@ enum perf_callchain_context { | |||
439 | # include <asm/perf_event.h> | 448 | # include <asm/perf_event.h> |
440 | #endif | 449 | #endif |
441 | 450 | ||
451 | struct perf_guest_info_callbacks { | ||
452 | int (*is_in_guest) (void); | ||
453 | int (*is_user_mode) (void); | ||
454 | unsigned long (*get_guest_ip) (void); | ||
455 | }; | ||
456 | |||
442 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 457 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
443 | #include <asm/hw_breakpoint.h> | 458 | #include <asm/hw_breakpoint.h> |
444 | #endif | 459 | #endif |
@@ -468,6 +483,17 @@ struct perf_raw_record { | |||
468 | void *data; | 483 | void *data; |
469 | }; | 484 | }; |
470 | 485 | ||
486 | struct perf_branch_entry { | ||
487 | __u64 from; | ||
488 | __u64 to; | ||
489 | __u64 flags; | ||
490 | }; | ||
491 | |||
492 | struct perf_branch_stack { | ||
493 | __u64 nr; | ||
494 | struct perf_branch_entry entries[0]; | ||
495 | }; | ||
496 | |||
471 | struct task_struct; | 497 | struct task_struct; |
472 | 498 | ||
473 | /** | 499 | /** |
@@ -571,6 +597,14 @@ enum perf_group_flag { | |||
571 | PERF_GROUP_SOFTWARE = 0x1, | 597 | PERF_GROUP_SOFTWARE = 0x1, |
572 | }; | 598 | }; |
573 | 599 | ||
600 | #define SWEVENT_HLIST_BITS 8 | ||
601 | #define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS) | ||
602 | |||
603 | struct swevent_hlist { | ||
604 | struct hlist_head heads[SWEVENT_HLIST_SIZE]; | ||
605 | struct rcu_head rcu_head; | ||
606 | }; | ||
607 | |||
574 | /** | 608 | /** |
575 | * struct perf_event - performance event kernel representation: | 609 | * struct perf_event - performance event kernel representation: |
576 | */ | 610 | */ |
@@ -579,6 +613,7 @@ struct perf_event { | |||
579 | struct list_head group_entry; | 613 | struct list_head group_entry; |
580 | struct list_head event_entry; | 614 | struct list_head event_entry; |
581 | struct list_head sibling_list; | 615 | struct list_head sibling_list; |
616 | struct hlist_node hlist_entry; | ||
582 | int nr_siblings; | 617 | int nr_siblings; |
583 | int group_flags; | 618 | int group_flags; |
584 | struct perf_event *group_leader; | 619 | struct perf_event *group_leader; |
@@ -726,6 +761,9 @@ struct perf_cpu_context { | |||
726 | int active_oncpu; | 761 | int active_oncpu; |
727 | int max_pertask; | 762 | int max_pertask; |
728 | int exclusive; | 763 | int exclusive; |
764 | struct swevent_hlist *swevent_hlist; | ||
765 | struct mutex hlist_mutex; | ||
766 | int hlist_refcount; | ||
729 | 767 | ||
730 | /* | 768 | /* |
731 | * Recursion avoidance: | 769 | * Recursion avoidance: |
@@ -902,6 +940,10 @@ static inline void perf_event_mmap(struct vm_area_struct *vma) | |||
902 | __perf_event_mmap(vma); | 940 | __perf_event_mmap(vma); |
903 | } | 941 | } |
904 | 942 | ||
943 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | ||
944 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | ||
945 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | ||
946 | |||
905 | extern void perf_event_comm(struct task_struct *tsk); | 947 | extern void perf_event_comm(struct task_struct *tsk); |
906 | extern void perf_event_fork(struct task_struct *tsk); | 948 | extern void perf_event_fork(struct task_struct *tsk); |
907 | 949 | ||
@@ -971,6 +1013,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, | |||
971 | static inline void | 1013 | static inline void |
972 | perf_bp_event(struct perf_event *event, void *data) { } | 1014 | perf_bp_event(struct perf_event *event, void *data) { } |
973 | 1015 | ||
1016 | static inline int perf_register_guest_info_callbacks | ||
1017 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | ||
1018 | static inline int perf_unregister_guest_info_callbacks | ||
1019 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | ||
1020 | |||
974 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 1021 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
975 | static inline void perf_event_comm(struct task_struct *tsk) { } | 1022 | static inline void perf_event_comm(struct task_struct *tsk) { } |
976 | static inline void perf_event_fork(struct task_struct *tsk) { } | 1023 | static inline void perf_event_fork(struct task_struct *tsk) { } |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index e1fb60729979..4272521e29e9 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -345,18 +345,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk, | |||
345 | #define arch_ptrace_stop(code, info) do { } while (0) | 345 | #define arch_ptrace_stop(code, info) do { } while (0) |
346 | #endif | 346 | #endif |
347 | 347 | ||
348 | #ifndef arch_ptrace_untrace | ||
349 | /* | ||
350 | * Do machine-specific work before untracing child. | ||
351 | * | ||
352 | * This is called for a normal detach as well as from ptrace_exit() | ||
353 | * when the tracing task dies. | ||
354 | * | ||
355 | * Called with write_lock(&tasklist_lock) held. | ||
356 | */ | ||
357 | #define arch_ptrace_untrace(task) do { } while (0) | ||
358 | #endif | ||
359 | |||
360 | extern int task_current_syscall(struct task_struct *target, long *callno, | 348 | extern int task_current_syscall(struct task_struct *target, long *callno, |
361 | unsigned long args[6], unsigned int maxargs, | 349 | unsigned long args[6], unsigned int maxargs, |
362 | unsigned long *sp, unsigned long *pc); | 350 | unsigned long *sp, unsigned long *pc); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dad7f668ebf7..e0447c64af6a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -99,7 +99,6 @@ struct futex_pi_state; | |||
99 | struct robust_list_head; | 99 | struct robust_list_head; |
100 | struct bio_list; | 100 | struct bio_list; |
101 | struct fs_struct; | 101 | struct fs_struct; |
102 | struct bts_context; | ||
103 | struct perf_event_context; | 102 | struct perf_event_context; |
104 | 103 | ||
105 | /* | 104 | /* |
@@ -1272,12 +1271,6 @@ struct task_struct { | |||
1272 | struct list_head ptraced; | 1271 | struct list_head ptraced; |
1273 | struct list_head ptrace_entry; | 1272 | struct list_head ptrace_entry; |
1274 | 1273 | ||
1275 | /* | ||
1276 | * This is the tracer handle for the ptrace BTS extension. | ||
1277 | * This field actually belongs to the ptracer task. | ||
1278 | */ | ||
1279 | struct bts_context *bts; | ||
1280 | |||
1281 | /* PID/PID hash table linkage. */ | 1274 | /* PID/PID hash table linkage. */ |
1282 | struct pid_link pids[PIDTYPE_MAX]; | 1275 | struct pid_link pids[PIDTYPE_MAX]; |
1283 | struct list_head thread_group; | 1276 | struct list_head thread_group; |
@@ -2123,10 +2116,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
2123 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2116 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2124 | 2117 | ||
2125 | #ifdef CONFIG_SMP | 2118 | #ifdef CONFIG_SMP |
2126 | extern void wait_task_context_switch(struct task_struct *p); | ||
2127 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2119 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
2128 | #else | 2120 | #else |
2129 | static inline void wait_task_context_switch(struct task_struct *p) {} | ||
2130 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2121 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
2131 | long match_state) | 2122 | long match_state) |
2132 | { | 2123 | { |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index ea6f9d4a20e9..882c64832ffe 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -758,13 +758,12 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
758 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 758 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
759 | static notrace void \ | 759 | static notrace void \ |
760 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | 760 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ |
761 | proto) \ | 761 | struct pt_regs *__regs, proto) \ |
762 | { \ | 762 | { \ |
763 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 763 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
764 | struct ftrace_raw_##call *entry; \ | 764 | struct ftrace_raw_##call *entry; \ |
765 | u64 __addr = 0, __count = 1; \ | 765 | u64 __addr = 0, __count = 1; \ |
766 | unsigned long irq_flags; \ | 766 | unsigned long irq_flags; \ |
767 | struct pt_regs *__regs; \ | ||
768 | int __entry_size; \ | 767 | int __entry_size; \ |
769 | int __data_size; \ | 768 | int __data_size; \ |
770 | int rctx; \ | 769 | int rctx; \ |
@@ -785,20 +784,22 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
785 | \ | 784 | \ |
786 | { assign; } \ | 785 | { assign; } \ |
787 | \ | 786 | \ |
788 | __regs = &__get_cpu_var(perf_trace_regs); \ | ||
789 | perf_fetch_caller_regs(__regs, 2); \ | ||
790 | \ | ||
791 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 787 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
792 | __count, irq_flags, __regs); \ | 788 | __count, irq_flags, __regs); \ |
793 | } | 789 | } |
794 | 790 | ||
795 | #undef DEFINE_EVENT | 791 | #undef DEFINE_EVENT |
796 | #define DEFINE_EVENT(template, call, proto, args) \ | 792 | #define DEFINE_EVENT(template, call, proto, args) \ |
797 | static notrace void perf_trace_##call(proto) \ | 793 | static notrace void perf_trace_##call(proto) \ |
798 | { \ | 794 | { \ |
799 | struct ftrace_event_call *event_call = &event_##call; \ | 795 | struct ftrace_event_call *event_call = &event_##call; \ |
800 | \ | 796 | struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \ |
801 | perf_trace_templ_##template(event_call, args); \ | 797 | \ |
798 | perf_fetch_caller_regs(__regs, 1); \ | ||
799 | \ | ||
800 | perf_trace_templ_##template(event_call, __regs, args); \ | ||
801 | \ | ||
802 | put_cpu_var(perf_trace_regs); \ | ||
802 | } | 803 | } |
803 | 804 | ||
804 | #undef DEFINE_EVENT_PRINT | 805 | #undef DEFINE_EVENT_PRINT |