diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c5b6dbf9c2fc..50b3efd14d29 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -73,13 +73,18 @@ struct perf_raw_record { | |||
73 | * | 73 | * |
74 | * support for mispred, predicted is optional. In case it | 74 | * support for mispred, predicted is optional. In case it |
75 | * is not supported mispred = predicted = 0. | 75 | * is not supported mispred = predicted = 0. |
76 | * | ||
77 | * in_tx: running in a hardware transaction | ||
78 | * abort: aborting a hardware transaction | ||
76 | */ | 79 | */ |
77 | struct perf_branch_entry { | 80 | struct perf_branch_entry { |
78 | __u64 from; | 81 | __u64 from; |
79 | __u64 to; | 82 | __u64 to; |
80 | __u64 mispred:1, /* target mispredicted */ | 83 | __u64 mispred:1, /* target mispredicted */ |
81 | predicted:1,/* target predicted */ | 84 | predicted:1,/* target predicted */ |
82 | reserved:62; | 85 | in_tx:1, /* in transaction */ |
86 | abort:1, /* transaction abort */ | ||
87 | reserved:60; | ||
83 | }; | 88 | }; |
84 | 89 | ||
85 | /* | 90 | /* |
@@ -113,6 +118,8 @@ struct hw_perf_event_extra { | |||
113 | int idx; /* index in shared_regs->regs[] */ | 118 | int idx; /* index in shared_regs->regs[] */ |
114 | }; | 119 | }; |
115 | 120 | ||
121 | struct event_constraint; | ||
122 | |||
116 | /** | 123 | /** |
117 | * struct hw_perf_event - performance event hardware details: | 124 | * struct hw_perf_event - performance event hardware details: |
118 | */ | 125 | */ |
@@ -131,6 +138,8 @@ struct hw_perf_event { | |||
131 | 138 | ||
132 | struct hw_perf_event_extra extra_reg; | 139 | struct hw_perf_event_extra extra_reg; |
133 | struct hw_perf_event_extra branch_reg; | 140 | struct hw_perf_event_extra branch_reg; |
141 | |||
142 | struct event_constraint *constraint; | ||
134 | }; | 143 | }; |
135 | struct { /* software */ | 144 | struct { /* software */ |
136 | struct hrtimer hrtimer; | 145 | struct hrtimer hrtimer; |
@@ -188,12 +197,13 @@ struct pmu { | |||
188 | 197 | ||
189 | struct device *dev; | 198 | struct device *dev; |
190 | const struct attribute_group **attr_groups; | 199 | const struct attribute_group **attr_groups; |
191 | char *name; | 200 | const char *name; |
192 | int type; | 201 | int type; |
193 | 202 | ||
194 | int * __percpu pmu_disable_count; | 203 | int * __percpu pmu_disable_count; |
195 | struct perf_cpu_context * __percpu pmu_cpu_context; | 204 | struct perf_cpu_context * __percpu pmu_cpu_context; |
196 | int task_ctx_nr; | 205 | int task_ctx_nr; |
206 | int hrtimer_interval_ms; | ||
197 | 207 | ||
198 | /* | 208 | /* |
199 | * Fully disable/enable this PMU, can be used to protect from the PMI | 209 | * Fully disable/enable this PMU, can be used to protect from the PMI |
@@ -500,8 +510,9 @@ struct perf_cpu_context { | |||
500 | struct perf_event_context *task_ctx; | 510 | struct perf_event_context *task_ctx; |
501 | int active_oncpu; | 511 | int active_oncpu; |
502 | int exclusive; | 512 | int exclusive; |
513 | struct hrtimer hrtimer; | ||
514 | ktime_t hrtimer_interval; | ||
503 | struct list_head rotation_list; | 515 | struct list_head rotation_list; |
504 | int jiffies_interval; | ||
505 | struct pmu *unique_pmu; | 516 | struct pmu *unique_pmu; |
506 | struct perf_cgroup *cgrp; | 517 | struct perf_cgroup *cgrp; |
507 | }; | 518 | }; |
@@ -517,7 +528,7 @@ struct perf_output_handle { | |||
517 | 528 | ||
518 | #ifdef CONFIG_PERF_EVENTS | 529 | #ifdef CONFIG_PERF_EVENTS |
519 | 530 | ||
520 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); | 531 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); |
521 | extern void perf_pmu_unregister(struct pmu *pmu); | 532 | extern void perf_pmu_unregister(struct pmu *pmu); |
522 | 533 | ||
523 | extern int perf_num_counters(void); | 534 | extern int perf_num_counters(void); |
@@ -695,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 | |||
695 | extern int sysctl_perf_event_paranoid; | 706 | extern int sysctl_perf_event_paranoid; |
696 | extern int sysctl_perf_event_mlock; | 707 | extern int sysctl_perf_event_mlock; |
697 | extern int sysctl_perf_event_sample_rate; | 708 | extern int sysctl_perf_event_sample_rate; |
709 | extern int sysctl_perf_cpu_time_max_percent; | ||
710 | |||
711 | extern void perf_sample_event_took(u64 sample_len_ns); | ||
698 | 712 | ||
699 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | 713 | extern int perf_proc_update_handler(struct ctl_table *table, int write, |
700 | void __user *buffer, size_t *lenp, | 714 | void __user *buffer, size_t *lenp, |
701 | loff_t *ppos); | 715 | loff_t *ppos); |
716 | extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, | ||
717 | void __user *buffer, size_t *lenp, | ||
718 | loff_t *ppos); | ||
719 | |||
702 | 720 | ||
703 | static inline bool perf_paranoid_tracepoint_raw(void) | 721 | static inline bool perf_paranoid_tracepoint_raw(void) |
704 | { | 722 | { |
@@ -742,6 +760,7 @@ extern unsigned int perf_output_skip(struct perf_output_handle *handle, | |||
742 | unsigned int len); | 760 | unsigned int len); |
743 | extern int perf_swevent_get_recursion_context(void); | 761 | extern int perf_swevent_get_recursion_context(void); |
744 | extern void perf_swevent_put_recursion_context(int rctx); | 762 | extern void perf_swevent_put_recursion_context(int rctx); |
763 | extern u64 perf_swevent_set_period(struct perf_event *event); | ||
745 | extern void perf_event_enable(struct perf_event *event); | 764 | extern void perf_event_enable(struct perf_event *event); |
746 | extern void perf_event_disable(struct perf_event *event); | 765 | extern void perf_event_disable(struct perf_event *event); |
747 | extern int __perf_event_disable(void *info); | 766 | extern int __perf_event_disable(void *info); |
@@ -781,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
781 | static inline void perf_event_init(void) { } | 800 | static inline void perf_event_init(void) { } |
782 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 801 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
783 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 802 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
803 | static inline u64 perf_swevent_set_period(struct perf_event *event) { return 0; } | ||
784 | static inline void perf_event_enable(struct perf_event *event) { } | 804 | static inline void perf_event_enable(struct perf_event *event) { } |
785 | static inline void perf_event_disable(struct perf_event *event) { } | 805 | static inline void perf_event_disable(struct perf_event *event) { } |
786 | static inline int __perf_event_disable(void *info) { return -1; } | 806 | static inline int __perf_event_disable(void *info) { return -1; } |