diff options
Diffstat (limited to 'tools/perf/util/stat.h')
-rw-r--r-- | tools/perf/util/stat.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 588367c3c767..ae8ccd7227cf 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h | |||
@@ -6,6 +6,7 @@ | |||
6 | struct stats | 6 | struct stats |
7 | { | 7 | { |
8 | double n, mean, M2; | 8 | double n, mean, M2; |
9 | u64 max, min; | ||
9 | }; | 10 | }; |
10 | 11 | ||
11 | void update_stats(struct stats *stats, u64 val); | 12 | void update_stats(struct stats *stats, u64 val); |
@@ -13,4 +14,12 @@ double avg_stats(struct stats *stats); | |||
13 | double stddev_stats(struct stats *stats); | 14 | double stddev_stats(struct stats *stats); |
14 | double rel_stddev_stats(double stddev, double avg); | 15 | double rel_stddev_stats(double stddev, double avg); |
15 | 16 | ||
17 | static inline void init_stats(struct stats *stats) | ||
18 | { | ||
19 | stats->n = 0.0; | ||
20 | stats->mean = 0.0; | ||
21 | stats->M2 = 0.0; | ||
22 | stats->min = (u64) -1; | ||
23 | stats->max = 0; | ||
24 | } | ||
16 | #endif | 25 | #endif |