2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef _STATS_LATENCY_H_
18 #define _STATS_LATENCY_H_
22 #include "handle_lat.h"
24 struct stats_latency {
25 struct time_unit_err avg;
26 struct time_unit_err min;
27 struct time_unit_err max;
28 struct time_unit_err stddev;
30 struct time_unit accuracy_limit;
31 uint64_t lost_packets;
33 uint64_t tot_all_packets;
36 uint32_t stats_latency_get_core_id(uint32_t i);
37 uint32_t stats_latency_get_task_id(uint32_t i);
38 struct stats_latency *stats_latency_get(uint32_t i);
39 struct stats_latency *stats_latency_find(uint32_t lcore_id, uint32_t task_id);
41 struct stats_latency *stats_latency_tot_get(uint32_t i);
42 struct stats_latency *stats_latency_tot_find(uint32_t lcore_id, uint32_t task_id);
44 void stats_latency_init(void);
45 void stats_latency_update(void);
46 void stats_latency_reset(void);
48 int stats_get_n_latency(void);
50 #ifdef LATENCY_HISTOGRAM
51 void stats_core_lat_histogram(uint8_t lcore_id, uint8_t task_id, uint64_t **buckets);
54 #endif /* _STATS_LATENCY_H_ */