FD.io VPP
v20.05.1-6-gf53edbc3b
Vector Packet Processing
stat_segment_shared.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Cisco and/or its affiliates.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
16
#ifndef included_stat_segment_shared_h
17
#define included_stat_segment_shared_h
18
19
typedef
enum
20
{
21
STAT_DIR_TYPE_ILLEGAL
= 0,
22
STAT_DIR_TYPE_SCALAR_INDEX
,
23
STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE
,
24
STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED
,
25
STAT_DIR_TYPE_ERROR_INDEX
,
26
STAT_DIR_TYPE_NAME_VECTOR
,
27
STAT_DIR_TYPE_EMPTY
,
28
}
stat_directory_type_t
;
29
30
typedef
struct
31
{
32
stat_directory_type_t
type
;
33
union
{
34
uint64_t
offset
;
35
uint64_t
index
;
36
uint64_t
value
;
37
};
38
uint64_t
offset_vector
;
39
char
name
[128];
// TODO change this to pointer to "somewhere"
40
}
stat_segment_directory_entry_t
;
41
42
/*
43
* Shared header first in the shared memory segment.
44
*/
45
typedef
struct
46
{
47
uint64_t
version
;
48
volatile
uint64_t
epoch
;
49
volatile
uint64_t
in_progress
;
50
volatile
uint64_t
directory_offset
;
51
volatile
uint64_t
error_offset
;
52
volatile
uint64_t
stats_offset
;
53
}
stat_segment_shared_header_t
;
54
55
static
inline
void
*
56
stat_segment_pointer
(
void
*start, uint64_t
offset
)
57
{
58
return
((
char
*) start + offset);
59
}
60
61
#endif
/* included_stat_segment_shared_h */
stat_segment_shared_header_t::in_progress
volatile uint64_t in_progress
Definition:
stat_segment_shared.h:49
stat_segment_directory_entry_t
Definition:
stat_segment_shared.h:30
stat_segment_directory_entry_t::index
uint64_t index
Definition:
stat_segment_shared.h:35
STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED
Definition:
stat_segment_shared.h:24
STAT_DIR_TYPE_NAME_VECTOR
Definition:
stat_segment_shared.h:26
STAT_DIR_TYPE_ERROR_INDEX
Definition:
stat_segment_shared.h:25
stat_segment_directory_entry_t::value
uint64_t value
Definition:
stat_segment_shared.h:36
stat_segment_pointer
static void * stat_segment_pointer(void *start, uint64_t offset)
Definition:
stat_segment_shared.h:56
stat_segment_shared_header_t::stats_offset
volatile uint64_t stats_offset
Definition:
stat_segment_shared.h:52
STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE
Definition:
stat_segment_shared.h:23
stat_segment_shared_header_t::directory_offset
volatile uint64_t directory_offset
Definition:
stat_segment_shared.h:50
stat_segment_shared_header_t::epoch
volatile uint64_t epoch
Definition:
stat_segment_shared.h:48
stat_directory_type_t
stat_directory_type_t
Definition:
stat_segment_shared.h:19
stat_segment_directory_entry_t::offset
uint64_t offset
Definition:
stat_segment_shared.h:34
STAT_DIR_TYPE_ILLEGAL
Definition:
stat_segment_shared.h:21
stat_segment_shared_header_t::version
uint64_t version
Definition:
stat_segment_shared.h:47
stat_segment_shared_header_t::error_offset
volatile uint64_t error_offset
Definition:
stat_segment_shared.h:51
STAT_DIR_TYPE_EMPTY
Definition:
stat_segment_shared.h:27
name
string name[64]
Definition:
ip.api:44
stat_segment_directory_entry_t::offset_vector
uint64_t offset_vector
Definition:
stat_segment_shared.h:38
clib_bihash_value
template key/value backing page structure
Definition:
bihash_doc.h:44
stat_segment_shared_header_t
Definition:
stat_segment_shared.h:45
STAT_DIR_TYPE_SCALAR_INDEX
Definition:
stat_segment_shared.h:22
stat_segment_directory_entry_t::type
stat_directory_type_t type
Definition:
stat_segment_shared.h:32
src
vpp
stats
stat_segment_shared.h
Generated on Mon Oct 12 2020 16:05:57 for FD.io VPP by
1.8.13