forked from OpenCloudOS/perf-prof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
latency_helpers.h
28 lines (23 loc) · 914 Bytes
/
latency_helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __LATENCY_HELPERS
#define __LATENCY_HELPERS
struct latency_node {
struct rb_node rbnode;
u64 instance;
u64 key;
u64 min;
u64 max;
u64 n;
u64 sum;
u64 extra[0];
};
struct latency_dist;
struct latency_dist *latency_dist_new(bool perins, bool perkey, int extra_size);
void latency_dist_free(struct latency_dist *dist);
struct latency_node *latency_dist_input(struct latency_dist *dist, u64 instance, u64 key, u64 lat);
typedef void (*print_node)(void *opaque, struct latency_node *node);
void latency_dist_print(struct latency_dist *dist, print_node printnode, void *opaque);
void latency_dist_print_sorted(struct latency_dist *dist, print_node printnode, void *opaque);
struct latency_node *latency_dist_find(struct latency_dist *dist, u64 instance, u64 key);
bool latency_dist_empty(struct latency_dist *dist);
void latency_dist_reset(struct latency_dist *dist);
#endif