FD.io VPP  v17.07-30-g839fa73
Vector Packet Processing
stats.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 #ifndef __included_stats_h__
16 #define __included_stats_h__
17 
18 #include <time.h>
19 #include <vlib/vlib.h>
20 #include <vnet/vnet.h>
21 #include <vnet/interface.h>
22 #include <pthread.h>
23 #include <vlib/threads.h>
24 #include <vlib/unix/unix.h>
25 #include <vlibmemory/api.h>
28 
29 typedef struct
30 {
31  volatile u32 lock;
32  volatile u32 release_hint;
35  int tag;
37 
38 typedef struct
39 {
40  void *mheap;
41  pthread_t thread_self;
42  pthread_t thread_handle;
43 
46 
49 
50  /* control-plane data structure lock */
52 
53  /* bail out of FIB walk if set */
55 
56  /* convenience */
61 } stats_main_t;
62 
64 
65 void dslock (stats_main_t * sm, int release_hint, int tag);
66 void dsunlock (stats_main_t * sm);
67 
68 #endif /* __included_stats_h__ */
69 
70 /*
71  * fd.io coding-style-patch-verification: ON
72  *
73  * Local Variables:
74  * eval: (c-set-style "gnu")
75  * End:
76  */
pthread_t thread_handle
Definition: stats.h:42
stats_main_t stats_main
Definition: stats.h:63
u32 enable_poller
Definition: stats.h:45
vlib_main_t * vlib_main
Definition: stats.h:57
uword * stats_registration_hash
Definition: stats.h:47
vpe_client_registration_t * stats_registrations
Definition: stats.h:48
volatile u32 release_hint
Definition: stats.h:32
pthread_t thread_self
Definition: stats.h:41
volatile u32 lock
Definition: stats.h:31
void * mheap
Definition: stats.h:40
void dsunlock(stats_main_t *sm)
Definition: stats.c:101
clib_longjmp_t jmp_buf
Definition: stats.h:54
api_main_t * api_main
Definition: stats.h:60
void dslock(stats_main_t *sm, int release_hint, int tag)
Definition: stats.c:68
unsigned int u32
Definition: types.h:88
u32 stats_poll_interval_in_seconds
Definition: stats.h:44
u64 uword
Definition: types.h:112
data_structure_lock_t * data_structure_lock
Definition: stats.h:51
vnet_interface_main_t * interface_main
Definition: stats.h:59
vnet_main_t * vnet_main
Definition: stats.h:58