4 #include <linux/types.h>
14 enum perf_stat_evsel_id {
15 PERF_STAT_EVSEL_ID__NONE = 0,
16 PERF_STAT_EVSEL_ID__CYCLES_IN_TX,
17 PERF_STAT_EVSEL_ID__TRANSACTION_START,
18 PERF_STAT_EVSEL_ID__ELISION_START,
19 PERF_STAT_EVSEL_ID__CYCLES_IN_TX_CP,
20 PERF_STAT_EVSEL_ID__MAX,
24 struct stats res_stats[3];
25 enum perf_stat_evsel_id id;
35 struct perf_counts_values {
48 struct perf_counts_values aggr;
49 struct xyarray *values;
52 static inline struct perf_counts_values*
53 perf_counts(struct perf_counts *counts, int cpu, int thread)
55 return xyarray__entry(counts->values, cpu, thread);
58 void update_stats(struct stats *stats, u64 val);
59 double avg_stats(struct stats *stats);
60 double stddev_stats(struct stats *stats);
61 double rel_stddev_stats(double stddev, double avg);
63 static inline void init_stats(struct stats *stats)
68 stats->min = (u64) -1;
73 bool __perf_evsel_stat__is(struct perf_evsel *evsel,
74 enum perf_stat_evsel_id id);
76 #define perf_stat_evsel__is(evsel, id) \
77 __perf_evsel_stat__is(evsel, PERF_STAT_EVSEL_ID__ ## id)
79 void perf_stat_evsel_id_init(struct perf_evsel *evsel);
81 extern struct stats walltime_nsecs_stats;
83 void perf_stat__reset_shadow_stats(void);
84 void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count,
86 void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel,
87 double avg, int cpu, enum aggr_mode aggr);
89 struct perf_counts *perf_counts__new(int ncpus, int nthreads);
90 void perf_counts__delete(struct perf_counts *counts);
92 void perf_evsel__reset_counts(struct perf_evsel *evsel);
93 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads);
94 void perf_evsel__free_counts(struct perf_evsel *evsel);
96 void perf_evsel__reset_stat_priv(struct perf_evsel *evsel);
97 int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel);
98 void perf_evsel__free_stat_priv(struct perf_evsel *evsel);
100 int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
101 int ncpus, int nthreads);
102 void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel);