4 #include <linux/types.h>
13 enum perf_stat_evsel_id {
14 PERF_STAT_EVSEL_ID__NONE = 0,
15 PERF_STAT_EVSEL_ID__CYCLES_IN_TX,
16 PERF_STAT_EVSEL_ID__TRANSACTION_START,
17 PERF_STAT_EVSEL_ID__ELISION_START,
18 PERF_STAT_EVSEL_ID__CYCLES_IN_TX_CP,
19 PERF_STAT_EVSEL_ID__MAX,
23 struct stats res_stats[3];
24 enum perf_stat_evsel_id id;
34 void update_stats(struct stats *stats, u64 val);
35 double avg_stats(struct stats *stats);
36 double stddev_stats(struct stats *stats);
37 double rel_stddev_stats(double stddev, double avg);
39 static inline void init_stats(struct stats *stats)
44 stats->min = (u64) -1;
49 bool __perf_evsel_stat__is(struct perf_evsel *evsel,
50 enum perf_stat_evsel_id id);
52 #define perf_stat_evsel__is(evsel, id) \
53 __perf_evsel_stat__is(evsel, PERF_STAT_EVSEL_ID__ ## id)
55 void perf_stat_evsel_id_init(struct perf_evsel *evsel);
57 extern struct stats walltime_nsecs_stats;
59 void perf_stat__reset_shadow_stats(void);
60 void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count,
62 void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel,
63 double avg, int cpu, enum aggr_mode aggr);
65 struct perf_counts *perf_counts__new(int ncpus);
66 void perf_counts__delete(struct perf_counts *counts);
68 void perf_evsel__reset_counts(struct perf_evsel *evsel, int ncpus);
69 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus);
70 void perf_evsel__free_counts(struct perf_evsel *evsel);