diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ftrace_event.h | 8 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 8 | ||||
| -rw-r--r-- | include/linux/percpu.h | 9 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 155 | ||||
| -rw-r--r-- | include/linux/sched.h | 9 |
5 files changed, 128 insertions, 61 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 02b8b24f8f51..8beabb958f61 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -191,8 +191,8 @@ struct ftrace_event_call { | |||
| 191 | unsigned int flags; | 191 | unsigned int flags; |
| 192 | 192 | ||
| 193 | #ifdef CONFIG_PERF_EVENTS | 193 | #ifdef CONFIG_PERF_EVENTS |
| 194 | int perf_refcount; | 194 | int perf_refcount; |
| 195 | struct hlist_head *perf_events; | 195 | struct hlist_head __percpu *perf_events; |
| 196 | #endif | 196 | #endif |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| @@ -252,8 +252,8 @@ DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); | |||
| 252 | 252 | ||
| 253 | extern int perf_trace_init(struct perf_event *event); | 253 | extern int perf_trace_init(struct perf_event *event); |
| 254 | extern void perf_trace_destroy(struct perf_event *event); | 254 | extern void perf_trace_destroy(struct perf_event *event); |
| 255 | extern int perf_trace_enable(struct perf_event *event); | 255 | extern int perf_trace_add(struct perf_event *event, int flags); |
| 256 | extern void perf_trace_disable(struct perf_event *event); | 256 | extern void perf_trace_del(struct perf_event *event, int flags); |
| 257 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 257 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, |
| 258 | char *filter_str); | 258 | char *filter_str); |
| 259 | extern void ftrace_profile_free_filter(struct perf_event *event); | 259 | extern void ftrace_profile_free_filter(struct perf_event *event); |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a0384a4d1e6f..531495db1708 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
| 19 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
| 20 | #include <asm/system.h> | 20 | #include <asm/system.h> |
| 21 | #include <trace/events/irq.h> | ||
| 21 | 22 | ||
| 22 | /* | 23 | /* |
| 23 | * These correspond to the IORESOURCE_IRQ_* defines in | 24 | * These correspond to the IORESOURCE_IRQ_* defines in |
| @@ -407,7 +408,12 @@ asmlinkage void do_softirq(void); | |||
| 407 | asmlinkage void __do_softirq(void); | 408 | asmlinkage void __do_softirq(void); |
| 408 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); | 409 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); |
| 409 | extern void softirq_init(void); | 410 | extern void softirq_init(void); |
| 410 | #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) | 411 | static inline void __raise_softirq_irqoff(unsigned int nr) |
| 412 | { | ||
| 413 | trace_softirq_raise((struct softirq_action *)(unsigned long)nr, NULL); | ||
| 414 | or_softirq_pending(1UL << nr); | ||
| 415 | } | ||
| 416 | |||
| 411 | extern void raise_softirq_irqoff(unsigned int nr); | 417 | extern void raise_softirq_irqoff(unsigned int nr); |
| 412 | extern void raise_softirq(unsigned int nr); | 418 | extern void raise_softirq(unsigned int nr); |
| 413 | extern void wakeup_softirqd(void); | 419 | extern void wakeup_softirqd(void); |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 49466b13c5c6..0eb50832aa00 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -39,6 +39,15 @@ | |||
| 39 | preempt_enable(); \ | 39 | preempt_enable(); \ |
| 40 | } while (0) | 40 | } while (0) |
| 41 | 41 | ||
| 42 | #define get_cpu_ptr(var) ({ \ | ||
| 43 | preempt_disable(); \ | ||
| 44 | this_cpu_ptr(var); }) | ||
| 45 | |||
| 46 | #define put_cpu_ptr(var) do { \ | ||
| 47 | (void)(var); \ | ||
| 48 | preempt_enable(); \ | ||
| 49 | } while (0) | ||
| 50 | |||
| 42 | #ifdef CONFIG_SMP | 51 | #ifdef CONFIG_SMP |
| 43 | 52 | ||
| 44 | /* minimum unit size, also is the maximum supported allocation size */ | 53 | /* minimum unit size, also is the maximum supported allocation size */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 716f99b682c1..61b1e2d760fd 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -529,7 +529,6 @@ struct hw_perf_event { | |||
| 529 | int last_cpu; | 529 | int last_cpu; |
| 530 | }; | 530 | }; |
| 531 | struct { /* software */ | 531 | struct { /* software */ |
| 532 | s64 remaining; | ||
| 533 | struct hrtimer hrtimer; | 532 | struct hrtimer hrtimer; |
| 534 | }; | 533 | }; |
| 535 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 534 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| @@ -539,6 +538,7 @@ struct hw_perf_event { | |||
| 539 | }; | 538 | }; |
| 540 | #endif | 539 | #endif |
| 541 | }; | 540 | }; |
| 541 | int state; | ||
| 542 | local64_t prev_count; | 542 | local64_t prev_count; |
| 543 | u64 sample_period; | 543 | u64 sample_period; |
| 544 | u64 last_period; | 544 | u64 last_period; |
| @@ -550,6 +550,13 @@ struct hw_perf_event { | |||
| 550 | #endif | 550 | #endif |
| 551 | }; | 551 | }; |
| 552 | 552 | ||
| 553 | /* | ||
| 554 | * hw_perf_event::state flags | ||
| 555 | */ | ||
| 556 | #define PERF_HES_STOPPED 0x01 /* the counter is stopped */ | ||
| 557 | #define PERF_HES_UPTODATE 0x02 /* event->count up-to-date */ | ||
| 558 | #define PERF_HES_ARCH 0x04 | ||
| 559 | |||
| 553 | struct perf_event; | 560 | struct perf_event; |
| 554 | 561 | ||
| 555 | /* | 562 | /* |
| @@ -561,36 +568,70 @@ struct perf_event; | |||
| 561 | * struct pmu - generic performance monitoring unit | 568 | * struct pmu - generic performance monitoring unit |
| 562 | */ | 569 | */ |
| 563 | struct pmu { | 570 | struct pmu { |
| 564 | int (*enable) (struct perf_event *event); | 571 | struct list_head entry; |
| 565 | void (*disable) (struct perf_event *event); | 572 | |
| 566 | int (*start) (struct perf_event *event); | 573 | int * __percpu pmu_disable_count; |
| 567 | void (*stop) (struct perf_event *event); | 574 | struct perf_cpu_context * __percpu pmu_cpu_context; |
| 568 | void (*read) (struct perf_event *event); | 575 | int task_ctx_nr; |
| 569 | void (*unthrottle) (struct perf_event *event); | ||
| 570 | 576 | ||
| 571 | /* | 577 | /* |
| 572 | * Group events scheduling is treated as a transaction, add group | 578 | * Fully disable/enable this PMU, can be used to protect from the PMI |
| 573 | * events as a whole and perform one schedulability test. If the test | 579 | * as well as for lazy/batch writing of the MSRs. |
| 574 | * fails, roll back the whole group | ||
| 575 | */ | 580 | */ |
| 581 | void (*pmu_enable) (struct pmu *pmu); /* optional */ | ||
| 582 | void (*pmu_disable) (struct pmu *pmu); /* optional */ | ||
| 576 | 583 | ||
| 577 | /* | 584 | /* |
| 578 | * Start the transaction, after this ->enable() doesn't need | 585 | * Try and initialize the event for this PMU. |
| 579 | * to do schedulability tests. | 586 | * Should return -ENOENT when the @event doesn't match this PMU. |
| 580 | */ | 587 | */ |
| 581 | void (*start_txn) (const struct pmu *pmu); | 588 | int (*event_init) (struct perf_event *event); |
| 589 | |||
| 590 | #define PERF_EF_START 0x01 /* start the counter when adding */ | ||
| 591 | #define PERF_EF_RELOAD 0x02 /* reload the counter when starting */ | ||
| 592 | #define PERF_EF_UPDATE 0x04 /* update the counter when stopping */ | ||
| 593 | |||
| 582 | /* | 594 | /* |
| 583 | * If ->start_txn() disabled the ->enable() schedulability test | 595 | * Adds/Removes a counter to/from the PMU, can be done inside |
| 596 | * a transaction, see the ->*_txn() methods. | ||
| 597 | */ | ||
| 598 | int (*add) (struct perf_event *event, int flags); | ||
| 599 | void (*del) (struct perf_event *event, int flags); | ||
| 600 | |||
| 601 | /* | ||
| 602 | * Starts/Stops a counter present on the PMU. The PMI handler | ||
| 603 | * should stop the counter when perf_event_overflow() returns | ||
| 604 | * !0. ->start() will be used to continue. | ||
| 605 | */ | ||
| 606 | void (*start) (struct perf_event *event, int flags); | ||
| 607 | void (*stop) (struct perf_event *event, int flags); | ||
| 608 | |||
| 609 | /* | ||
| 610 | * Updates the counter value of the event. | ||
| 611 | */ | ||
| 612 | void (*read) (struct perf_event *event); | ||
| 613 | |||
| 614 | /* | ||
| 615 | * Group events scheduling is treated as a transaction, add | ||
| 616 | * group events as a whole and perform one schedulability test. | ||
| 617 | * If the test fails, roll back the whole group | ||
| 618 | * | ||
| 619 | * Start the transaction, after this ->add() doesn't need to | ||
| 620 | * do schedulability tests. | ||
| 621 | */ | ||
| 622 | void (*start_txn) (struct pmu *pmu); /* optional */ | ||
| 623 | /* | ||
| 624 | * If ->start_txn() disabled the ->add() schedulability test | ||
| 584 | * then ->commit_txn() is required to perform one. On success | 625 | * then ->commit_txn() is required to perform one. On success |
| 585 | * the transaction is closed. On error the transaction is kept | 626 | * the transaction is closed. On error the transaction is kept |
| 586 | * open until ->cancel_txn() is called. | 627 | * open until ->cancel_txn() is called. |
| 587 | */ | 628 | */ |
| 588 | int (*commit_txn) (const struct pmu *pmu); | 629 | int (*commit_txn) (struct pmu *pmu); /* optional */ |
| 589 | /* | 630 | /* |
| 590 | * Will cancel the transaction, assumes ->disable() is called for | 631 | * Will cancel the transaction, assumes ->del() is called |
| 591 | * each successfull ->enable() during the transaction. | 632 | * for each successfull ->add() during the transaction. |
| 592 | */ | 633 | */ |
| 593 | void (*cancel_txn) (const struct pmu *pmu); | 634 | void (*cancel_txn) (struct pmu *pmu); /* optional */ |
| 594 | }; | 635 | }; |
| 595 | 636 | ||
| 596 | /** | 637 | /** |
| @@ -669,7 +710,7 @@ struct perf_event { | |||
| 669 | int nr_siblings; | 710 | int nr_siblings; |
| 670 | int group_flags; | 711 | int group_flags; |
| 671 | struct perf_event *group_leader; | 712 | struct perf_event *group_leader; |
| 672 | const struct pmu *pmu; | 713 | struct pmu *pmu; |
| 673 | 714 | ||
| 674 | enum perf_event_active_state state; | 715 | enum perf_event_active_state state; |
| 675 | unsigned int attach_state; | 716 | unsigned int attach_state; |
| @@ -763,12 +804,19 @@ struct perf_event { | |||
| 763 | #endif /* CONFIG_PERF_EVENTS */ | 804 | #endif /* CONFIG_PERF_EVENTS */ |
| 764 | }; | 805 | }; |
| 765 | 806 | ||
| 807 | enum perf_event_context_type { | ||
| 808 | task_context, | ||
| 809 | cpu_context, | ||
| 810 | }; | ||
| 811 | |||
| 766 | /** | 812 | /** |
| 767 | * struct perf_event_context - event context structure | 813 | * struct perf_event_context - event context structure |
| 768 | * | 814 | * |
| 769 | * Used as a container for task events and CPU events as well: | 815 | * Used as a container for task events and CPU events as well: |
| 770 | */ | 816 | */ |
| 771 | struct perf_event_context { | 817 | struct perf_event_context { |
| 818 | enum perf_event_context_type type; | ||
| 819 | struct pmu *pmu; | ||
| 772 | /* | 820 | /* |
| 773 | * Protect the states of the events in the list, | 821 | * Protect the states of the events in the list, |
| 774 | * nr_active, and the list: | 822 | * nr_active, and the list: |
| @@ -808,6 +856,12 @@ struct perf_event_context { | |||
| 808 | struct rcu_head rcu_head; | 856 | struct rcu_head rcu_head; |
| 809 | }; | 857 | }; |
| 810 | 858 | ||
| 859 | /* | ||
| 860 | * Number of contexts where an event can trigger: | ||
| 861 | * task, softirq, hardirq, nmi. | ||
| 862 | */ | ||
| 863 | #define PERF_NR_CONTEXTS 4 | ||
| 864 | |||
| 811 | /** | 865 | /** |
| 812 | * struct perf_event_cpu_context - per cpu event context structure | 866 | * struct perf_event_cpu_context - per cpu event context structure |
| 813 | */ | 867 | */ |
| @@ -815,18 +869,9 @@ struct perf_cpu_context { | |||
| 815 | struct perf_event_context ctx; | 869 | struct perf_event_context ctx; |
| 816 | struct perf_event_context *task_ctx; | 870 | struct perf_event_context *task_ctx; |
| 817 | int active_oncpu; | 871 | int active_oncpu; |
| 818 | int max_pertask; | ||
| 819 | int exclusive; | 872 | int exclusive; |
| 820 | struct swevent_hlist *swevent_hlist; | 873 | struct list_head rotation_list; |
| 821 | struct mutex hlist_mutex; | 874 | int jiffies_interval; |
| 822 | int hlist_refcount; | ||
| 823 | |||
| 824 | /* | ||
| 825 | * Recursion avoidance: | ||
| 826 | * | ||
| 827 | * task, softirq, irq, nmi context | ||
| 828 | */ | ||
| 829 | int recursion[4]; | ||
| 830 | }; | 875 | }; |
| 831 | 876 | ||
| 832 | struct perf_output_handle { | 877 | struct perf_output_handle { |
| @@ -842,26 +887,20 @@ struct perf_output_handle { | |||
| 842 | 887 | ||
| 843 | #ifdef CONFIG_PERF_EVENTS | 888 | #ifdef CONFIG_PERF_EVENTS |
| 844 | 889 | ||
| 845 | /* | 890 | extern int perf_pmu_register(struct pmu *pmu); |
| 846 | * Set by architecture code: | 891 | extern void perf_pmu_unregister(struct pmu *pmu); |
| 847 | */ | ||
| 848 | extern int perf_max_events; | ||
| 849 | |||
| 850 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); | ||
| 851 | 892 | ||
| 852 | extern void perf_event_task_sched_in(struct task_struct *task); | 893 | extern void perf_event_task_sched_in(struct task_struct *task); |
| 853 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); | 894 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
| 854 | extern void perf_event_task_tick(struct task_struct *task); | ||
| 855 | extern int perf_event_init_task(struct task_struct *child); | 895 | extern int perf_event_init_task(struct task_struct *child); |
| 856 | extern void perf_event_exit_task(struct task_struct *child); | 896 | extern void perf_event_exit_task(struct task_struct *child); |
| 857 | extern void perf_event_free_task(struct task_struct *task); | 897 | extern void perf_event_free_task(struct task_struct *task); |
| 898 | extern void perf_event_delayed_put(struct task_struct *task); | ||
| 858 | extern void set_perf_event_pending(void); | 899 | extern void set_perf_event_pending(void); |
| 859 | extern void perf_event_do_pending(void); | 900 | extern void perf_event_do_pending(void); |
| 860 | extern void perf_event_print_debug(void); | 901 | extern void perf_event_print_debug(void); |
| 861 | extern void __perf_disable(void); | 902 | extern void perf_pmu_disable(struct pmu *pmu); |
| 862 | extern bool __perf_enable(void); | 903 | extern void perf_pmu_enable(struct pmu *pmu); |
| 863 | extern void perf_disable(void); | ||
| 864 | extern void perf_enable(void); | ||
| 865 | extern int perf_event_task_disable(void); | 904 | extern int perf_event_task_disable(void); |
| 866 | extern int perf_event_task_enable(void); | 905 | extern int perf_event_task_enable(void); |
| 867 | extern void perf_event_update_userpage(struct perf_event *event); | 906 | extern void perf_event_update_userpage(struct perf_event *event); |
| @@ -869,7 +908,7 @@ extern int perf_event_release_kernel(struct perf_event *event); | |||
| 869 | extern struct perf_event * | 908 | extern struct perf_event * |
| 870 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | 909 | perf_event_create_kernel_counter(struct perf_event_attr *attr, |
| 871 | int cpu, | 910 | int cpu, |
| 872 | pid_t pid, | 911 | struct task_struct *task, |
| 873 | perf_overflow_handler_t callback); | 912 | perf_overflow_handler_t callback); |
| 874 | extern u64 perf_event_read_value(struct perf_event *event, | 913 | extern u64 perf_event_read_value(struct perf_event *event, |
| 875 | u64 *enabled, u64 *running); | 914 | u64 *enabled, u64 *running); |
| @@ -920,14 +959,7 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
| 920 | */ | 959 | */ |
| 921 | static inline int is_software_event(struct perf_event *event) | 960 | static inline int is_software_event(struct perf_event *event) |
| 922 | { | 961 | { |
| 923 | switch (event->attr.type) { | 962 | return event->pmu->task_ctx_nr == perf_sw_context; |
| 924 | case PERF_TYPE_SOFTWARE: | ||
| 925 | case PERF_TYPE_TRACEPOINT: | ||
| 926 | /* for now the breakpoint stuff also works as software event */ | ||
| 927 | case PERF_TYPE_BREAKPOINT: | ||
| 928 | return 1; | ||
| 929 | } | ||
| 930 | return 0; | ||
| 931 | } | 963 | } |
| 932 | 964 | ||
| 933 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 965 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
| @@ -976,7 +1008,21 @@ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks | |||
| 976 | extern void perf_event_comm(struct task_struct *tsk); | 1008 | extern void perf_event_comm(struct task_struct *tsk); |
| 977 | extern void perf_event_fork(struct task_struct *tsk); | 1009 | extern void perf_event_fork(struct task_struct *tsk); |
| 978 | 1010 | ||
| 979 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | 1011 | /* Callchains */ |
| 1012 | DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry); | ||
| 1013 | |||
| 1014 | extern void perf_callchain_user(struct perf_callchain_entry *entry, | ||
| 1015 | struct pt_regs *regs); | ||
| 1016 | extern void perf_callchain_kernel(struct perf_callchain_entry *entry, | ||
| 1017 | struct pt_regs *regs); | ||
| 1018 | |||
| 1019 | |||
| 1020 | static inline void | ||
| 1021 | perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) | ||
| 1022 | { | ||
| 1023 | if (entry->nr < PERF_MAX_STACK_DEPTH) | ||
| 1024 | entry->ip[entry->nr++] = ip; | ||
| 1025 | } | ||
| 980 | 1026 | ||
| 981 | extern int sysctl_perf_event_paranoid; | 1027 | extern int sysctl_perf_event_paranoid; |
| 982 | extern int sysctl_perf_event_mlock; | 1028 | extern int sysctl_perf_event_mlock; |
| @@ -1019,21 +1065,19 @@ extern int perf_swevent_get_recursion_context(void); | |||
| 1019 | extern void perf_swevent_put_recursion_context(int rctx); | 1065 | extern void perf_swevent_put_recursion_context(int rctx); |
| 1020 | extern void perf_event_enable(struct perf_event *event); | 1066 | extern void perf_event_enable(struct perf_event *event); |
| 1021 | extern void perf_event_disable(struct perf_event *event); | 1067 | extern void perf_event_disable(struct perf_event *event); |
| 1068 | extern void perf_event_task_tick(void); | ||
| 1022 | #else | 1069 | #else |
| 1023 | static inline void | 1070 | static inline void |
| 1024 | perf_event_task_sched_in(struct task_struct *task) { } | 1071 | perf_event_task_sched_in(struct task_struct *task) { } |
| 1025 | static inline void | 1072 | static inline void |
| 1026 | perf_event_task_sched_out(struct task_struct *task, | 1073 | perf_event_task_sched_out(struct task_struct *task, |
| 1027 | struct task_struct *next) { } | 1074 | struct task_struct *next) { } |
| 1028 | static inline void | ||
| 1029 | perf_event_task_tick(struct task_struct *task) { } | ||
| 1030 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 1075 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
| 1031 | static inline void perf_event_exit_task(struct task_struct *child) { } | 1076 | static inline void perf_event_exit_task(struct task_struct *child) { } |
| 1032 | static inline void perf_event_free_task(struct task_struct *task) { } | 1077 | static inline void perf_event_free_task(struct task_struct *task) { } |
| 1078 | static inline void perf_event_delayed_put(struct task_struct *task) { } | ||
| 1033 | static inline void perf_event_do_pending(void) { } | 1079 | static inline void perf_event_do_pending(void) { } |
| 1034 | static inline void perf_event_print_debug(void) { } | 1080 | static inline void perf_event_print_debug(void) { } |
| 1035 | static inline void perf_disable(void) { } | ||
| 1036 | static inline void perf_enable(void) { } | ||
| 1037 | static inline int perf_event_task_disable(void) { return -EINVAL; } | 1081 | static inline int perf_event_task_disable(void) { return -EINVAL; } |
| 1038 | static inline int perf_event_task_enable(void) { return -EINVAL; } | 1082 | static inline int perf_event_task_enable(void) { return -EINVAL; } |
| 1039 | 1083 | ||
| @@ -1056,6 +1100,7 @@ static inline int perf_swevent_get_recursion_context(void) { return -1; } | |||
| 1056 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 1100 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 1057 | static inline void perf_event_enable(struct perf_event *event) { } | 1101 | static inline void perf_event_enable(struct perf_event *event) { } |
| 1058 | static inline void perf_event_disable(struct perf_event *event) { } | 1102 | static inline void perf_event_disable(struct perf_event *event) { } |
| 1103 | static inline void perf_event_task_tick(void) { } | ||
| 1059 | #endif | 1104 | #endif |
| 1060 | 1105 | ||
| 1061 | #define perf_output_put(handle, x) \ | 1106 | #define perf_output_put(handle, x) \ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1e2a6db2d7dd..eb3c1ceec06e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1160,6 +1160,13 @@ struct sched_rt_entity { | |||
| 1160 | 1160 | ||
| 1161 | struct rcu_node; | 1161 | struct rcu_node; |
| 1162 | 1162 | ||
| 1163 | enum perf_event_task_context { | ||
| 1164 | perf_invalid_context = -1, | ||
| 1165 | perf_hw_context = 0, | ||
| 1166 | perf_sw_context, | ||
| 1167 | perf_nr_task_contexts, | ||
| 1168 | }; | ||
| 1169 | |||
| 1163 | struct task_struct { | 1170 | struct task_struct { |
| 1164 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 1171 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
| 1165 | void *stack; | 1172 | void *stack; |
| @@ -1431,7 +1438,7 @@ struct task_struct { | |||
| 1431 | struct futex_pi_state *pi_state_cache; | 1438 | struct futex_pi_state *pi_state_cache; |
| 1432 | #endif | 1439 | #endif |
| 1433 | #ifdef CONFIG_PERF_EVENTS | 1440 | #ifdef CONFIG_PERF_EVENTS |
| 1434 | struct perf_event_context *perf_event_ctxp; | 1441 | struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts]; |
| 1435 | struct mutex perf_event_mutex; | 1442 | struct mutex perf_event_mutex; |
| 1436 | struct list_head perf_event_list; | 1443 | struct list_head perf_event_list; |
| 1437 | #endif | 1444 | #endif |
