Code Coverage: vinyl-cache/lib/libvsc/VSC_mgt.c
 
82217aa4fc7094b3610340078afaf78cd95a8ec9
 
0
/*
1
 * NB:  This file is machine generated, DO NOT EDIT!
2
 *
3
 * Edit mgt.vsc and run lib/libvsc/vsctool.py instead.
4
 */
5
6
#include "config.h"
7
#include <stdio.h>
8
#include <stdarg.h>
9
#include "vdef.h"
10
#include "vas.h"
11
#include "vrt.h"
12
#include "VSC_mgt.h"
13
14
static const char vsc_mgt_name[] = "MGT";
15
16
#define PARANOIA(a,n)                           \
17
    v_static_assert(                            \
18
        offsetof(struct VSC_mgt, a) == n,       \
19
        "VSC element '" #a "' at wrong offset")
20
21
PARANOIA(uptime, 0);
22
PARANOIA(child_start, 8);
23
PARANOIA(child_exit, 16);
24
PARANOIA(child_stop, 24);
25
PARANOIA(child_died, 32);
26
PARANOIA(child_dump, 40);
27
PARANOIA(child_panic, 48);
28
#undef PARANOIA
29
30
static const unsigned char vsc_mgt_json[1679] = {
31
        123,34,118,101,114,115,105,111,110,34,58,34,49,34,44,34,110,97,109,101,
32
        34,58,34,109,103,116,34,44,34,111,110,101,108,105,110,101,114,34,58,
33
        34,77,97,110,97,103,101,109,101,110,116,32,80,114,111,99,101,115,115,
34
        32,67,111,117,110,116,101,114,115,34,44,34,111,114,100,101,114,34,58,
35
        50,48,44,34,100,111,99,115,34,58,34,34,44,34,101,108,101,109,101,110,
36
        116,115,34,58,55,44,34,101,108,101,109,34,58,123,34,117,112,116,105,
37
        109,101,34,58,123,34,116,121,112,101,34,58,34,99,111,117,110,116,101,
38
        114,34,44,34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,
39
        34,44,34,108,101,118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,
40
        101,108,105,110,101,114,34,58,34,77,97,110,97,103,101,109,101,110,116,
41
        32,112,114,111,99,101,115,115,32,117,112,116,105,109,101,34,44,34,102,
42
        111,114,109,97,116,34,58,34,100,117,114,97,116,105,111,110,34,44,34,
43
        105,110,100,101,120,34,58,48,44,34,110,97,109,101,34,58,34,117,112,116,
44
        105,109,101,34,44,34,100,111,99,115,34,58,34,92,116,85,112,116,105,109,
45
        101,32,105,110,32,115,101,99,111,110,100,115,32,111,102,32,116,104,101,
46
        32,109,97,110,97,103,101,109,101,110,116,32,112,114,111,99,101,115,115,
47
        34,125,44,34,99,104,105,108,100,95,115,116,97,114,116,34,58,123,34,116,
48
        121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,121,
49
        112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,
50
        108,34,58,34,100,105,97,103,34,44,34,111,110,101,108,105,110,101,114,
51
        34,58,34,67,104,105,108,100,32,112,114,111,99,101,115,115,32,115,116,
52
        97,114,116,101,100,34,44,34,102,111,114,109,97,116,34,58,34,105,110,
53
        116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,56,44,34,110,
54
        97,109,101,34,58,34,99,104,105,108,100,95,115,116,97,114,116,34,44,34,
55
        100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,102,32,116,
56
        105,109,101,115,32,116,104,101,32,99,104,105,108,100,32,112,114,111,
57
        99,101,115,115,32,104,97,115,32,98,101,101,110,32,115,116,97,114,116,
58
        101,100,34,125,44,34,99,104,105,108,100,95,101,120,105,116,34,58,123,
59
        34,116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,
60
        121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,
61
        101,108,34,58,34,100,105,97,103,34,44,34,111,110,101,108,105,110,101,
62
        114,34,58,34,67,104,105,108,100,32,112,114,111,99,101,115,115,32,110,
63
        111,114,109,97,108,32,101,120,105,116,34,44,34,102,111,114,109,97,116,
64
        34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,
65
        58,49,54,44,34,110,97,109,101,34,58,34,99,104,105,108,100,95,101,120,
66
        105,116,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,
67
        32,111,102,32,116,105,109,101,115,32,116,104,101,32,99,104,105,108,100,
68
        32,112,114,111,99,101,115,115,32,104,97,115,32,98,101,101,110,32,99,
69
        108,101,97,110,108,121,32,115,116,111,112,112,101,100,34,125,44,34,99,
70
        104,105,108,100,95,115,116,111,112,34,58,123,34,116,121,112,101,34,58,
71
        34,99,111,117,110,116,101,114,34,44,34,99,116,121,112,101,34,58,34,117,
72
        105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,100,105,
73
        97,103,34,44,34,111,110,101,108,105,110,101,114,34,58,34,67,104,105,
74
        108,100,32,112,114,111,99,101,115,115,32,117,110,101,120,112,101,99,
75
        116,101,100,32,101,120,105,116,34,44,34,102,111,114,109,97,116,34,58,
76
        34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,50,
77
        52,44,34,110,97,109,101,34,58,34,99,104,105,108,100,95,115,116,111,112,
78
        34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,
79
        102,32,116,105,109,101,115,32,116,104,101,32,99,104,105,108,100,32,112,
80
        114,111,99,101,115,115,32,104,97,115,32,101,120,105,116,101,100,32,119,
81
        105,116,104,32,97,110,92,110,92,116,117,110,101,120,112,101,99,116,101,
82
        100,32,114,101,116,117,114,110,32,99,111,100,101,34,125,44,34,99,104,
83
        105,108,100,95,100,105,101,100,34,58,123,34,116,121,112,101,34,58,34,
84
        99,111,117,110,116,101,114,34,44,34,99,116,121,112,101,34,58,34,117,
85
        105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,100,105,
86
        97,103,34,44,34,111,110,101,108,105,110,101,114,34,58,34,67,104,105,
87
        108,100,32,112,114,111,99,101,115,115,32,100,105,101,100,32,40,115,105,
88
        103,110,97,108,41,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,
89
        101,103,101,114,34,44,34,105,110,100,101,120,34,58,51,50,44,34,110,97,
90
        109,101,34,58,34,99,104,105,108,100,95,100,105,101,100,34,44,34,100,
91
        111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,102,32,116,105,
92
        109,101,115,32,116,104,101,32,99,104,105,108,100,32,112,114,111,99,101,
93
        115,115,32,104,97,115,32,100,105,101,100,32,100,117,101,32,116,111,32,
94
        115,105,103,110,97,108,115,34,125,44,34,99,104,105,108,100,95,100,117,
95
        109,112,34,58,123,34,116,121,112,101,34,58,34,99,111,117,110,116,101,
96
        114,34,44,34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,
97
        34,44,34,108,101,118,101,108,34,58,34,100,105,97,103,34,44,34,111,110,
98
        101,108,105,110,101,114,34,58,34,67,104,105,108,100,32,112,114,111,99,
99
        101,115,115,32,99,111,114,101,32,100,117,109,112,101,100,34,44,34,102,
100
        111,114,109,97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,
101
        110,100,101,120,34,58,52,48,44,34,110,97,109,101,34,58,34,99,104,105,
102
        108,100,95,100,117,109,112,34,44,34,100,111,99,115,34,58,34,92,116,78,
103
        117,109,98,101,114,32,111,102,32,116,105,109,101,115,32,116,104,101,
104
        32,99,104,105,108,100,32,112,114,111,99,101,115,115,32,104,97,115,32,
105
        112,114,111,100,117,99,101,100,32,99,111,114,101,32,100,117,109,112,
106
        115,34,125,44,34,99,104,105,108,100,95,112,97,110,105,99,34,58,123,34,
107
        116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,
108
        121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,
109
        101,108,34,58,34,100,105,97,103,34,44,34,111,110,101,108,105,110,101,
110
        114,34,58,34,67,104,105,108,100,32,112,114,111,99,101,115,115,32,112,
111
        97,110,105,99,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,101,
112
        103,101,114,34,44,34,105,110,100,101,120,34,58,52,56,44,34,110,97,109,
113
        101,34,58,34,99,104,105,108,100,95,112,97,110,105,99,34,44,34,100,111,
114
        99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,102,32,116,105,109,
115
        101,115,32,116,104,101,32,109,97,110,97,103,101,109,101,110,116,32,112,
116
        114,111,99,101,115,115,32,104,97,115,32,99,97,117,103,104,116,32,97,
117
        32,99,104,105,108,100,32,112,97,110,105,99,34,125,125,125,0
118
};
119
120
// {
121
//   "version": "1",
122
//   "name": "mgt",
123
//   "oneliner": "Management Process Counters",
124
//   "order": 20,
125
//   "docs": "",
126
//   "elements": 7,
127
//   "elem": {
128
//     "uptime": {
129
//       "type": "counter",
130
//       "ctype": "uint64_t",
131
//       "level": "info",
132
//       "oneliner": "Management process uptime",
133
//       "format": "duration",
134
//       "index": 0,
135
//       "name": "uptime",
136
//       "docs": "\tUptime in seconds of the management process"
137
//     },
138
//     "child_start": {
139
//       "type": "counter",
140
//       "ctype": "uint64_t",
141
//       "level": "diag",
142
//       "oneliner": "Child process started",
143
//       "format": "integer",
144
//       "index": 8,
145
//       "name": "child_start",
146
//       "docs": "\tNumber of times the child process has been started"
147
//     },
148
//     "child_exit": {
149
//       "type": "counter",
150
//       "ctype": "uint64_t",
151
//       "level": "diag",
152
//       "oneliner": "Child process normal exit",
153
//       "format": "integer",
154
//       "index": 16,
155
//       "name": "child_exit",
156
//       "docs": "\tNumber of times the child process has been cleanly s[...]
157
//     },
158
//     "child_stop": {
159
//       "type": "counter",
160
//       "ctype": "uint64_t",
161
//       "level": "diag",
162
//       "oneliner": "Child process unexpected exit",
163
//       "format": "integer",
164
//       "index": 24,
165
//       "name": "child_stop",
166
//       "docs": "\tNumber of times the child process has exited with an[...]
167
//     },
168
//     "child_died": {
169
//       "type": "counter",
170
//       "ctype": "uint64_t",
171
//       "level": "diag",
172
//       "oneliner": "Child process died (signal)",
173
//       "format": "integer",
174
//       "index": 32,
175
//       "name": "child_died",
176
//       "docs": "\tNumber of times the child process has died due to si[...]
177
//     },
178
//     "child_dump": {
179
//       "type": "counter",
180
//       "ctype": "uint64_t",
181
//       "level": "diag",
182
//       "oneliner": "Child process core dumped",
183
//       "format": "integer",
184
//       "index": 40,
185
//       "name": "child_dump",
186
//       "docs": "\tNumber of times the child process has produced core [...]
187
//     },
188
//     "child_panic": {
189
//       "type": "counter",
190
//       "ctype": "uint64_t",
191
//       "level": "diag",
192
//       "oneliner": "Child process panic",
193
//       "format": "integer",
194
//       "index": 48,
195
//       "name": "child_panic",
196
//       "docs": "\tNumber of times the management process has caught a [...]
197
//     }
198
//   }
199
// }
200
201
202
struct VSC_mgt*
203
VSC_mgt_New(struct vsmw_cluster *vc,
204
    struct vsc_seg **sg, const char *fmt, ...)
205 1038
{
206 1038
        va_list ap;
207 1038
        struct VSC_mgt *retval;
208
209 1038
        va_start(ap, fmt);
210 1038
        retval = VRT_VSC_Allocv(vc, sg, vsc_mgt_name, VSC_mgt_size,
211 1038
            vsc_mgt_json, sizeof vsc_mgt_json, fmt, ap);
212 1038
        va_end(ap);
213 1038
        return(retval);
214 1038
}
215
216
void
217
VSC_mgt_Destroy(struct vsc_seg **sg)
218 0
{
219 0
        struct vsc_seg *p;
220
221 0
        AN(sg);
222 0
        p = *sg;
223
        *sg = NULL;
224 0
        VRT_VSC_Destroy(vsc_mgt_name, p);
225 0
}