Fix linker errors with recent GNU ld
[samplevnf.git] / VNFs / DPPD-PROX / stats_latency.h
1 /*
2 // Copyright (c) 2010-2019 Intel Corporation
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 */
16
17 #ifndef _STATS_LATENCY_H_
18 #define _STATS_LATENCY_H_
19
20 #include <inttypes.h>
21
22 #include "handle_lat.h"
23
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;
29
30         struct time_unit accuracy_limit;
31         uint64_t         lost_packets;
32         uint64_t         mis_ordered;
33         uint64_t         extent;
34         uint64_t         duplicate;
35         uint64_t         tot_packets;
36         uint64_t         tot_all_packets;
37 };
38
39 uint32_t stats_latency_get_core_id(uint32_t i);
40 uint32_t stats_latency_get_task_id(uint32_t i);
41 struct stats_latency *stats_latency_get(uint32_t i);
42 uint64_t *stats_latency_get_bucket(uint32_t i);
43 uint64_t *stats_latency_get_tot_bucket(uint32_t i);
44 struct stats_latency *stats_latency_find(uint32_t lcore_id, uint32_t task_id);
45
46 struct stats_latency *stats_latency_tot_get(uint32_t i);
47 struct stats_latency *stats_latency_tot_find(uint32_t lcore_id, uint32_t task_id);
48
49 void stats_latency_init(void);
50 void stats_latency_update(void);
51 void stats_latency_reset(void);
52
53 int stats_get_n_latency(void);
54 int stats_get_latency_bucket_size(void);
55
56 #ifdef LATENCY_HISTOGRAM
57 void stats_core_lat_histogram(uint8_t lcore_id, uint8_t task_id, uint64_t **buckets);
58 #endif
59
60 #endif /* _STATS_LATENCY_H_ */