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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef included_stat_segment_shared_h
17 #define included_stat_segment_shared_h
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_directory_type_t;
31 stat_directory_type_t type;
37 uint64_t offset_vector;
38 char name[128]; // TODO change this to pointer to "somewhere"
39 } stat_segment_directory_entry_t;
42 * Shared header first in the shared memory segment.
47 volatile uint64_t epoch;
48 volatile uint64_t in_progress;
49 volatile uint64_t directory_offset;
50 volatile uint64_t error_offset;
51 volatile uint64_t stats_offset;
52 } stat_segment_shared_header_t;
55 stat_segment_pointer (void *start, uint64_t offset)
57 return ((char *) start + offset);
60 #endif /* included_stat_segment_shared_h */