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;
36 struct perf_counts_values {
49 struct perf_counts_values aggr;
50 struct xyarray *values;
53 static inline struct perf_counts_values*
54 perf_counts(struct perf_counts *counts, int cpu, int thread)
56 return xyarray__entry(counts->values, cpu, thread);
59 void update_stats(struct stats *stats, u64 val);
60 double avg_stats(struct stats *stats);
61 double stddev_stats(struct stats *stats);
62 double rel_stddev_stats(double stddev, double avg);
64 static inline void init_stats(struct stats *stats)
69 stats->min = (u64) -1;
76 bool __perf_evsel_stat__is(struct perf_evsel *evsel,
77 enum perf_stat_evsel_id id);
79 #define perf_stat_evsel__is(evsel, id) \
80 __perf_evsel_stat__is(evsel, PERF_STAT_EVSEL_ID__ ## id)
82 void perf_stat_evsel_id_init(struct perf_evsel *evsel);
84 extern struct stats walltime_nsecs_stats;
86 void perf_stat__reset_shadow_stats(void);
87 void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count,
89 void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel,
90 double avg, int cpu, enum aggr_mode aggr);
92 struct perf_counts *perf_counts__new(int ncpus, int nthreads);
93 void perf_counts__delete(struct perf_counts *counts);
95 void perf_evsel__reset_counts(struct perf_evsel *evsel);
96 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads);
97 void perf_evsel__free_counts(struct perf_evsel *evsel);
99 void perf_evsel__reset_stat_priv(struct perf_evsel *evsel);
100 int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel);
101 void perf_evsel__free_stat_priv(struct perf_evsel *evsel);
103 int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
104 int ncpus, int nthreads);
105 void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel);
107 int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw);
109 int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw);
110 void perf_evlist__free_stats(struct perf_evlist *evlist);
111 void perf_evlist__reset_stats(struct perf_evlist *evlist);