FD.io VPP
v18.01-8-g0eacf49
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
cj.h
Go to the documentation of this file.
1
/*
2
*------------------------------------------------------------------
3
* cj.h
4
*
5
* Copyright (c) 2013 Cisco and/or its affiliates.
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at:
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*------------------------------------------------------------------
18
*/
19
20
#ifndef __included_cj_h__
21
#define __included_cj_h__
22
23
typedef
struct
24
{
25
f64
time
;
26
u32
thread_index
;
27
u32
type
;
28
u64
data[2];
29
}
cj_record_t
;
30
31
typedef
struct
32
{
33
volatile
u64
tail
;
34
cj_record_t
*
records
;
35
u32
num_records
;
36
volatile
u32
enable
;
37
38
vlib_main_t
*
vlib_main
;
39
}
cj_main_t
;
40
41
void
cj_log
(
u32
type,
void
*data0,
void
*data1);
42
43
/*
44
* Supply in application main, so we can log from any library...
45
* Declare a weak reference in the library, off you go.
46
*/
47
48
#define DECLARE_CJ_GLOBAL_LOG \
49
void cj_global_log (unsigned type, void * data0, void * data1) \
50
__attribute__ ((weak)); \
51
\
52
unsigned __cj_type; \
53
void * __cj_data0; \
54
void * __cj_data1; \
55
\
56
void \
57
cj_global_log (unsigned type, void * data0, void * data1) \
58
{ \
59
__cj_type = type; \
60
__cj_data0 = data0; \
61
__cj_data1 = data1; \
62
}
63
64
#define CJ_GLOBAL_LOG_PROTOTYPE
65
void
66
cj_global_log
(
unsigned
type,
void
*data0,
void
*data1)
67
__attribute__ ((weak));
68
69
void
cj_stop
(
void
);
70
71
#endif
/* __included_cj_h__ */
72
73
/*
74
* fd.io coding-style-patch-verification: ON
75
*
76
* Local Variables:
77
* eval: (c-set-style "gnu")
78
* End:
79
*/
cj_stop
void cj_stop(void)
Definition:
cj.c:58
cj_main_t
Definition:
cj.h:31
cj_main_t::enable
volatile u32 enable
Definition:
cj.h:36
cj_main_t::tail
volatile u64 tail
Definition:
cj.h:33
cj_record_t::time
f64 time
Definition:
cj.h:25
u64
unsigned long u64
Definition:
types.h:89
cj_record_t::thread_index
u32 thread_index
Definition:
cj.h:26
cj_log
void cj_log(u32 type, void *data0, void *data1)
Definition:
cj.c:38
cj_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
cj.h:38
u32
unsigned int u32
Definition:
types.h:88
cj_global_log
void cj_global_log(unsigned type, void *data0, void *data1)
cj_record_t
Definition:
cj.h:23
cj_record_t::type
u32 type
Definition:
cj.h:27
f64
double f64
Definition:
types.h:142
vlib_main_t
Definition:
main.h:59
cj_main_t::num_records
u32 num_records
Definition:
cj.h:35
cj_main_t::records
cj_record_t * records
Definition:
cj.h:34
src
vlib
unix
cj.h
Generated on Wed Feb 7 2018 04:45:47 for FD.io VPP by
1.8.11