Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / tools / perf / util / stat.h
blob5667fc3e39cf45fe31f099e702a68eeeb202d16f
1 #ifndef __PERF_STATS_H
2 #define __PERF_STATS_H
4 #include <linux/types.h>
6 struct stats
8 double n, mean, M2;
9 u64 max, min;
12 void update_stats(struct stats *stats, u64 val);
13 double avg_stats(struct stats *stats);
14 double stddev_stats(struct stats *stats);
15 double rel_stddev_stats(double stddev, double avg);
17 static inline void init_stats(struct stats *stats)
19 stats->n = 0.0;
20 stats->mean = 0.0;
21 stats->M2 = 0.0;
22 stats->min = (u64) -1;
23 stats->max = 0;
25 #endif