Support packets in flight
[samplevnf.git] / VNFs / DPPD-PROX / stats_core.h
1 /*
2 // Copyright (c) 2010-2017 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_CORE_H_
18 #define _STATS_CORE_H_
19
20 #include <inttypes.h>
21
22 struct lcore_stats_sample {
23         uint64_t afreq;
24         uint64_t mfreq;
25         uint64_t mbm_tot_bytes;
26         uint64_t mbm_loc_bytes;
27 };
28
29 struct lcore_stats {
30         uint32_t lcore_id;
31         uint32_t socket_id;
32         uint64_t rmid;
33         uint64_t cmt_data;
34         uint64_t cmt_bytes;
35         uint64_t mbm_tot_bytes;
36         uint64_t mbm_loc_bytes;
37         uint64_t cmt_fraction;
38         uint32_t cat_mask;
39         uint64_t mbm_tot;
40         uint64_t mbm_loc;
41         uint32_t class;
42         struct lcore_stats_sample sample[2];
43 };
44
45 uint32_t stats_lcore_find_stat_id(uint32_t lcore_id);
46 int stats_get_n_lcore_stats(void);
47 struct lcore_stats *stats_get_lcore_stats(uint32_t stat_id);
48 struct lcore_stats_sample *stats_get_lcore_stats_sample(uint32_t stat_id, int last);
49 int stats_cpu_freq_enabled(void);
50 int stats_cmt_enabled(void);
51 int stats_cat_enabled(void);
52 int stats_mbm_enabled(void);
53 void stats_lcore_update(void);
54 void stats_lcore_init(void);
55 void stats_lcore_post_proc(void);
56 void stats_update_cache_mask(uint32_t lcore_id, uint32_t mask);
57 void stats_lcore_assoc_rmid(void);
58
59 #endif /* _STATS_CORE_H_ */