blob: 8e44ce3dc8615629eb1225023a19bf06db0cdd24 [file] [log] [blame]
Damjan Marion8973b072022-03-01 15:51:18 +01001/* 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
8typedef 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,
Damjan Marion8973b072022-03-01 15:51:18 +010014 STAT_DIR_TYPE_NAME_VECTOR,
15 STAT_DIR_TYPE_EMPTY,
16 STAT_DIR_TYPE_SYMLINK,
17} stat_directory_type_t;
18
19typedef 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 */
41typedef 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;
Damjan Marion8973b072022-03-01 15:51:18 +010048} vlib_stats_shared_header_t;
49
50#endif /* included_stat_segment_shared_h */