| Code Coverage: vinyl-cache/lib/libvsc/VSC_sma.c |
| |
| 82217aa4fc7094b3610340078afaf78cd95a8ec9 |
| |
| 0 |
|
/* |
| 1 |
|
* NB: This file is machine generated, DO NOT EDIT! |
| 2 |
|
* |
| 3 |
|
* Edit sma.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_sma.h" |
| 13 |
|
|
| 14 |
|
static const char vsc_sma_name[] = "SMA"; |
| 15 |
|
|
| 16 |
|
#define PARANOIA(a,n) \ |
| 17 |
|
v_static_assert( \ |
| 18 |
|
offsetof(struct VSC_sma, 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 |
|
#undef PARANOIA |
| 29 |
|
|
| 30 |
|
static const unsigned char vsc_sma_json[1514] = { |
| 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,115,109,97,34,44,34,111,110,101,108,105,110,101,114,34,58,34, |
| 33 |
|
77,97,108,108,111,99,32,83,116,101,118,101,100,111,114,101,32,67,111, |
| 34 |
|
117,110,116,101,114,115,34,44,34,111,114,100,101,114,34,58,52,48,44, |
| 35 |
|
34,100,111,99,115,34,58,34,34,44,34,101,108,101,109,101,110,116,115, |
| 36 |
|
34,58,55,44,34,101,108,101,109,34,58,123,34,99,95,114,101,113,34,58, |
| 37 |
|
123,34,116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34, |
| 38 |
|
99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108, |
| 39 |
|
101,118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108,105, |
| 40 |
|
110,101,114,34,58,34,65,108,108,111,99,97,116,111,114,32,114,101,113, |
| 41 |
|
117,101,115,116,115,34,44,34,102,111,114,109,97,116,34,58,34,105,110, |
| 42 |
|
116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,48,44,34,110, |
| 43 |
|
97,109,101,34,58,34,99,95,114,101,113,34,44,34,100,111,99,115,34,58, |
| 44 |
|
34,92,116,78,117,109,98,101,114,32,111,102,32,116,105,109,101,115,32, |
| 45 |
|
116,104,101,32,115,116,111,114,97,103,101,32,104,97,115,32,98,101,101, |
| 46 |
|
110,32,97,115,107,101,100,32,116,111,32,112,114,111,118,105,100,101, |
| 47 |
|
32,97,32,115,116,111,114,97,103,101,32,115,101,103,109,101,110,116,46, |
| 48 |
|
34,125,44,34,99,95,102,97,105,108,34,58,123,34,116,121,112,101,34,58, |
| 49 |
|
34,99,111,117,110,116,101,114,34,44,34,99,116,121,112,101,34,58,34,117, |
| 50 |
|
105,110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,105,110, |
| 51 |
|
102,111,34,44,34,111,110,101,108,105,110,101,114,34,58,34,65,108,108, |
| 52 |
|
111,99,97,116,111,114,32,102,97,105,108,117,114,101,115,34,44,34,102, |
| 53 |
|
111,114,109,97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105, |
| 54 |
|
110,100,101,120,34,58,56,44,34,110,97,109,101,34,58,34,99,95,102,97, |
| 55 |
|
105,108,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114, |
| 56 |
|
32,111,102,32,116,105,109,101,115,32,116,104,101,32,115,116,111,114, |
| 57 |
|
97,103,101,32,104,97,115,32,102,97,105,108,101,100,32,116,111,32,112, |
| 58 |
|
114,111,118,105,100,101,32,97,32,115,116,111,114,97,103,101,32,115,101, |
| 59 |
|
103,109,101,110,116,46,34,125,44,34,99,95,98,121,116,101,115,34,58,123, |
| 60 |
|
34,116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116, |
| 61 |
|
121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118, |
| 62 |
|
101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101, |
| 63 |
|
114,34,58,34,66,121,116,101,115,32,97,108,108,111,99,97,116,101,100, |
| 64 |
|
34,44,34,102,111,114,109,97,116,34,58,34,98,121,116,101,115,34,44,34, |
| 65 |
|
105,110,100,101,120,34,58,49,54,44,34,110,97,109,101,34,58,34,99,95, |
| 66 |
|
98,121,116,101,115,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109, |
| 67 |
|
98,101,114,32,111,102,32,116,111,116,97,108,32,98,121,116,101,115,32, |
| 68 |
|
97,108,108,111,99,97,116,101,100,32,98,121,32,116,104,105,115,32,115, |
| 69 |
|
116,111,114,97,103,101,46,34,125,44,34,99,95,102,114,101,101,100,34, |
| 70 |
|
58,123,34,116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44, |
| 71 |
|
34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34, |
| 72 |
|
108,101,118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108, |
| 73 |
|
105,110,101,114,34,58,34,66,121,116,101,115,32,102,114,101,101,100,34, |
| 74 |
|
44,34,102,111,114,109,97,116,34,58,34,98,121,116,101,115,34,44,34,105, |
| 75 |
|
110,100,101,120,34,58,50,52,44,34,110,97,109,101,34,58,34,99,95,102, |
| 76 |
|
114,101,101,100,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98, |
| 77 |
|
101,114,32,111,102,32,116,111,116,97,108,32,98,121,116,101,115,32,114, |
| 78 |
|
101,116,117,114,110,101,100,32,116,111,32,116,104,105,115,32,115,116, |
| 79 |
|
111,114,97,103,101,46,34,125,44,34,103,95,97,108,108,111,99,34,58,123, |
| 80 |
|
34,116,121,112,101,34,58,34,103,97,117,103,101,34,44,34,99,116,121,112, |
| 81 |
|
101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118,101,108, |
| 82 |
|
34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110,101,114,34, |
| 83 |
|
58,34,65,108,108,111,99,97,116,105,111,110,115,32,111,117,116,115,116, |
| 84 |
|
97,110,100,105,110,103,34,44,34,102,111,114,109,97,116,34,58,34,105, |
| 85 |
|
110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,51,50,44, |
| 86 |
|
34,110,97,109,101,34,58,34,103,95,97,108,108,111,99,34,44,34,100,111, |
| 87 |
|
99,115,34,58,34,92,116,78,117,109,98,101,114,32,111,102,32,115,116,111, |
| 88 |
|
114,97,103,101,32,97,108,108,111,99,97,116,105,111,110,115,32,111,117, |
| 89 |
|
116,115,116,97,110,100,105,110,103,46,34,125,44,34,103,95,98,121,116, |
| 90 |
|
101,115,34,58,123,34,116,121,112,101,34,58,34,103,97,117,103,101,34, |
| 91 |
|
44,34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44, |
| 92 |
|
34,108,101,118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,101, |
| 93 |
|
108,105,110,101,114,34,58,34,66,121,116,101,115,32,111,117,116,115,116, |
| 94 |
|
97,110,100,105,110,103,34,44,34,102,111,114,109,97,116,34,58,34,98,121, |
| 95 |
|
116,101,115,34,44,34,105,110,100,101,120,34,58,52,48,44,34,110,97,109, |
| 96 |
|
101,34,58,34,103,95,98,121,116,101,115,34,44,34,100,111,99,115,34,58, |
| 97 |
|
34,92,116,78,117,109,98,101,114,32,111,102,32,98,121,116,101,115,32, |
| 98 |
|
97,108,108,111,99,97,116,101,100,32,102,114,111,109,32,116,104,101,32, |
| 99 |
|
115,116,111,114,97,103,101,46,34,125,44,34,103,95,115,112,97,99,101, |
| 100 |
|
34,58,123,34,116,121,112,101,34,58,34,103,97,117,103,101,34,44,34,99, |
| 101 |
|
116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101, |
| 102 |
|
118,101,108,34,58,34,105,110,102,111,34,44,34,111,110,101,108,105,110, |
| 103 |
|
101,114,34,58,34,66,121,116,101,115,32,97,118,97,105,108,97,98,108,101, |
| 104 |
|
34,44,34,102,111,114,109,97,116,34,58,34,98,121,116,101,115,34,44,34, |
| 105 |
|
105,110,100,101,120,34,58,52,56,44,34,110,97,109,101,34,58,34,103,95, |
| 106 |
|
115,112,97,99,101,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109, |
| 107 |
|
98,101,114,32,111,102,32,98,121,116,101,115,32,108,101,102,116,32,105, |
| 108 |
|
110,32,116,104,101,32,115,116,111,114,97,103,101,46,34,125,125,125,0, |
| 109 |
|
|
| 110 |
|
}; |
| 111 |
|
|
| 112 |
|
// { |
| 113 |
|
// "version": "1", |
| 114 |
|
// "name": "sma", |
| 115 |
|
// "oneliner": "Malloc Stevedore Counters", |
| 116 |
|
// "order": 40, |
| 117 |
|
// "docs": "", |
| 118 |
|
// "elements": 7, |
| 119 |
|
// "elem": { |
| 120 |
|
// "c_req": { |
| 121 |
|
// "type": "counter", |
| 122 |
|
// "ctype": "uint64_t", |
| 123 |
|
// "level": "info", |
| 124 |
|
// "oneliner": "Allocator requests", |
| 125 |
|
// "format": "integer", |
| 126 |
|
// "index": 0, |
| 127 |
|
// "name": "c_req", |
| 128 |
|
// "docs": "\tNumber of times the storage has been asked to provid[...] |
| 129 |
|
// }, |
| 130 |
|
// "c_fail": { |
| 131 |
|
// "type": "counter", |
| 132 |
|
// "ctype": "uint64_t", |
| 133 |
|
// "level": "info", |
| 134 |
|
// "oneliner": "Allocator failures", |
| 135 |
|
// "format": "integer", |
| 136 |
|
// "index": 8, |
| 137 |
|
// "name": "c_fail", |
| 138 |
|
// "docs": "\tNumber of times the storage has failed to provide a [...] |
| 139 |
|
// }, |
| 140 |
|
// "c_bytes": { |
| 141 |
|
// "type": "counter", |
| 142 |
|
// "ctype": "uint64_t", |
| 143 |
|
// "level": "info", |
| 144 |
|
// "oneliner": "Bytes allocated", |
| 145 |
|
// "format": "bytes", |
| 146 |
|
// "index": 16, |
| 147 |
|
// "name": "c_bytes", |
| 148 |
|
// "docs": "\tNumber of total bytes allocated by this storage." |
| 149 |
|
// }, |
| 150 |
|
// "c_freed": { |
| 151 |
|
// "type": "counter", |
| 152 |
|
// "ctype": "uint64_t", |
| 153 |
|
// "level": "info", |
| 154 |
|
// "oneliner": "Bytes freed", |
| 155 |
|
// "format": "bytes", |
| 156 |
|
// "index": 24, |
| 157 |
|
// "name": "c_freed", |
| 158 |
|
// "docs": "\tNumber of total bytes returned to this storage." |
| 159 |
|
// }, |
| 160 |
|
// "g_alloc": { |
| 161 |
|
// "type": "gauge", |
| 162 |
|
// "ctype": "uint64_t", |
| 163 |
|
// "level": "info", |
| 164 |
|
// "oneliner": "Allocations outstanding", |
| 165 |
|
// "format": "integer", |
| 166 |
|
// "index": 32, |
| 167 |
|
// "name": "g_alloc", |
| 168 |
|
// "docs": "\tNumber of storage allocations outstanding." |
| 169 |
|
// }, |
| 170 |
|
// "g_bytes": { |
| 171 |
|
// "type": "gauge", |
| 172 |
|
// "ctype": "uint64_t", |
| 173 |
|
// "level": "info", |
| 174 |
|
// "oneliner": "Bytes outstanding", |
| 175 |
|
// "format": "bytes", |
| 176 |
|
// "index": 40, |
| 177 |
|
// "name": "g_bytes", |
| 178 |
|
// "docs": "\tNumber of bytes allocated from the storage." |
| 179 |
|
// }, |
| 180 |
|
// "g_space": { |
| 181 |
|
// "type": "gauge", |
| 182 |
|
// "ctype": "uint64_t", |
| 183 |
|
// "level": "info", |
| 184 |
|
// "oneliner": "Bytes available", |
| 185 |
|
// "format": "bytes", |
| 186 |
|
// "index": 48, |
| 187 |
|
// "name": "g_space", |
| 188 |
|
// "docs": "\tNumber of bytes left in the storage." |
| 189 |
|
// } |
| 190 |
|
// } |
| 191 |
|
// } |
| 192 |
|
|
| 193 |
|
|
| 194 |
|
struct VSC_sma* |
| 195 |
|
VSC_sma_New(struct vsmw_cluster *vc, |
| 196 |
|
struct vsc_seg **sg, const char *fmt, ...) |
| 197 |
2019 |
{ |
| 198 |
2019 |
va_list ap; |
| 199 |
2019 |
struct VSC_sma *retval; |
| 200 |
|
|
| 201 |
2019 |
va_start(ap, fmt); |
| 202 |
2019 |
retval = VRT_VSC_Allocv(vc, sg, vsc_sma_name, VSC_sma_size, |
| 203 |
2019 |
vsc_sma_json, sizeof vsc_sma_json, fmt, ap); |
| 204 |
2019 |
va_end(ap); |
| 205 |
2019 |
return(retval); |
| 206 |
2019 |
} |
| 207 |
|
|
| 208 |
|
void |
| 209 |
|
VSC_sma_Destroy(struct vsc_seg **sg) |
| 210 |
0 |
{ |
| 211 |
0 |
struct vsc_seg *p; |
| 212 |
|
|
| 213 |
0 |
AN(sg); |
| 214 |
0 |
p = *sg; |
| 215 |
|
*sg = NULL; |
| 216 |
0 |
VRT_VSC_Destroy(vsc_sma_name, p); |
| 217 |
0 |
} |