Code Coverage: vinyl-cache/lib/libvsc/VSC_smf.c
 
82217aa4fc7094b3610340078afaf78cd95a8ec9
 
0
/*
1
 * NB:  This file is machine generated, DO NOT EDIT!
2
 *
3
 * Edit smf.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_smf.h"
13
14
static const char vsc_smf_name[] = "SMF";
15
16
#define PARANOIA(a,n)                           \
17
    v_static_assert(                            \
18
        offsetof(struct VSC_smf, a) == n,       \
19
        "VSC element '" #a "' at wrong offset")
20
21
PARANOIA(c_req, 0);
22
PARANOIA(c_fail, 8);
23
PARANOIA(c_bytes, 16);
24
PARANOIA(c_freed, 24);
25
PARANOIA(g_alloc, 32);
26
PARANOIA(g_bytes, 40);
27
PARANOIA(g_space, 48);
28
PARANOIA(g_smf, 56);
29
PARANOIA(g_smf_frag, 64);
30
PARANOIA(g_smf_large, 72);
31
#undef PARANOIA
32
33
static const unsigned char vsc_smf_json[1963] = {
34
        123,34,118,101,114,115,105,111,110,34,58,34,49,34,44,34,110,97,109,101,
35
        34,58,34,115,109,102,34,44,34,111,110,101,108,105,110,101,114,34,58,
36
        34,70,105,108,101,32,83,116,101,118,101,100,111,114,101,32,67,111,117,
37
        110,116,101,114,115,34,44,34,111,114,100,101,114,34,58,53,48,44,34,100,
38
        111,99,115,34,58,34,34,44,34,101,108,101,109,101,110,116,115,34,58,49,
39
        48,44,34,101,108,101,109,34,58,123,34,99,95,114,101,113,34,58,123,34,
40
        116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,
41
        121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,
42
        101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,
43
        114,34,58,34,65,108,108,111,99,97,116,111,114,32,114,101,113,117,101,
44
        115,116,115,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,101,
45
        103,101,114,34,44,34,105,110,100,101,120,34,58,48,44,34,110,97,109,101,
46
        34,58,34,99,95,114,101,113,34,44,34,100,111,99,115,34,58,34,92,116,78,
47
        117,109,98,101,114,32,111,102,32,116,105,109,101,115,32,116,104,101,
48
        32,115,116,111,114,97,103,101,32,104,97,115,32,98,101,101,110,32,97,
49
        115,107,101,100,32,116,111,32,112,114,111,118,105,100,101,32,97,32,115,
50
        116,111,114,97,103,101,32,115,101,103,109,101,110,116,46,34,125,44,34,
51
        99,95,102,97,105,108,34,58,123,34,116,121,112,101,34,58,34,99,111,117,
52
        110,116,101,114,34,44,34,99,116,121,112,101,34,58,34,117,105,110,116,
53
        54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,105,110,102,111,34,
54
        44,34,111,110,101,108,105,110,101,114,34,58,34,65,108,108,111,99,97,
55
        116,111,114,32,102,97,105,108,117,114,101,115,34,44,34,102,111,114,109,
56
        97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,
57
        120,34,58,56,44,34,110,97,109,101,34,58,34,99,95,102,97,105,108,34,44,
58
        34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,102,32,
59
        116,105,109,101,115,32,116,104,101,32,115,116,111,114,97,103,101,32,
60
        104,97,115,32,102,97,105,108,101,100,32,116,111,32,112,114,111,118,105,
61
        100,101,32,97,32,115,116,111,114,97,103,101,32,115,101,103,109,101,110,
62
        116,46,34,125,44,34,99,95,98,121,116,101,115,34,58,123,34,116,121,112,
63
        101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,121,112,101,
64
        34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,
65
        58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,114,34,58,
66
        34,66,121,116,101,115,32,97,108,108,111,99,97,116,101,100,34,44,34,102,
67
        111,114,109,97,116,34,58,34,98,121,116,101,115,34,44,34,105,110,100,
68
        101,120,34,58,49,54,44,34,110,97,109,101,34,58,34,99,95,98,121,116,101,
69
        115,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,
70
        111,102,32,116,111,116,97,108,32,98,121,116,101,115,32,97,108,108,111,
71
        99,97,116,101,100,32,98,121,32,116,104,105,115,32,115,116,111,114,97,
72
        103,101,46,34,125,44,34,99,95,102,114,101,101,100,34,58,123,34,116,121,
73
        112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116,121,112,
74
        101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,
75
        34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,114,34,
76
        58,34,66,121,116,101,115,32,102,114,101,101,100,34,44,34,102,111,114,
77
        109,97,116,34,58,34,98,121,116,101,115,34,44,34,105,110,100,101,120,
78
        34,58,50,52,44,34,110,97,109,101,34,58,34,99,95,102,114,101,101,100,
79
        34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,
80
        102,32,116,111,116,97,108,32,98,121,116,101,115,32,114,101,116,117,114,
81
        110,101,100,32,116,111,32,116,104,105,115,32,115,116,111,114,97,103,
82
        101,46,34,125,44,34,103,95,97,108,108,111,99,34,58,123,34,116,121,112,
83
        101,34,58,34,103,97,117,103,101,34,44,34,99,116,121,112,101,34,58,34,
84
        117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,105,
85
        110,102,111,34,44,34,111,110,101,108,105,110,101,114,34,58,34,65,108,
86
        108,111,99,97,116,105,111,110,115,32,111,117,116,115,116,97,110,100,
87
        105,110,103,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,101,
88
        103,101,114,34,44,34,105,110,100,101,120,34,58,51,50,44,34,110,97,109,
89
        101,34,58,34,103,95,97,108,108,111,99,34,44,34,100,111,99,115,34,58,
90
        34,92,116,78,117,109,98,101,114,32,111,102,32,115,116,111,114,97,103,
91
        101,32,97,108,108,111,99,97,116,105,111,110,115,32,111,117,116,115,116,
92
        97,110,100,105,110,103,46,34,125,44,34,103,95,98,121,116,101,115,34,
93
        58,123,34,116,121,112,101,34,58,34,103,97,117,103,101,34,44,34,99,116,
94
        121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,
95
        101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,
96
        114,34,58,34,66,121,116,101,115,32,111,117,116,115,116,97,110,100,105,
97
        110,103,34,44,34,102,111,114,109,97,116,34,58,34,98,121,116,101,115,
98
        34,44,34,105,110,100,101,120,34,58,52,48,44,34,110,97,109,101,34,58,
99
        34,103,95,98,121,116,101,115,34,44,34,100,111,99,115,34,58,34,92,116,
100
        78,117,109,98,101,114,32,111,102,32,98,121,116,101,115,32,97,108,108,
101
        111,99,97,116,101,100,32,102,114,111,109,32,116,104,101,32,115,116,111,
102
        114,97,103,101,46,34,125,44,34,103,95,115,112,97,99,101,34,58,123,34,
103
        116,121,112,101,34,58,34,103,97,117,103,101,34,44,34,99,116,121,112,
104
        101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,
105
        34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,114,34,
106
        58,34,66,121,116,101,115,32,97,118,97,105,108,97,98,108,101,34,44,34,
107
        102,111,114,109,97,116,34,58,34,98,121,116,101,115,34,44,34,105,110,
108
        100,101,120,34,58,52,56,44,34,110,97,109,101,34,58,34,103,95,115,112,
109
        97,99,101,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,
110
        114,32,111,102,32,98,121,116,101,115,32,108,101,102,116,32,105,110,32,
111
        116,104,101,32,115,116,111,114,97,103,101,46,34,125,44,34,103,95,115,
112
        109,102,34,58,123,34,116,121,112,101,34,58,34,103,97,117,103,101,34,
113
        44,34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,
114
        34,108,101,118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,
115
        108,105,110,101,114,34,58,34,78,32,115,116,114,117,99,116,32,115,109,
116
        102,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,101,103,101,
117
        114,34,44,34,105,110,100,101,120,34,58,53,54,44,34,110,97,109,101,34,
118
        58,34,103,95,115,109,102,34,44,34,100,111,99,115,34,58,34,34,125,44,
119
        34,103,95,115,109,102,95,102,114,97,103,34,58,123,34,116,121,112,101,
120
        34,58,34,103,97,117,103,101,34,44,34,99,116,121,112,101,34,58,34,117,
121
        105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,105,110,
122
        102,111,34,44,34,111,110,101,108,105,110,101,114,34,58,34,78,32,115,
123
        109,97,108,108,32,102,114,101,101,32,115,109,102,34,44,34,102,111,114,
124
        109,97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,
125
        101,120,34,58,54,52,44,34,110,97,109,101,34,58,34,103,95,115,109,102,
126
        95,102,114,97,103,34,44,34,100,111,99,115,34,58,34,34,125,44,34,103,
127
        95,115,109,102,95,108,97,114,103,101,34,58,123,34,116,121,112,101,34,
128
        58,34,103,97,117,103,101,34,44,34,99,116,121,112,101,34,58,34,117,105,
129
        110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,105,110,102,
130
        111,34,44,34,111,110,101,108,105,110,101,114,34,58,34,78,32,108,97,114,
131
        103,101,32,102,114,101,101,32,115,109,102,34,44,34,102,111,114,109,97,
132
        116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,
133
        34,58,55,50,44,34,110,97,109,101,34,58,34,103,95,115,109,102,95,108,
134
        97,114,103,101,34,44,34,100,111,99,115,34,58,34,34,125,125,125,0
135
};
136
137
// {
138
//   "version": "1",
139
//   "name": "smf",
140
//   "oneliner": "File Stevedore Counters",
141
//   "order": 50,
142
//   "docs": "",
143
//   "elements": 10,
144
//   "elem": {
145
//     "c_req": {
146
//       "type": "counter",
147
//       "ctype": "uint64_t",
148
//       "level": "info",
149
//       "oneliner": "Allocator requests",
150
//       "format": "integer",
151
//       "index": 0,
152
//       "name": "c_req",
153
//       "docs": "\tNumber of times the storage has been asked to provid[...]
154
//     },
155
//     "c_fail": {
156
//       "type": "counter",
157
//       "ctype": "uint64_t",
158
//       "level": "info",
159
//       "oneliner": "Allocator failures",
160
//       "format": "integer",
161
//       "index": 8,
162
//       "name": "c_fail",
163
//       "docs": "\tNumber of times the storage has failed to provide a [...]
164
//     },
165
//     "c_bytes": {
166
//       "type": "counter",
167
//       "ctype": "uint64_t",
168
//       "level": "info",
169
//       "oneliner": "Bytes allocated",
170
//       "format": "bytes",
171
//       "index": 16,
172
//       "name": "c_bytes",
173
//       "docs": "\tNumber of total bytes allocated by this storage."
174
//     },
175
//     "c_freed": {
176
//       "type": "counter",
177
//       "ctype": "uint64_t",
178
//       "level": "info",
179
//       "oneliner": "Bytes freed",
180
//       "format": "bytes",
181
//       "index": 24,
182
//       "name": "c_freed",
183
//       "docs": "\tNumber of total bytes returned to this storage."
184
//     },
185
//     "g_alloc": {
186
//       "type": "gauge",
187
//       "ctype": "uint64_t",
188
//       "level": "info",
189
//       "oneliner": "Allocations outstanding",
190
//       "format": "integer",
191
//       "index": 32,
192
//       "name": "g_alloc",
193
//       "docs": "\tNumber of storage allocations outstanding."
194
//     },
195
//     "g_bytes": {
196
//       "type": "gauge",
197
//       "ctype": "uint64_t",
198
//       "level": "info",
199
//       "oneliner": "Bytes outstanding",
200
//       "format": "bytes",
201
//       "index": 40,
202
//       "name": "g_bytes",
203
//       "docs": "\tNumber of bytes allocated from the storage."
204
//     },
205
//     "g_space": {
206
//       "type": "gauge",
207
//       "ctype": "uint64_t",
208
//       "level": "info",
209
//       "oneliner": "Bytes available",
210
//       "format": "bytes",
211
//       "index": 48,
212
//       "name": "g_space",
213
//       "docs": "\tNumber of bytes left in the storage."
214
//     },
215
//     "g_smf": {
216
//       "type": "gauge",
217
//       "ctype": "uint64_t",
218
//       "level": "info",
219
//       "oneliner": "N struct smf",
220
//       "format": "integer",
221
//       "index": 56,
222
//       "name": "g_smf",
223
//       "docs": ""
224
//     },
225
//     "g_smf_frag": {
226
//       "type": "gauge",
227
//       "ctype": "uint64_t",
228
//       "level": "info",
229
//       "oneliner": "N small free smf",
230
//       "format": "integer",
231
//       "index": 64,
232
//       "name": "g_smf_frag",
233
//       "docs": ""
234
//     },
235
//     "g_smf_large": {
236
//       "type": "gauge",
237
//       "ctype": "uint64_t",
238
//       "level": "info",
239
//       "oneliner": "N large free smf",
240
//       "format": "integer",
241
//       "index": 72,
242
//       "name": "g_smf_large",
243
//       "docs": ""
244
//     }
245
//   }
246
// }
247
248
249
struct VSC_smf*
250
VSC_smf_New(struct vsmw_cluster *vc,
251
    struct vsc_seg **sg, const char *fmt, ...)
252 6
{
253 6
        va_list ap;
254 6
        struct VSC_smf *retval;
255
256 6
        va_start(ap, fmt);
257 6
        retval = VRT_VSC_Allocv(vc, sg, vsc_smf_name, VSC_smf_size,
258 6
            vsc_smf_json, sizeof vsc_smf_json, fmt, ap);
259 6
        va_end(ap);
260 6
        return(retval);
261 6
}
262
263
void
264
VSC_smf_Destroy(struct vsc_seg **sg)
265 0
{
266 0
        struct vsc_seg *p;
267
268 0
        AN(sg);
269 0
        p = *sg;
270
        *sg = NULL;
271 0
        VRT_VSC_Destroy(vsc_smf_name, p);
272 0
}