stats: convert error counters to normal counters
[vpp.git] / src / vlib / stats / shared.h
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright(c) 2022 Cisco Systems, Inc.
3  */
4
5 #ifndef included_stat_segment_shared_h
6 #define included_stat_segment_shared_h
7
8 typedef enum
9 {
10   STAT_DIR_TYPE_ILLEGAL = 0,
11   STAT_DIR_TYPE_SCALAR_INDEX,
12   STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE,
13   STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED,
14   STAT_DIR_TYPE_NAME_VECTOR,
15   STAT_DIR_TYPE_EMPTY,
16   STAT_DIR_TYPE_SYMLINK,
17 } stat_directory_type_t;
18
19 typedef struct
20 {
21   stat_directory_type_t type;
22   union
23   {
24     struct
25     {
26       uint32_t index1;
27       uint32_t index2;
28     };
29     uint64_t index;
30     uint64_t value;
31     void *data;
32     uint8_t **string_vector;
33   };
34 #define VLIB_STATS_MAX_NAME_SZ 128
35   char name[VLIB_STATS_MAX_NAME_SZ];
36 } vlib_stats_entry_t;
37
38 /*
39  * Shared header first in the shared memory segment.
40  */
41 typedef struct
42 {
43   uint64_t version;
44   void *base;
45   volatile uint64_t epoch;
46   volatile uint64_t in_progress;
47   volatile vlib_stats_entry_t *directory_vector;
48 } vlib_stats_shared_header_t;
49
50 #endif /* included_stat_segment_shared_h */