aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h28
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 */
77struct perf_branch_entry { 80struct 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
121struct 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
520extern int perf_pmu_register(struct pmu *pmu, char *name, int type); 531extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
521extern void perf_pmu_unregister(struct pmu *pmu); 532extern void perf_pmu_unregister(struct pmu *pmu);
522 533
523extern int perf_num_counters(void); 534extern int perf_num_counters(void);
@@ -695,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64
695extern int sysctl_perf_event_paranoid; 706extern int sysctl_perf_event_paranoid;
696extern int sysctl_perf_event_mlock; 707extern int sysctl_perf_event_mlock;
697extern int sysctl_perf_event_sample_rate; 708extern int sysctl_perf_event_sample_rate;
709extern int sysctl_perf_cpu_time_max_percent;
710
711extern void perf_sample_event_took(u64 sample_len_ns);
698 712
699extern int perf_proc_update_handler(struct ctl_table *table, int write, 713extern 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);
716extern 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
703static inline bool perf_paranoid_tracepoint_raw(void) 721static 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);
743extern int perf_swevent_get_recursion_context(void); 761extern int perf_swevent_get_recursion_context(void);
744extern void perf_swevent_put_recursion_context(int rctx); 762extern void perf_swevent_put_recursion_context(int rctx);
763extern u64 perf_swevent_set_period(struct perf_event *event);
745extern void perf_event_enable(struct perf_event *event); 764extern void perf_event_enable(struct perf_event *event);
746extern void perf_event_disable(struct perf_event *event); 765extern void perf_event_disable(struct perf_event *event);
747extern int __perf_event_disable(void *info); 766extern int __perf_event_disable(void *info);
@@ -781,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { }
781static inline void perf_event_init(void) { } 800static inline void perf_event_init(void) { }
782static inline int perf_swevent_get_recursion_context(void) { return -1; } 801static inline int perf_swevent_get_recursion_context(void) { return -1; }
783static inline void perf_swevent_put_recursion_context(int rctx) { } 802static inline void perf_swevent_put_recursion_context(int rctx) { }
803static inline u64 perf_swevent_set_period(struct perf_event *event) { return 0; }
784static inline void perf_event_enable(struct perf_event *event) { } 804static inline void perf_event_enable(struct perf_event *event) { }
785static inline void perf_event_disable(struct perf_event *event) { } 805static inline void perf_event_disable(struct perf_event *event) { }
786static inline int __perf_event_disable(void *info) { return -1; } 806static inline int __perf_event_disable(void *info) { return -1; }