inline string to number conversion
Costa Tsaousis (ktsaou) committed
Jan 19, 2017 at 22:32 UTC
d7a1f3c8494e0546fc4c31d22b390a87ea9bd21a
27 files changed
+449
-415
src/common.c
+1
-1
@@ -1169,7 +1169,7 @@ pid_t get_system_pid_max(void) {
1169
return pid_max;
1170
}
1171
1172
- pid_max = (pid_t)atoi(procfile_lineword(ff, 0, 0));
1172
+ pid_max = (pid_t)str2i(procfile_lineword(ff, 0, 0));
1173
if(!pid_max) {
1174
procfile_close(ff);
1175
pid_max = 32768;
src/health.c
+6
-6
@@ -282,13 +282,13 @@ static inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char
282
ae->info = strdupz(pointers[20]);
283
if(!*ae->info) { freez(ae->info); ae->info = NULL; }
284
285
- ae->exec_code = atoi(pointers[21]);
286
- ae->new_status = atoi(pointers[22]);
287
- ae->old_status = atoi(pointers[23]);
288
- ae->delay = atoi(pointers[24]);
285
+ ae->exec_code = str2i(pointers[21]);
286
+ ae->new_status = str2i(pointers[22]);
287
+ ae->old_status = str2i(pointers[23]);
288
+ ae->delay = str2i(pointers[24]);
289
290
- ae->new_value = strtold(pointers[25], NULL);
291
- ae->old_value = strtold(pointers[26], NULL);
290
+ ae->new_value = str2l(pointers[25]);
291
+ ae->old_value = str2l(pointers[26]);
292
293
// add it to host if not already there
294
if(unlikely(*pointers[0] == 'A')) {
src/inlined.h
+16
-1
@@ -55,6 +55,21 @@ static inline uint32_t simple_uhash(const char *name) {
55
56
#endif /* HAVE_STMT_EXPR */
57
58
+static inline int str2i(const char *s) {
59
+ register int n = 0;
60
+ register char c, negative = (*s == '-');
61
+
62
+ for(c = (negative)?*(++s):*s; c >= '0' && c <= '9' ; c = *(++s)) {
63
+ n *= 10;
64
+ n += c - '0';
65
+ }
66
+
67
+ if(unlikely(negative))
68
+ return -n;
69
+
70
+ return n;
71
+}
72
+
73
static inline long str2l(const char *s) {
74
register long n = 0;
75
register char c, negative = (*s == '-');
@@ -107,7 +122,7 @@ static inline int read_single_number_file(const char *filename, unsigned long lo
122
}
123
124
close(fd);
110
- *result = strtoull(buffer, NULL, 0);
125
+ *result = str2ull(buffer);
126
return 0;
127
}
128
src/ipc.c
+4
-4
@@ -81,10 +81,10 @@ static inline int ipc_sem_get_limits(struct ipc_limits *lim) {
81
82
if(procfile_lines(ff) >= 1 && procfile_linewords(ff, 0) >= 4) {
83
lim->semvmx = SEMVMX;
84
- lim->semmsl = atoi(procfile_lineword(ff, 0, 0));
85
- lim->semmns = atoi(procfile_lineword(ff, 0, 1));
86
- lim->semopm = atoi(procfile_lineword(ff, 0, 2));
87
- lim->semmni = atoi(procfile_lineword(ff, 0, 3));
84
+ lim->semmsl = str2i(procfile_lineword(ff, 0, 0));
85
+ lim->semmns = str2i(procfile_lineword(ff, 0, 1));
86
+ lim->semopm = str2i(procfile_lineword(ff, 0, 2));
87
+ lim->semmni = str2i(procfile_lineword(ff, 0, 3));
88
return 0;
89
}
90
else {
src/plugin_tc.c
+10
-10
@@ -887,7 +887,7 @@ void *tc_main(void *ptr) {
887
else if(unlikely(device && class && first_hash == SENT_HASH && strcmp(words[0], "Sent") == 0)) {
888
// debug(D_TC_LOOP, "SENT line '%s'", words[1]);
889
if(likely(words[1] && *words[1])) {
890
- class->bytes = strtoull(words[1], NULL, 10);
890
+ class->bytes = str2ull(words[1]);
891
class->updated = 1;
892
}
893
else {
@@ -895,35 +895,35 @@ void *tc_main(void *ptr) {
895
}
896
897
if(likely(words[3] && *words[3]))
898
- class->packets = strtoull(words[3], NULL, 10);
898
+ class->packets = str2ull(words[3]);
899
900
if(likely(words[6] && *words[6]))
901
- class->dropped = strtoull(words[6], NULL, 10);
901
+ class->dropped = str2ull(words[6]);
902
903
if(likely(words[8] && *words[8]))
904
- class->overlimits = strtoull(words[8], NULL, 10);
904
+ class->overlimits = str2ull(words[8]);
905
906
if(likely(words[10] && *words[10]))
907
- class->requeues = strtoull(words[8], NULL, 10);
907
+ class->requeues = str2ull(words[8]);
908
}
909
else if(unlikely(device && class && class->updated && first_hash == LENDED_HASH && strcmp(words[0], "lended:") == 0)) {
910
// debug(D_TC_LOOP, "LENDED line '%s'", words[1]);
911
if(likely(words[1] && *words[1]))
912
- class->lended = strtoull(words[1], NULL, 10);
912
+ class->lended = str2ull(words[1]);
913
914
if(likely(words[3] && *words[3]))
915
- class->borrowed = strtoull(words[3], NULL, 10);
915
+ class->borrowed = str2ull(words[3]);
916
917
if(likely(words[5] && *words[5]))
918
- class->giants = strtoull(words[5], NULL, 10);
918
+ class->giants = str2ull(words[5]);
919
}
920
else if(unlikely(device && class && class->updated && first_hash == TOKENS_HASH && strcmp(words[0], "tokens:") == 0)) {
921
// debug(D_TC_LOOP, "TOKENS line '%s'", words[1]);
922
if(likely(words[1] && *words[1]))
923
- class->tokens = strtoull(words[1], NULL, 10);
923
+ class->tokens = str2ull(words[1]);
924
925
if(likely(words[3] && *words[3]))
926
- class->ctokens = strtoull(words[3], NULL, 10);
926
+ class->ctokens = str2ull(words[3]);
927
}
928
else if(unlikely(device && first_hash == SETDEVICENAME_HASH && strcmp(words[0], "SETDEVICENAME") == 0)) {
929
// debug(D_TC_LOOP, "SETDEVICENAME line '%s'", words[1]);
src/plugins_d.c
+3
-3
@@ -188,7 +188,7 @@ void *pluginsd_worker_thread(void *arg)
188
189
if(likely(st->counter_done)) {
190
usec_t microseconds = 0;
191
- if(microseconds_txt && *microseconds_txt) microseconds = strtoull(microseconds_txt, NULL, 10);
191
+ if(microseconds_txt && *microseconds_txt) microseconds = str2ull(microseconds_txt);
192
if(microseconds) rrdset_next_usec(st, microseconds);
193
else rrdset_next(st);
194
}
@@ -242,10 +242,10 @@ void *pluginsd_worker_thread(void *arg)
242
}
243
244
int priority = 1000;
245
- if(likely(priority_s)) priority = atoi(priority_s);
245
+ if(likely(priority_s)) priority = str2i(priority_s);
246
247
int update_every = cd->update_every;
248
- if(likely(update_every_s)) update_every = atoi(update_every_s);
248
+ if(likely(update_every_s)) update_every = str2i(update_every_s);
249
if(unlikely(!update_every)) update_every = cd->update_every;
250
251
int chart_type = RRDSET_TYPE_LINE;
src/proc_diskstats.c
+14
-14
@@ -153,7 +153,7 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
153
char *tmp = fgets(buffer2, 1024, fpss);
154
155
if(likely(tmp)) {
156
- d->sector_size = atoi(tmp);
156
+ d->sector_size = str2i(tmp);
157
if(unlikely(d->sector_size <= 0)) {
158
error("Invalid sector size %d for device %s in %s. Assuming 512.", d->sector_size, d->disk, buffer);
159
d->sector_size = 512;
@@ -263,41 +263,41 @@ int do_proc_diskstats(int update_every, usec_t dt) {
263
uint32_t words = procfile_linewords(ff, l);
264
if(unlikely(words < 14)) continue;
265
266
- major = strtoul(procfile_lineword(ff, l, 0), NULL, 10);
267
- minor = strtoul(procfile_lineword(ff, l, 1), NULL, 10);
266
+ major = str2ul(procfile_lineword(ff, l, 0));
267
+ minor = str2ul(procfile_lineword(ff, l, 1));
268
disk = procfile_lineword(ff, l, 2);
269
270
// # of reads completed # of writes completed
271
// This is the total number of reads or writes completed successfully.
272
- reads = strtoull(procfile_lineword(ff, l, 3), NULL, 10); // rd_ios
273
- writes = strtoull(procfile_lineword(ff, l, 7), NULL, 10); // wr_ios
272
+ reads = str2ull(procfile_lineword(ff, l, 3)); // rd_ios
273
+ writes = str2ull(procfile_lineword(ff, l, 7)); // wr_ios
274
275
// # of reads merged # of writes merged
276
// Reads and writes which are adjacent to each other may be merged for
277
// efficiency. Thus two 4K reads may become one 8K read before it is
278
// ultimately handed to the disk, and so it will be counted (and queued)
279
- mreads = strtoull(procfile_lineword(ff, l, 4), NULL, 10); // rd_merges_or_rd_sec
280
- mwrites = strtoull(procfile_lineword(ff, l, 8), NULL, 10); // wr_merges
279
+ mreads = str2ull(procfile_lineword(ff, l, 4)); // rd_merges_or_rd_sec
280
+ mwrites = str2ull(procfile_lineword(ff, l, 8)); // wr_merges
281
282
// # of sectors read # of sectors written
283
// This is the total number of sectors read or written successfully.
284
- readsectors = strtoull(procfile_lineword(ff, l, 5), NULL, 10); // rd_sec_or_wr_ios
285
- writesectors = strtoull(procfile_lineword(ff, l, 9), NULL, 10); // wr_sec
284
+ readsectors = str2ull(procfile_lineword(ff, l, 5)); // rd_sec_or_wr_ios
285
+ writesectors = str2ull(procfile_lineword(ff, l, 9)); // wr_sec
286
287
// # of milliseconds spent reading # of milliseconds spent writing
288
// This is the total number of milliseconds spent by all reads or writes (as
289
// measured from __make_request() to end_that_request_last()).
290
- readms = strtoull(procfile_lineword(ff, l, 6), NULL, 10); // rd_ticks_or_wr_sec
291
- writems = strtoull(procfile_lineword(ff, l, 10), NULL, 10); // wr_ticks
290
+ readms = str2ull(procfile_lineword(ff, l, 6)); // rd_ticks_or_wr_sec
291
+ writems = str2ull(procfile_lineword(ff, l, 10)); // wr_ticks
292
293
// # of I/Os currently in progress
294
// The only field that should go to zero. Incremented as requests are
295
// given to appropriate struct request_queue and decremented as they finish.
296
- queued_ios = strtoull(procfile_lineword(ff, l, 11), NULL, 10); // ios_pgr
296
+ queued_ios = str2ull(procfile_lineword(ff, l, 11)); // ios_pgr
297
298
// # of milliseconds spent doing I/Os
299
// This field increases so long as field queued_ios is nonzero.
300
- busy_ms = strtoull(procfile_lineword(ff, l, 12), NULL, 10); // tot_ticks
300
+ busy_ms = str2ull(procfile_lineword(ff, l, 12)); // tot_ticks
301
302
// weighted # of milliseconds spent doing I/Os
303
// This field is incremented at each I/O start, I/O completion, I/O
@@ -305,7 +305,7 @@ int do_proc_diskstats(int update_every, usec_t dt) {
305
// (field queued_ios) times the number of milliseconds spent doing I/O since the
306
// last update of this field. This can provide an easy measure of both
307
// I/O completion time and the backlog that may be accumulating.
308
- backlog_ms = strtoull(procfile_lineword(ff, l, 13), NULL, 10); // rq_ticks
308
+ backlog_ms = str2ull(procfile_lineword(ff, l, 13)); // rq_ticks
309
310
311
// --------------------------------------------------------------------------
src/proc_interrupts.c
+1
-1
@@ -115,7 +115,7 @@ int do_proc_interrupts(int update_every, usec_t dt) {
115
int c;
116
for(c = 0; c < cpus ;c++) {
117
if(likely((c + 1) < (int)words))
118
- irr->cpu[c].value = strtoull(procfile_lineword(ff, l, (uint32_t)(c + 1)), NULL, 10);
118
+ irr->cpu[c].value = str2ull(procfile_lineword(ff, l, (uint32_t)(c + 1)));
119
else
120
irr->cpu[c].value = 0;
121
src/proc_loadavg.c
+3
-3
@@ -40,9 +40,9 @@ int do_proc_loadavg(int update_every, usec_t dt) {
40
double load5 = strtod(procfile_lineword(ff, 0, 1), NULL);
41
double load15 = strtod(procfile_lineword(ff, 0, 2), NULL);
42
43
- //unsigned long long running_processes = strtoull(procfile_lineword(ff, 0, 3), NULL, 10);
44
- unsigned long long active_processes = strtoull(procfile_lineword(ff, 0, 4), NULL, 10);
45
- //unsigned long long next_pid = strtoull(procfile_lineword(ff, 0, 5), NULL, 10);
43
+ //unsigned long long running_processes = str2ull(procfile_lineword(ff, 0, 3));
44
+ unsigned long long active_processes = str2ull(procfile_lineword(ff, 0, 4));
45
+ //unsigned long long next_pid = str2ull(procfile_lineword(ff, 0, 5));
46
47
48
// --------------------------------------------------------------------
src/proc_meminfo.c
+49
-44
@@ -160,56 +160,61 @@ int do_proc_meminfo(int update_every, usec_t dt) {
160
//DirectMap2M = 0,
161
HardwareCorrupted = 0;
162
163
+ unsigned long long *value = NULL;
164
for(l = 0; l < lines ;l++) {
165
uint32_t words = procfile_linewords(ff, l);
166
if(unlikely(words < 2)) continue;
167
168
char *name = procfile_lineword(ff, l, 0);
169
uint32_t hash = simple_hash(name);
169
- unsigned long long value = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
170
-
171
- if(hash == MemTotal_hash && strcmp(name, "MemTotal") == 0) MemTotal = value;
172
- else if(hash == MemFree_hash && strcmp(name, "MemFree") == 0) MemFree = value;
173
- else if(hash == Buffers_hash && strcmp(name, "Buffers") == 0) Buffers = value;
174
- else if(hash == Cached_hash && strcmp(name, "Cached") == 0) Cached = value;
175
- //else if(hash == SwapCached_hash && strcmp(name, "SwapCached") == 0) SwapCached = value;
176
- //else if(hash == Active_hash && strcmp(name, "Active") == 0) Active = value;
177
- //else if(hash == Inactive_hash && strcmp(name, "Inactive") == 0) Inactive = value;
178
- //else if(hash == ActiveAnon_hash && strcmp(name, "ActiveAnon") == 0) ActiveAnon = value;
179
- //else if(hash == InactiveAnon_hash && strcmp(name, "InactiveAnon") == 0) InactiveAnon = value;
180
- //else if(hash == ActiveFile_hash && strcmp(name, "ActiveFile") == 0) ActiveFile = value;
181
- //else if(hash == InactiveFile_hash && strcmp(name, "InactiveFile") == 0) InactiveFile = value;
182
- //else if(hash == Unevictable_hash && strcmp(name, "Unevictable") == 0) Unevictable = value;
183
- //else if(hash == Mlocked_hash && strcmp(name, "Mlocked") == 0) Mlocked = value;
184
- else if(hash == SwapTotal_hash && strcmp(name, "SwapTotal") == 0) SwapTotal = value;
185
- else if(hash == SwapFree_hash && strcmp(name, "SwapFree") == 0) SwapFree = value;
186
- else if(hash == Dirty_hash && strcmp(name, "Dirty") == 0) Dirty = value;
187
- else if(hash == Writeback_hash && strcmp(name, "Writeback") == 0) Writeback = value;
188
- //else if(hash == AnonPages_hash && strcmp(name, "AnonPages") == 0) AnonPages = value;
189
- //else if(hash == Mapped_hash && strcmp(name, "Mapped") == 0) Mapped = value;
190
- //else if(hash == Shmem_hash && strcmp(name, "Shmem") == 0) Shmem = value;
191
- else if(hash == Slab_hash && strcmp(name, "Slab") == 0) Slab = value;
192
- else if(hash == SReclaimable_hash && strcmp(name, "SReclaimable") == 0) SReclaimable = value;
193
- else if(hash == SUnreclaim_hash && strcmp(name, "SUnreclaim") == 0) SUnreclaim = value;
194
- else if(hash == KernelStack_hash && strcmp(name, "KernelStack") == 0) KernelStack = value;
195
- else if(hash == PageTables_hash && strcmp(name, "PageTables") == 0) PageTables = value;
196
- else if(hash == NFS_Unstable_hash && strcmp(name, "NFS_Unstable") == 0) NFS_Unstable = value;
197
- else if(hash == Bounce_hash && strcmp(name, "Bounce") == 0) Bounce = value;
198
- else if(hash == WritebackTmp_hash && strcmp(name, "WritebackTmp") == 0) WritebackTmp = value;
199
- //else if(hash == CommitLimit_hash && strcmp(name, "CommitLimit") == 0) CommitLimit = value;
200
- else if(hash == Committed_AS_hash && strcmp(name, "Committed_AS") == 0) Committed_AS = value;
201
- //else if(hash == VmallocTotal_hash && strcmp(name, "VmallocTotal") == 0) VmallocTotal = value;
202
- else if(hash == VmallocUsed_hash && strcmp(name, "VmallocUsed") == 0) VmallocUsed = value;
203
- //else if(hash == VmallocChunk_hash && strcmp(name, "VmallocChunk") == 0) VmallocChunk = value;
204
- else if(hash == HardwareCorrupted_hash && strcmp(name, "HardwareCorrupted") == 0) { HardwareCorrupted = value; hwcorrupted = 1; }
205
- //else if(hash == AnonHugePages_hash && strcmp(name, "AnonHugePages") == 0) AnonHugePages = value;
206
- //else if(hash == HugePages_Total_hash && strcmp(name, "HugePages_Total") == 0) HugePages_Total = value;
207
- //else if(hash == HugePages_Free_hash && strcmp(name, "HugePages_Free") == 0) HugePages_Free = value;
208
- //else if(hash == HugePages_Rsvd_hash && strcmp(name, "HugePages_Rsvd") == 0) HugePages_Rsvd = value;
209
- //else if(hash == HugePages_Surp_hash && strcmp(name, "HugePages_Surp") == 0) HugePages_Surp = value;
210
- //else if(hash == Hugepagesize_hash && strcmp(name, "Hugepagesize") == 0) Hugepagesize = value;
211
- //else if(hash == DirectMap4k_hash && strcmp(name, "DirectMap4k") == 0) DirectMap4k = value;
212
- //else if(hash == DirectMap2M_hash && strcmp(name, "DirectMap2M") == 0) DirectMap2M = value;
170
+
171
+ if(hash == MemTotal_hash && strcmp(name, "MemTotal") == 0) value = &MemTotal;
172
+ else if(hash == MemFree_hash && strcmp(name, "MemFree") == 0) value = &MemFree;
173
+ else if(hash == Buffers_hash && strcmp(name, "Buffers") == 0) value = &Buffers;
174
+ else if(hash == Cached_hash && strcmp(name, "Cached") == 0) value = &Cached;
175
+ //else if(hash == SwapCached_hash && strcmp(name, "SwapCached") == 0) value = &SwapCached;
176
+ //else if(hash == Active_hash && strcmp(name, "Active") == 0) value = &Active;
177
+ //else if(hash == Inactive_hash && strcmp(name, "Inactive") == 0) value = &Inactive;
178
+ //else if(hash == ActiveAnon_hash && strcmp(name, "ActiveAnon") == 0) value = &ActiveAnon;
179
+ //else if(hash == InactiveAnon_hash && strcmp(name, "InactiveAnon") == 0) value = &InactiveAnon;
180
+ //else if(hash == ActiveFile_hash && strcmp(name, "ActiveFile") == 0) value = &ActiveFile;
181
+ //else if(hash == InactiveFile_hash && strcmp(name, "InactiveFile") == 0) value = &InactiveFile;
182
+ //else if(hash == Unevictable_hash && strcmp(name, "Unevictable") == 0) value = &Unevictable;
183
+ //else if(hash == Mlocked_hash && strcmp(name, "Mlocked") == 0) value = &Mlocked;
184
+ else if(hash == SwapTotal_hash && strcmp(name, "SwapTotal") == 0) value = &SwapTotal;
185
+ else if(hash == SwapFree_hash && strcmp(name, "SwapFree") == 0) value = &SwapFree;
186
+ else if(hash == Dirty_hash && strcmp(name, "Dirty") == 0) value = &Dirty;
187
+ else if(hash == Writeback_hash && strcmp(name, "Writeback") == 0) value = &Writeback;
188
+ //else if(hash == AnonPages_hash && strcmp(name, "AnonPages") == 0) value = &AnonPages;
189
+ //else if(hash == Mapped_hash && strcmp(name, "Mapped") == 0) value = &Mapped;
190
+ //else if(hash == Shmem_hash && strcmp(name, "Shmem") == 0) value = &Shmem;
191
+ else if(hash == Slab_hash && strcmp(name, "Slab") == 0) value = &Slab;
192
+ else if(hash == SReclaimable_hash && strcmp(name, "SReclaimable") == 0) value = &SReclaimable;
193
+ else if(hash == SUnreclaim_hash && strcmp(name, "SUnreclaim") == 0) value = &SUnreclaim;
194
+ else if(hash == KernelStack_hash && strcmp(name, "KernelStack") == 0) value = &KernelStack;
195
+ else if(hash == PageTables_hash && strcmp(name, "PageTables") == 0) value = &PageTables;
196
+ else if(hash == NFS_Unstable_hash && strcmp(name, "NFS_Unstable") == 0) value = &NFS_Unstable;
197
+ else if(hash == Bounce_hash && strcmp(name, "Bounce") == 0) value = &Bounce;
198
+ else if(hash == WritebackTmp_hash && strcmp(name, "WritebackTmp") == 0) value = &WritebackTmp;
199
+ //else if(hash == CommitLimit_hash && strcmp(name, "CommitLimit") == 0) value = &CommitLimit;
200
+ else if(hash == Committed_AS_hash && strcmp(name, "Committed_AS") == 0) value = &Committed_AS;
201
+ //else if(hash == VmallocTotal_hash && strcmp(name, "VmallocTotal") == 0) value = &VmallocTotal;
202
+ else if(hash == VmallocUsed_hash && strcmp(name, "VmallocUsed") == 0) value = &VmallocUsed;
203
+ //else if(hash == VmallocChunk_hash && strcmp(name, "VmallocChunk") == 0) value = &VmallocChunk;
204
+ else if(hash == HardwareCorrupted_hash && strcmp(name, "HardwareCorrupted") == 0) { value = &HardwareCorrupted; hwcorrupted = 1; }
205
+ //else if(hash == AnonHugePages_hash && strcmp(name, "AnonHugePages") == 0) value = &AnonHugePages;
206
+ //else if(hash == HugePages_Total_hash && strcmp(name, "HugePages_Total") == 0) value = &HugePages_Total;
207
+ //else if(hash == HugePages_Free_hash && strcmp(name, "HugePages_Free") == 0) value = &HugePages_Free;
208
+ //else if(hash == HugePages_Rsvd_hash && strcmp(name, "HugePages_Rsvd") == 0) value = &HugePages_Rsvd;
209
+ //else if(hash == HugePages_Surp_hash && strcmp(name, "HugePages_Surp") == 0) value = &HugePages_Surp;
210
+ //else if(hash == Hugepagesize_hash && strcmp(name, "Hugepagesize") == 0) value = &Hugepagesize;
211
+ //else if(hash == DirectMap4k_hash && strcmp(name, "DirectMap4k") == 0) value = &DirectMap4k;
212
+ //else if(hash == DirectMap2M_hash && strcmp(name, "DirectMap2M") == 0) value = &DirectMap2M;
213
+
214
+ if(value) {
215
+ *value = str2ull(procfile_lineword(ff, l, 1));
216
+ value = NULL;
217
+ }
218
}
219
220
RRDSET *st;
src/proc_net_dev.c
+17
-17
@@ -180,23 +180,23 @@ int do_proc_net_dev(int update_every, usec_t dt) {
180
if(unlikely(!d->enabled))
181
continue;
182
183
- d->rbytes = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
184
- d->rpackets = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
185
- d->rerrors = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
186
- d->rdrops = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
187
- d->rfifo = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
188
- d->rframe = strtoull(procfile_lineword(ff, l, 6), NULL, 10);
189
- d->rcompressed = strtoull(procfile_lineword(ff, l, 7), NULL, 10);
190
- d->rmulticast = strtoull(procfile_lineword(ff, l, 8), NULL, 10);
191
-
192
- d->tbytes = strtoull(procfile_lineword(ff, l, 9), NULL, 10);
193
- d->tpackets = strtoull(procfile_lineword(ff, l, 10), NULL, 10);
194
- d->terrors = strtoull(procfile_lineword(ff, l, 11), NULL, 10);
195
- d->tdrops = strtoull(procfile_lineword(ff, l, 12), NULL, 10);
196
- d->tfifo = strtoull(procfile_lineword(ff, l, 13), NULL, 10);
197
- d->tcollisions = strtoull(procfile_lineword(ff, l, 14), NULL, 10);
198
- d->tcarrier = strtoull(procfile_lineword(ff, l, 15), NULL, 10);
199
- d->tcompressed = strtoull(procfile_lineword(ff, l, 16), NULL, 10);
183
+ d->rbytes = str2ull(procfile_lineword(ff, l, 1));
184
+ d->rpackets = str2ull(procfile_lineword(ff, l, 2));
185
+ d->rerrors = str2ull(procfile_lineword(ff, l, 3));
186
+ d->rdrops = str2ull(procfile_lineword(ff, l, 4));
187
+ d->rfifo = str2ull(procfile_lineword(ff, l, 5));
188
+ d->rframe = str2ull(procfile_lineword(ff, l, 6));
189
+ d->rcompressed = str2ull(procfile_lineword(ff, l, 7));
190
+ d->rmulticast = str2ull(procfile_lineword(ff, l, 8));
191
+
192
+ d->tbytes = str2ull(procfile_lineword(ff, l, 9));
193
+ d->tpackets = str2ull(procfile_lineword(ff, l, 10));
194
+ d->terrors = str2ull(procfile_lineword(ff, l, 11));
195
+ d->tdrops = str2ull(procfile_lineword(ff, l, 12));
196
+ d->tfifo = str2ull(procfile_lineword(ff, l, 13));
197
+ d->tcollisions = str2ull(procfile_lineword(ff, l, 14));
198
+ d->tcarrier = str2ull(procfile_lineword(ff, l, 15));
199
+ d->tcompressed = str2ull(procfile_lineword(ff, l, 16));
200
201
// --------------------------------------------------------------------
202
src/proc_net_netstat.c
+1
-1
@@ -183,7 +183,7 @@ static void parse_line_pair(procfile *ff, struct netstat_columns *nc, uint32_t h
183
184
for(i = 0 ; nc[i].name ;i++) {
185
if(unlikely(hash == nc[i].hash && !strcmp(key, nc[i].name))) {
186
- nc[i].value = strtoull(procfile_lineword(ff, values_line, w), NULL, 10);
186
+ nc[i].value = str2ull(procfile_lineword(ff, values_line, w));
187
break;
188
}
189
}
src/proc_net_rpc_nfs.c
+10
-10
@@ -176,10 +176,10 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
176
continue;
177
}
178
179
- net_count = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
180
- net_udp_count = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
181
- net_tcp_count = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
182
- net_tcp_connections = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
179
+ net_count = str2ull(procfile_lineword(ff, l, 1));
180
+ net_udp_count = str2ull(procfile_lineword(ff, l, 2));
181
+ net_tcp_count = str2ull(procfile_lineword(ff, l, 3));
182
+ net_tcp_connections = str2ull(procfile_lineword(ff, l, 4));
183
184
unsigned long long sum = net_count + net_udp_count + net_tcp_count + net_tcp_connections;
185
if(sum == 0ULL) do_net = -1;
@@ -191,9 +191,9 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
191
continue;
192
}
193
194
- rpc_calls = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
195
- rpc_retransmits = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
196
- rpc_auth_refresh = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
194
+ rpc_calls = str2ull(procfile_lineword(ff, l, 1));
195
+ rpc_retransmits = str2ull(procfile_lineword(ff, l, 2));
196
+ rpc_auth_refresh = str2ull(procfile_lineword(ff, l, 3));
197
198
unsigned long long sum = rpc_calls + rpc_retransmits + rpc_auth_refresh;
199
if(sum == 0ULL) do_rpc = -1;
@@ -206,7 +206,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
206
unsigned long long sum = 0;
207
unsigned int i, j;
208
for(i = 0, j = 2; j < words && nfs_proc2_values[i].name[0] ; i++, j++) {
209
- nfs_proc2_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
209
+ nfs_proc2_values[i].value = str2ull(procfile_lineword(ff, l, j));
210
nfs_proc2_values[i].present = 1;
211
sum += nfs_proc2_values[i].value;
212
}
@@ -227,7 +227,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
227
unsigned long long sum = 0;
228
unsigned int i, j;
229
for(i = 0, j = 2; j < words && nfs_proc3_values[i].name[0] ; i++, j++) {
230
- nfs_proc3_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
230
+ nfs_proc3_values[i].value = str2ull(procfile_lineword(ff, l, j));
231
nfs_proc3_values[i].present = 1;
232
sum += nfs_proc3_values[i].value;
233
}
@@ -248,7 +248,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
248
unsigned long long sum = 0;
249
unsigned int i, j;
250
for(i = 0, j = 2; j < words && nfs_proc4_values[i].name[0] ; i++, j++) {
251
- nfs_proc4_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
251
+ nfs_proc4_values[i].value = str2ull(procfile_lineword(ff, l, j));
252
nfs_proc4_values[i].present = 1;
253
sum += nfs_proc4_values[i].value;
254
}
src/proc_net_rpc_nfsd.c
+36
-36
@@ -275,9 +275,9 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
275
continue;
276
}
277
278
- rc_hits = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
279
- rc_misses = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
280
- rc_nocache = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
278
+ rc_hits = str2ull(procfile_lineword(ff, l, 1));
279
+ rc_misses = str2ull(procfile_lineword(ff, l, 2));
280
+ rc_nocache = str2ull(procfile_lineword(ff, l, 3));
281
282
unsigned long long sum = rc_hits + rc_misses + rc_nocache;
283
if(sum == 0ULL) do_rc = -1;
@@ -289,11 +289,11 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
289
continue;
290
}
291
292
- fh_stale = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
293
- fh_total_lookups = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
294
- fh_anonymous_lookups = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
295
- fh_dir_not_in_dcache = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
296
- fh_non_dir_not_in_dcache = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
292
+ fh_stale = str2ull(procfile_lineword(ff, l, 1));
293
+ fh_total_lookups = str2ull(procfile_lineword(ff, l, 2));
294
+ fh_anonymous_lookups = str2ull(procfile_lineword(ff, l, 3));
295
+ fh_dir_not_in_dcache = str2ull(procfile_lineword(ff, l, 4));
296
+ fh_non_dir_not_in_dcache = str2ull(procfile_lineword(ff, l, 5));
297
298
unsigned long long sum = fh_stale + fh_total_lookups + fh_anonymous_lookups + fh_dir_not_in_dcache + fh_non_dir_not_in_dcache;
299
if(sum == 0ULL) do_fh = -1;
@@ -305,8 +305,8 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
305
continue;
306
}
307
308
- io_read = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
309
- io_write = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
308
+ io_read = str2ull(procfile_lineword(ff, l, 1));
309
+ io_write = str2ull(procfile_lineword(ff, l, 2));
310
311
unsigned long long sum = io_read + io_write;
312
if(sum == 0ULL) do_io = -1;
@@ -318,8 +318,8 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
318
continue;
319
}
320
321
- th_threads = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
322
- th_fullcnt = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
321
+ th_threads = str2ull(procfile_lineword(ff, l, 1));
322
+ th_fullcnt = str2ull(procfile_lineword(ff, l, 2));
323
th_hist10 = (unsigned long long)(atof(procfile_lineword(ff, l, 3)) * 1000.0);
324
th_hist20 = (unsigned long long)(atof(procfile_lineword(ff, l, 4)) * 1000.0);
325
th_hist30 = (unsigned long long)(atof(procfile_lineword(ff, l, 5)) * 1000.0);
@@ -349,18 +349,18 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
349
continue;
350
}
351
352
- ra_size = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
353
- ra_hist10 = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
354
- ra_hist20 = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
355
- ra_hist30 = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
356
- ra_hist40 = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
357
- ra_hist50 = strtoull(procfile_lineword(ff, l, 6), NULL, 10);
358
- ra_hist60 = strtoull(procfile_lineword(ff, l, 7), NULL, 10);
359
- ra_hist70 = strtoull(procfile_lineword(ff, l, 8), NULL, 10);
360
- ra_hist80 = strtoull(procfile_lineword(ff, l, 9), NULL, 10);
361
- ra_hist90 = strtoull(procfile_lineword(ff, l, 10), NULL, 10);
362
- ra_hist100 = strtoull(procfile_lineword(ff, l, 11), NULL, 10);
363
- ra_none = strtoull(procfile_lineword(ff, l, 12), NULL, 10);
352
+ ra_size = str2ull(procfile_lineword(ff, l, 1));
353
+ ra_hist10 = str2ull(procfile_lineword(ff, l, 2));
354
+ ra_hist20 = str2ull(procfile_lineword(ff, l, 3));
355
+ ra_hist30 = str2ull(procfile_lineword(ff, l, 4));
356
+ ra_hist40 = str2ull(procfile_lineword(ff, l, 5));
357
+ ra_hist50 = str2ull(procfile_lineword(ff, l, 6));
358
+ ra_hist60 = str2ull(procfile_lineword(ff, l, 7));
359
+ ra_hist70 = str2ull(procfile_lineword(ff, l, 8));
360
+ ra_hist80 = str2ull(procfile_lineword(ff, l, 9));
361
+ ra_hist90 = str2ull(procfile_lineword(ff, l, 10));
362
+ ra_hist100 = str2ull(procfile_lineword(ff, l, 11));
363
+ ra_none = str2ull(procfile_lineword(ff, l, 12));
364
365
unsigned long long sum = ra_hist10 + ra_hist20 + ra_hist30 + ra_hist40 + ra_hist50 + ra_hist60 + ra_hist70 + ra_hist80 + ra_hist90 + ra_hist100 + ra_none;
366
if(sum == 0ULL) {
@@ -378,10 +378,10 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
378
continue;
379
}
380
381
- net_count = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
382
- net_udp_count = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
383
- net_tcp_count = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
384
- net_tcp_connections = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
381
+ net_count = str2ull(procfile_lineword(ff, l, 1));
382
+ net_udp_count = str2ull(procfile_lineword(ff, l, 2));
383
+ net_tcp_count = str2ull(procfile_lineword(ff, l, 3));
384
+ net_tcp_connections = str2ull(procfile_lineword(ff, l, 4));
385
386
unsigned long long sum = net_count + net_udp_count + net_tcp_count + net_tcp_connections;
387
if(sum == 0ULL) do_net = -1;
@@ -393,10 +393,10 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
393
continue;
394
}
395
396
- rpc_calls = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
397
- rpc_bad_format = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
398
- rpc_bad_auth = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
399
- rpc_bad_client = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
396
+ rpc_calls = str2ull(procfile_lineword(ff, l, 1));
397
+ rpc_bad_format = str2ull(procfile_lineword(ff, l, 2));
398
+ rpc_bad_auth = str2ull(procfile_lineword(ff, l, 3));
399
+ rpc_bad_client = str2ull(procfile_lineword(ff, l, 4));
400
401
unsigned long long sum = rpc_calls + rpc_bad_format + rpc_bad_auth + rpc_bad_client;
402
if(sum == 0ULL) do_rpc = -1;
@@ -409,7 +409,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
409
unsigned long long sum = 0;
410
unsigned int i, j;
411
for(i = 0, j = 2; j < words && nfsd_proc2_values[i].name[0] ; i++, j++) {
412
- nfsd_proc2_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
412
+ nfsd_proc2_values[i].value = str2ull(procfile_lineword(ff, l, j));
413
nfsd_proc2_values[i].present = 1;
414
sum += nfsd_proc2_values[i].value;
415
}
@@ -430,7 +430,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
430
unsigned long long sum = 0;
431
unsigned int i, j;
432
for(i = 0, j = 2; j < words && nfsd_proc3_values[i].name[0] ; i++, j++) {
433
- nfsd_proc3_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
433
+ nfsd_proc3_values[i].value = str2ull(procfile_lineword(ff, l, j));
434
nfsd_proc3_values[i].present = 1;
435
sum += nfsd_proc3_values[i].value;
436
}
@@ -451,7 +451,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
451
unsigned long long sum = 0;
452
unsigned int i, j;
453
for(i = 0, j = 2; j < words && nfsd_proc4_values[i].name[0] ; i++, j++) {
454
- nfsd_proc4_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
454
+ nfsd_proc4_values[i].value = str2ull(procfile_lineword(ff, l, j));
455
nfsd_proc4_values[i].present = 1;
456
sum += nfsd_proc4_values[i].value;
457
}
@@ -472,7 +472,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
472
unsigned long long sum = 0;
473
unsigned int i, j;
474
for(i = 0, j = 2; j < words && nfsd4_ops_values[i].name[0] ; i++, j++) {
475
- nfsd4_ops_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
475
+ nfsd4_ops_values[i].value = str2ull(procfile_lineword(ff, l, j));
476
nfsd4_ops_values[i].present = 1;
477
sum += nfsd4_ops_values[i].value;
478
}
src/proc_net_snmp.c
+1
-1
@@ -190,7 +190,7 @@ static void parse_line_pair(procfile *ff, struct netstat_columns *nc, uint32_t h
190
191
for(i = 0 ; nc[i].name ;i++) {
192
if(unlikely(hash == nc[i].hash && !strcmp(key, nc[i].name))) {
193
- nc[i].value = strtoull(procfile_lineword(ff, values_line, w), NULL, 10);
193
+ nc[i].value = str2ull(procfile_lineword(ff, values_line, w));
194
break;
195
}
196
}
src/proc_net_snmp6.c
+99
-92
@@ -347,6 +347,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
347
unsigned long long UdpLite6SndbufErrors = 0ULL;
348
unsigned long long UdpLite6InCsumErrors = 0ULL;
349
350
+ unsigned long long *ptr = NULL;
351
+
352
for(l = 0; l < lines ;l++) {
353
uint32_t words = procfile_linewords(ff, l);
354
if(unlikely(words < 2)) {
@@ -361,98 +363,103 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
363
364
uint32_t hash = simple_hash(name);
365
364
- if(unlikely(hash == hash_Ip6InReceives && strcmp(name, "Ip6InReceives") == 0)) Ip6InReceives = strtoull(value, NULL, 10);
365
- else if(unlikely(hash == hash_Ip6InHdrErrors && strcmp(name, "Ip6InHdrErrors") == 0)) Ip6InHdrErrors = strtoull(value, NULL, 10);
366
- else if(unlikely(hash == hash_Ip6InTooBigErrors && strcmp(name, "Ip6InTooBigErrors") == 0)) Ip6InTooBigErrors = strtoull(value, NULL, 10);
367
- else if(unlikely(hash == hash_Ip6InNoRoutes && strcmp(name, "Ip6InNoRoutes") == 0)) Ip6InNoRoutes = strtoull(value, NULL, 10);
368
- else if(unlikely(hash == hash_Ip6InAddrErrors && strcmp(name, "Ip6InAddrErrors") == 0)) Ip6InAddrErrors = strtoull(value, NULL, 10);
369
- else if(unlikely(hash == hash_Ip6InUnknownProtos && strcmp(name, "Ip6InUnknownProtos") == 0)) Ip6InUnknownProtos = strtoull(value, NULL, 10);
370
- else if(unlikely(hash == hash_Ip6InTruncatedPkts && strcmp(name, "Ip6InTruncatedPkts") == 0)) Ip6InTruncatedPkts = strtoull(value, NULL, 10);
371
- else if(unlikely(hash == hash_Ip6InDiscards && strcmp(name, "Ip6InDiscards") == 0)) Ip6InDiscards = strtoull(value, NULL, 10);
372
- else if(unlikely(hash == hash_Ip6InDelivers && strcmp(name, "Ip6InDelivers") == 0)) Ip6InDelivers = strtoull(value, NULL, 10);
373
- else if(unlikely(hash == hash_Ip6OutForwDatagrams && strcmp(name, "Ip6OutForwDatagrams") == 0)) Ip6OutForwDatagrams = strtoull(value, NULL, 10);
374
- else if(unlikely(hash == hash_Ip6OutRequests && strcmp(name, "Ip6OutRequests") == 0)) Ip6OutRequests = strtoull(value, NULL, 10);
375
- else if(unlikely(hash == hash_Ip6OutDiscards && strcmp(name, "Ip6OutDiscards") == 0)) Ip6OutDiscards = strtoull(value, NULL, 10);
376
- else if(unlikely(hash == hash_Ip6OutNoRoutes && strcmp(name, "Ip6OutNoRoutes") == 0)) Ip6OutNoRoutes = strtoull(value, NULL, 10);
377
- else if(unlikely(hash == hash_Ip6ReasmTimeout && strcmp(name, "Ip6ReasmTimeout") == 0)) Ip6ReasmTimeout = strtoull(value, NULL, 10);
378
- else if(unlikely(hash == hash_Ip6ReasmReqds && strcmp(name, "Ip6ReasmReqds") == 0)) Ip6ReasmReqds = strtoull(value, NULL, 10);
379
- else if(unlikely(hash == hash_Ip6ReasmOKs && strcmp(name, "Ip6ReasmOKs") == 0)) Ip6ReasmOKs = strtoull(value, NULL, 10);
380
- else if(unlikely(hash == hash_Ip6ReasmFails && strcmp(name, "Ip6ReasmFails") == 0)) Ip6ReasmFails = strtoull(value, NULL, 10);
381
- else if(unlikely(hash == hash_Ip6FragOKs && strcmp(name, "Ip6FragOKs") == 0)) Ip6FragOKs = strtoull(value, NULL, 10);
382
- else if(unlikely(hash == hash_Ip6FragFails && strcmp(name, "Ip6FragFails") == 0)) Ip6FragFails = strtoull(value, NULL, 10);
383
- else if(unlikely(hash == hash_Ip6FragCreates && strcmp(name, "Ip6FragCreates") == 0)) Ip6FragCreates = strtoull(value, NULL, 10);
384
- else if(unlikely(hash == hash_Ip6InMcastPkts && strcmp(name, "Ip6InMcastPkts") == 0)) Ip6InMcastPkts = strtoull(value, NULL, 10);
385
- else if(unlikely(hash == hash_Ip6OutMcastPkts && strcmp(name, "Ip6OutMcastPkts") == 0)) Ip6OutMcastPkts = strtoull(value, NULL, 10);
386
- else if(unlikely(hash == hash_Ip6InOctets && strcmp(name, "Ip6InOctets") == 0)) Ip6InOctets = strtoull(value, NULL, 10);
387
- else if(unlikely(hash == hash_Ip6OutOctets && strcmp(name, "Ip6OutOctets") == 0)) Ip6OutOctets = strtoull(value, NULL, 10);
388
- else if(unlikely(hash == hash_Ip6InMcastOctets && strcmp(name, "Ip6InMcastOctets") == 0)) Ip6InMcastOctets = strtoull(value, NULL, 10);
389
- else if(unlikely(hash == hash_Ip6OutMcastOctets && strcmp(name, "Ip6OutMcastOctets") == 0)) Ip6OutMcastOctets = strtoull(value, NULL, 10);
390
- else if(unlikely(hash == hash_Ip6InBcastOctets && strcmp(name, "Ip6InBcastOctets") == 0)) Ip6InBcastOctets = strtoull(value, NULL, 10);
391
- else if(unlikely(hash == hash_Ip6OutBcastOctets && strcmp(name, "Ip6OutBcastOctets") == 0)) Ip6OutBcastOctets = strtoull(value, NULL, 10);
392
- else if(unlikely(hash == hash_Ip6InNoECTPkts && strcmp(name, "Ip6InNoECTPkts") == 0)) Ip6InNoECTPkts = strtoull(value, NULL, 10);
393
- else if(unlikely(hash == hash_Ip6InECT1Pkts && strcmp(name, "Ip6InECT1Pkts") == 0)) Ip6InECT1Pkts = strtoull(value, NULL, 10);
394
- else if(unlikely(hash == hash_Ip6InECT0Pkts && strcmp(name, "Ip6InECT0Pkts") == 0)) Ip6InECT0Pkts = strtoull(value, NULL, 10);
395
- else if(unlikely(hash == hash_Ip6InCEPkts && strcmp(name, "Ip6InCEPkts") == 0)) Ip6InCEPkts = strtoull(value, NULL, 10);
396
- else if(unlikely(hash == hash_Icmp6InMsgs && strcmp(name, "Icmp6InMsgs") == 0)) Icmp6InMsgs = strtoull(value, NULL, 10);
397
- else if(unlikely(hash == hash_Icmp6InErrors && strcmp(name, "Icmp6InErrors") == 0)) Icmp6InErrors = strtoull(value, NULL, 10);
398
- else if(unlikely(hash == hash_Icmp6OutMsgs && strcmp(name, "Icmp6OutMsgs") == 0)) Icmp6OutMsgs = strtoull(value, NULL, 10);
399
- else if(unlikely(hash == hash_Icmp6OutErrors && strcmp(name, "Icmp6OutErrors") == 0)) Icmp6OutErrors = strtoull(value, NULL, 10);
400
- else if(unlikely(hash == hash_Icmp6InCsumErrors && strcmp(name, "Icmp6InCsumErrors") == 0)) Icmp6InCsumErrors = strtoull(value, NULL, 10);
401
- else if(unlikely(hash == hash_Icmp6InDestUnreachs && strcmp(name, "Icmp6InDestUnreachs") == 0)) Icmp6InDestUnreachs = strtoull(value, NULL, 10);
402
- else if(unlikely(hash == hash_Icmp6InPktTooBigs && strcmp(name, "Icmp6InPktTooBigs") == 0)) Icmp6InPktTooBigs = strtoull(value, NULL, 10);
403
- else if(unlikely(hash == hash_Icmp6InTimeExcds && strcmp(name, "Icmp6InTimeExcds") == 0)) Icmp6InTimeExcds = strtoull(value, NULL, 10);
404
- else if(unlikely(hash == hash_Icmp6InParmProblems && strcmp(name, "Icmp6InParmProblems") == 0)) Icmp6InParmProblems = strtoull(value, NULL, 10);
405
- else if(unlikely(hash == hash_Icmp6InEchos && strcmp(name, "Icmp6InEchos") == 0)) Icmp6InEchos = strtoull(value, NULL, 10);
406
- else if(unlikely(hash == hash_Icmp6InEchoReplies && strcmp(name, "Icmp6InEchoReplies") == 0)) Icmp6InEchoReplies = strtoull(value, NULL, 10);
407
- else if(unlikely(hash == hash_Icmp6InGroupMembQueries && strcmp(name, "Icmp6InGroupMembQueries") == 0)) Icmp6InGroupMembQueries = strtoull(value, NULL, 10);
408
- else if(unlikely(hash == hash_Icmp6InGroupMembResponses && strcmp(name, "Icmp6InGroupMembResponses") == 0)) Icmp6InGroupMembResponses = strtoull(value, NULL, 10);
409
- else if(unlikely(hash == hash_Icmp6InGroupMembReductions && strcmp(name, "Icmp6InGroupMembReductions") == 0)) Icmp6InGroupMembReductions = strtoull(value, NULL, 10);
410
- else if(unlikely(hash == hash_Icmp6InRouterSolicits && strcmp(name, "Icmp6InRouterSolicits") == 0)) Icmp6InRouterSolicits = strtoull(value, NULL, 10);
411
- else if(unlikely(hash == hash_Icmp6InRouterAdvertisements && strcmp(name, "Icmp6InRouterAdvertisements") == 0)) Icmp6InRouterAdvertisements = strtoull(value, NULL, 10);
412
- else if(unlikely(hash == hash_Icmp6InNeighborSolicits && strcmp(name, "Icmp6InNeighborSolicits") == 0)) Icmp6InNeighborSolicits = strtoull(value, NULL, 10);
413
- else if(unlikely(hash == hash_Icmp6InNeighborAdvertisements && strcmp(name, "Icmp6InNeighborAdvertisements") == 0)) Icmp6InNeighborAdvertisements = strtoull(value, NULL, 10);
414
- else if(unlikely(hash == hash_Icmp6InRedirects && strcmp(name, "Icmp6InRedirects") == 0)) Icmp6InRedirects = strtoull(value, NULL, 10);
415
- else if(unlikely(hash == hash_Icmp6InMLDv2Reports && strcmp(name, "Icmp6InMLDv2Reports") == 0)) Icmp6InMLDv2Reports = strtoull(value, NULL, 10);
416
- else if(unlikely(hash == hash_Icmp6OutDestUnreachs && strcmp(name, "Icmp6OutDestUnreachs") == 0)) Icmp6OutDestUnreachs = strtoull(value, NULL, 10);
417
- else if(unlikely(hash == hash_Icmp6OutPktTooBigs && strcmp(name, "Icmp6OutPktTooBigs") == 0)) Icmp6OutPktTooBigs = strtoull(value, NULL, 10);
418
- else if(unlikely(hash == hash_Icmp6OutTimeExcds && strcmp(name, "Icmp6OutTimeExcds") == 0)) Icmp6OutTimeExcds = strtoull(value, NULL, 10);
419
- else if(unlikely(hash == hash_Icmp6OutParmProblems && strcmp(name, "Icmp6OutParmProblems") == 0)) Icmp6OutParmProblems = strtoull(value, NULL, 10);
420
- else if(unlikely(hash == hash_Icmp6OutEchos && strcmp(name, "Icmp6OutEchos") == 0)) Icmp6OutEchos = strtoull(value, NULL, 10);
421
- else if(unlikely(hash == hash_Icmp6OutEchoReplies && strcmp(name, "Icmp6OutEchoReplies") == 0)) Icmp6OutEchoReplies = strtoull(value, NULL, 10);
422
- else if(unlikely(hash == hash_Icmp6OutGroupMembQueries && strcmp(name, "Icmp6OutGroupMembQueries") == 0)) Icmp6OutGroupMembQueries = strtoull(value, NULL, 10);
423
- else if(unlikely(hash == hash_Icmp6OutGroupMembResponses && strcmp(name, "Icmp6OutGroupMembResponses") == 0)) Icmp6OutGroupMembResponses = strtoull(value, NULL, 10);
424
- else if(unlikely(hash == hash_Icmp6OutGroupMembReductions && strcmp(name, "Icmp6OutGroupMembReductions") == 0)) Icmp6OutGroupMembReductions = strtoull(value, NULL, 10);
425
- else if(unlikely(hash == hash_Icmp6OutRouterSolicits && strcmp(name, "Icmp6OutRouterSolicits") == 0)) Icmp6OutRouterSolicits = strtoull(value, NULL, 10);
426
- else if(unlikely(hash == hash_Icmp6OutRouterAdvertisements && strcmp(name, "Icmp6OutRouterAdvertisements") == 0)) Icmp6OutRouterAdvertisements = strtoull(value, NULL, 10);
427
- else if(unlikely(hash == hash_Icmp6OutNeighborSolicits && strcmp(name, "Icmp6OutNeighborSolicits") == 0)) Icmp6OutNeighborSolicits = strtoull(value, NULL, 10);
428
- else if(unlikely(hash == hash_Icmp6OutNeighborAdvertisements && strcmp(name, "Icmp6OutNeighborAdvertisements") == 0)) Icmp6OutNeighborAdvertisements = strtoull(value, NULL, 10);
429
- else if(unlikely(hash == hash_Icmp6OutRedirects && strcmp(name, "Icmp6OutRedirects") == 0)) Icmp6OutRedirects = strtoull(value, NULL, 10);
430
- else if(unlikely(hash == hash_Icmp6OutMLDv2Reports && strcmp(name, "Icmp6OutMLDv2Reports") == 0)) Icmp6OutMLDv2Reports = strtoull(value, NULL, 10);
431
- else if(unlikely(hash == hash_Icmp6InType1 && strcmp(name, "Icmp6InType1") == 0)) Icmp6InType1 = strtoull(value, NULL, 10);
432
- else if(unlikely(hash == hash_Icmp6InType128 && strcmp(name, "Icmp6InType128") == 0)) Icmp6InType128 = strtoull(value, NULL, 10);
433
- else if(unlikely(hash == hash_Icmp6InType129 && strcmp(name, "Icmp6InType129") == 0)) Icmp6InType129 = strtoull(value, NULL, 10);
434
- else if(unlikely(hash == hash_Icmp6InType136 && strcmp(name, "Icmp6InType136") == 0)) Icmp6InType136 = strtoull(value, NULL, 10);
435
- else if(unlikely(hash == hash_Icmp6OutType1 && strcmp(name, "Icmp6OutType1") == 0)) Icmp6OutType1 = strtoull(value, NULL, 10);
436
- else if(unlikely(hash == hash_Icmp6OutType128 && strcmp(name, "Icmp6OutType128") == 0)) Icmp6OutType128 = strtoull(value, NULL, 10);
437
- else if(unlikely(hash == hash_Icmp6OutType129 && strcmp(name, "Icmp6OutType129") == 0)) Icmp6OutType129 = strtoull(value, NULL, 10);
438
- else if(unlikely(hash == hash_Icmp6OutType133 && strcmp(name, "Icmp6OutType133") == 0)) Icmp6OutType133 = strtoull(value, NULL, 10);
439
- else if(unlikely(hash == hash_Icmp6OutType135 && strcmp(name, "Icmp6OutType135") == 0)) Icmp6OutType135 = strtoull(value, NULL, 10);
440
- else if(unlikely(hash == hash_Icmp6OutType143 && strcmp(name, "Icmp6OutType143") == 0)) Icmp6OutType143 = strtoull(value, NULL, 10);
441
- else if(unlikely(hash == hash_Udp6InDatagrams && strcmp(name, "Udp6InDatagrams") == 0)) Udp6InDatagrams = strtoull(value, NULL, 10);
442
- else if(unlikely(hash == hash_Udp6NoPorts && strcmp(name, "Udp6NoPorts") == 0)) Udp6NoPorts = strtoull(value, NULL, 10);
443
- else if(unlikely(hash == hash_Udp6InErrors && strcmp(name, "Udp6InErrors") == 0)) Udp6InErrors = strtoull(value, NULL, 10);
444
- else if(unlikely(hash == hash_Udp6OutDatagrams && strcmp(name, "Udp6OutDatagrams") == 0)) Udp6OutDatagrams = strtoull(value, NULL, 10);
445
- else if(unlikely(hash == hash_Udp6RcvbufErrors && strcmp(name, "Udp6RcvbufErrors") == 0)) Udp6RcvbufErrors = strtoull(value, NULL, 10);
446
- else if(unlikely(hash == hash_Udp6SndbufErrors && strcmp(name, "Udp6SndbufErrors") == 0)) Udp6SndbufErrors = strtoull(value, NULL, 10);
447
- else if(unlikely(hash == hash_Udp6InCsumErrors && strcmp(name, "Udp6InCsumErrors") == 0)) Udp6InCsumErrors = strtoull(value, NULL, 10);
448
- else if(unlikely(hash == hash_Udp6IgnoredMulti && strcmp(name, "Udp6IgnoredMulti") == 0)) Udp6IgnoredMulti = strtoull(value, NULL, 10);
449
- else if(unlikely(hash == hash_UdpLite6InDatagrams && strcmp(name, "UdpLite6InDatagrams") == 0)) UdpLite6InDatagrams = strtoull(value, NULL, 10);
450
- else if(unlikely(hash == hash_UdpLite6NoPorts && strcmp(name, "UdpLite6NoPorts") == 0)) UdpLite6NoPorts = strtoull(value, NULL, 10);
451
- else if(unlikely(hash == hash_UdpLite6InErrors && strcmp(name, "UdpLite6InErrors") == 0)) UdpLite6InErrors = strtoull(value, NULL, 10);
452
- else if(unlikely(hash == hash_UdpLite6OutDatagrams && strcmp(name, "UdpLite6OutDatagrams") == 0)) UdpLite6OutDatagrams = strtoull(value, NULL, 10);
453
- else if(unlikely(hash == hash_UdpLite6RcvbufErrors && strcmp(name, "UdpLite6RcvbufErrors") == 0)) UdpLite6RcvbufErrors = strtoull(value, NULL, 10);
454
- else if(unlikely(hash == hash_UdpLite6SndbufErrors && strcmp(name, "UdpLite6SndbufErrors") == 0)) UdpLite6SndbufErrors = strtoull(value, NULL, 10);
455
- else if(unlikely(hash == hash_UdpLite6InCsumErrors && strcmp(name, "UdpLite6InCsumErrors") == 0)) UdpLite6InCsumErrors = strtoull(value, NULL, 10);
366
+ if(unlikely(hash == hash_Ip6InReceives && strcmp(name, "Ip6InReceives") == 0)) ptr = &Ip6InReceives;
367
+ else if(unlikely(hash == hash_Ip6InHdrErrors && strcmp(name, "Ip6InHdrErrors") == 0)) ptr = &Ip6InHdrErrors;
368
+ else if(unlikely(hash == hash_Ip6InTooBigErrors && strcmp(name, "Ip6InTooBigErrors") == 0)) ptr = &Ip6InTooBigErrors;
369
+ else if(unlikely(hash == hash_Ip6InNoRoutes && strcmp(name, "Ip6InNoRoutes") == 0)) ptr = &Ip6InNoRoutes;
370
+ else if(unlikely(hash == hash_Ip6InAddrErrors && strcmp(name, "Ip6InAddrErrors") == 0)) ptr = &Ip6InAddrErrors;
371
+ else if(unlikely(hash == hash_Ip6InUnknownProtos && strcmp(name, "Ip6InUnknownProtos") == 0)) ptr = &Ip6InUnknownProtos;
372
+ else if(unlikely(hash == hash_Ip6InTruncatedPkts && strcmp(name, "Ip6InTruncatedPkts") == 0)) ptr = &Ip6InTruncatedPkts;
373
+ else if(unlikely(hash == hash_Ip6InDiscards && strcmp(name, "Ip6InDiscards") == 0)) ptr = &Ip6InDiscards;
374
+ else if(unlikely(hash == hash_Ip6InDelivers && strcmp(name, "Ip6InDelivers") == 0)) ptr = &Ip6InDelivers;
375
+ else if(unlikely(hash == hash_Ip6OutForwDatagrams && strcmp(name, "Ip6OutForwDatagrams") == 0)) ptr = &Ip6OutForwDatagrams;
376
+ else if(unlikely(hash == hash_Ip6OutRequests && strcmp(name, "Ip6OutRequests") == 0)) ptr = &Ip6OutRequests;
377
+ else if(unlikely(hash == hash_Ip6OutDiscards && strcmp(name, "Ip6OutDiscards") == 0)) ptr = &Ip6OutDiscards;
378
+ else if(unlikely(hash == hash_Ip6OutNoRoutes && strcmp(name, "Ip6OutNoRoutes") == 0)) ptr = &Ip6OutNoRoutes;
379
+ else if(unlikely(hash == hash_Ip6ReasmTimeout && strcmp(name, "Ip6ReasmTimeout") == 0)) ptr = &Ip6ReasmTimeout;
380
+ else if(unlikely(hash == hash_Ip6ReasmReqds && strcmp(name, "Ip6ReasmReqds") == 0)) ptr = &Ip6ReasmReqds;
381
+ else if(unlikely(hash == hash_Ip6ReasmOKs && strcmp(name, "Ip6ReasmOKs") == 0)) ptr = &Ip6ReasmOKs;
382
+ else if(unlikely(hash == hash_Ip6ReasmFails && strcmp(name, "Ip6ReasmFails") == 0)) ptr = &Ip6ReasmFails;
383
+ else if(unlikely(hash == hash_Ip6FragOKs && strcmp(name, "Ip6FragOKs") == 0)) ptr = &Ip6FragOKs;
384
+ else if(unlikely(hash == hash_Ip6FragFails && strcmp(name, "Ip6FragFails") == 0)) ptr = &Ip6FragFails;
385
+ else if(unlikely(hash == hash_Ip6FragCreates && strcmp(name, "Ip6FragCreates") == 0)) ptr = &Ip6FragCreates;
386
+ else if(unlikely(hash == hash_Ip6InMcastPkts && strcmp(name, "Ip6InMcastPkts") == 0)) ptr = &Ip6InMcastPkts;
387
+ else if(unlikely(hash == hash_Ip6OutMcastPkts && strcmp(name, "Ip6OutMcastPkts") == 0)) ptr = &Ip6OutMcastPkts;
388
+ else if(unlikely(hash == hash_Ip6InOctets && strcmp(name, "Ip6InOctets") == 0)) ptr = &Ip6InOctets;
389
+ else if(unlikely(hash == hash_Ip6OutOctets && strcmp(name, "Ip6OutOctets") == 0)) ptr = &Ip6OutOctets;
390
+ else if(unlikely(hash == hash_Ip6InMcastOctets && strcmp(name, "Ip6InMcastOctets") == 0)) ptr = &Ip6InMcastOctets;
391
+ else if(unlikely(hash == hash_Ip6OutMcastOctets && strcmp(name, "Ip6OutMcastOctets") == 0)) ptr = &Ip6OutMcastOctets;
392
+ else if(unlikely(hash == hash_Ip6InBcastOctets && strcmp(name, "Ip6InBcastOctets") == 0)) ptr = &Ip6InBcastOctets;
393
+ else if(unlikely(hash == hash_Ip6OutBcastOctets && strcmp(name, "Ip6OutBcastOctets") == 0)) ptr = &Ip6OutBcastOctets;
394
+ else if(unlikely(hash == hash_Ip6InNoECTPkts && strcmp(name, "Ip6InNoECTPkts") == 0)) ptr = &Ip6InNoECTPkts;
395
+ else if(unlikely(hash == hash_Ip6InECT1Pkts && strcmp(name, "Ip6InECT1Pkts") == 0)) ptr = &Ip6InECT1Pkts;
396
+ else if(unlikely(hash == hash_Ip6InECT0Pkts && strcmp(name, "Ip6InECT0Pkts") == 0)) ptr = &Ip6InECT0Pkts;
397
+ else if(unlikely(hash == hash_Ip6InCEPkts && strcmp(name, "Ip6InCEPkts") == 0)) ptr = &Ip6InCEPkts;
398
+ else if(unlikely(hash == hash_Icmp6InMsgs && strcmp(name, "Icmp6InMsgs") == 0)) ptr = &Icmp6InMsgs;
399
+ else if(unlikely(hash == hash_Icmp6InErrors && strcmp(name, "Icmp6InErrors") == 0)) ptr = &Icmp6InErrors;
400
+ else if(unlikely(hash == hash_Icmp6OutMsgs && strcmp(name, "Icmp6OutMsgs") == 0)) ptr = &Icmp6OutMsgs;
401
+ else if(unlikely(hash == hash_Icmp6OutErrors && strcmp(name, "Icmp6OutErrors") == 0)) ptr = &Icmp6OutErrors;
402
+ else if(unlikely(hash == hash_Icmp6InCsumErrors && strcmp(name, "Icmp6InCsumErrors") == 0)) ptr = &Icmp6InCsumErrors;
403
+ else if(unlikely(hash == hash_Icmp6InDestUnreachs && strcmp(name, "Icmp6InDestUnreachs") == 0)) ptr = &Icmp6InDestUnreachs;
404
+ else if(unlikely(hash == hash_Icmp6InPktTooBigs && strcmp(name, "Icmp6InPktTooBigs") == 0)) ptr = &Icmp6InPktTooBigs;
405
+ else if(unlikely(hash == hash_Icmp6InTimeExcds && strcmp(name, "Icmp6InTimeExcds") == 0)) ptr = &Icmp6InTimeExcds;
406
+ else if(unlikely(hash == hash_Icmp6InParmProblems && strcmp(name, "Icmp6InParmProblems") == 0)) ptr = &Icmp6InParmProblems;
407
+ else if(unlikely(hash == hash_Icmp6InEchos && strcmp(name, "Icmp6InEchos") == 0)) ptr = &Icmp6InEchos;
408
+ else if(unlikely(hash == hash_Icmp6InEchoReplies && strcmp(name, "Icmp6InEchoReplies") == 0)) ptr = &Icmp6InEchoReplies;
409
+ else if(unlikely(hash == hash_Icmp6InGroupMembQueries && strcmp(name, "Icmp6InGroupMembQueries") == 0)) ptr = &Icmp6InGroupMembQueries;
410
+ else if(unlikely(hash == hash_Icmp6InGroupMembResponses && strcmp(name, "Icmp6InGroupMembResponses") == 0)) ptr = &Icmp6InGroupMembResponses;
411
+ else if(unlikely(hash == hash_Icmp6InGroupMembReductions && strcmp(name, "Icmp6InGroupMembReductions") == 0)) ptr = &Icmp6InGroupMembReductions;
412
+ else if(unlikely(hash == hash_Icmp6InRouterSolicits && strcmp(name, "Icmp6InRouterSolicits") == 0)) ptr = &Icmp6InRouterSolicits;
413
+ else if(unlikely(hash == hash_Icmp6InRouterAdvertisements && strcmp(name, "Icmp6InRouterAdvertisements") == 0)) ptr = &Icmp6InRouterAdvertisements;
414
+ else if(unlikely(hash == hash_Icmp6InNeighborSolicits && strcmp(name, "Icmp6InNeighborSolicits") == 0)) ptr = &Icmp6InNeighborSolicits;
415
+ else if(unlikely(hash == hash_Icmp6InNeighborAdvertisements && strcmp(name, "Icmp6InNeighborAdvertisements") == 0)) ptr = &Icmp6InNeighborAdvertisements;
416
+ else if(unlikely(hash == hash_Icmp6InRedirects && strcmp(name, "Icmp6InRedirects") == 0)) ptr = &Icmp6InRedirects;
417
+ else if(unlikely(hash == hash_Icmp6InMLDv2Reports && strcmp(name, "Icmp6InMLDv2Reports") == 0)) ptr = &Icmp6InMLDv2Reports;
418
+ else if(unlikely(hash == hash_Icmp6OutDestUnreachs && strcmp(name, "Icmp6OutDestUnreachs") == 0)) ptr = &Icmp6OutDestUnreachs;
419
+ else if(unlikely(hash == hash_Icmp6OutPktTooBigs && strcmp(name, "Icmp6OutPktTooBigs") == 0)) ptr = &Icmp6OutPktTooBigs;
420
+ else if(unlikely(hash == hash_Icmp6OutTimeExcds && strcmp(name, "Icmp6OutTimeExcds") == 0)) ptr = &Icmp6OutTimeExcds;
421
+ else if(unlikely(hash == hash_Icmp6OutParmProblems && strcmp(name, "Icmp6OutParmProblems") == 0)) ptr = &Icmp6OutParmProblems;
422
+ else if(unlikely(hash == hash_Icmp6OutEchos && strcmp(name, "Icmp6OutEchos") == 0)) ptr = &Icmp6OutEchos;
423
+ else if(unlikely(hash == hash_Icmp6OutEchoReplies && strcmp(name, "Icmp6OutEchoReplies") == 0)) ptr = &Icmp6OutEchoReplies;
424
+ else if(unlikely(hash == hash_Icmp6OutGroupMembQueries && strcmp(name, "Icmp6OutGroupMembQueries") == 0)) ptr = &Icmp6OutGroupMembQueries;
425
+ else if(unlikely(hash == hash_Icmp6OutGroupMembResponses && strcmp(name, "Icmp6OutGroupMembResponses") == 0)) ptr = &Icmp6OutGroupMembResponses;
426
+ else if(unlikely(hash == hash_Icmp6OutGroupMembReductions && strcmp(name, "Icmp6OutGroupMembReductions") == 0)) ptr = &Icmp6OutGroupMembReductions;
427
+ else if(unlikely(hash == hash_Icmp6OutRouterSolicits && strcmp(name, "Icmp6OutRouterSolicits") == 0)) ptr = &Icmp6OutRouterSolicits;
428
+ else if(unlikely(hash == hash_Icmp6OutRouterAdvertisements && strcmp(name, "Icmp6OutRouterAdvertisements") == 0)) ptr = &Icmp6OutRouterAdvertisements;
429
+ else if(unlikely(hash == hash_Icmp6OutNeighborSolicits && strcmp(name, "Icmp6OutNeighborSolicits") == 0)) ptr = &Icmp6OutNeighborSolicits;
430
+ else if(unlikely(hash == hash_Icmp6OutNeighborAdvertisements && strcmp(name, "Icmp6OutNeighborAdvertisements") == 0)) ptr = &Icmp6OutNeighborAdvertisements;
431
+ else if(unlikely(hash == hash_Icmp6OutRedirects && strcmp(name, "Icmp6OutRedirects") == 0)) ptr = &Icmp6OutRedirects;
432
+ else if(unlikely(hash == hash_Icmp6OutMLDv2Reports && strcmp(name, "Icmp6OutMLDv2Reports") == 0)) ptr = &Icmp6OutMLDv2Reports;
433
+ else if(unlikely(hash == hash_Icmp6InType1 && strcmp(name, "Icmp6InType1") == 0)) ptr = &Icmp6InType1;
434
+ else if(unlikely(hash == hash_Icmp6InType128 && strcmp(name, "Icmp6InType128") == 0)) ptr = &Icmp6InType128;
435
+ else if(unlikely(hash == hash_Icmp6InType129 && strcmp(name, "Icmp6InType129") == 0)) ptr = &Icmp6InType129;
436
+ else if(unlikely(hash == hash_Icmp6InType136 && strcmp(name, "Icmp6InType136") == 0)) ptr = &Icmp6InType136;
437
+ else if(unlikely(hash == hash_Icmp6OutType1 && strcmp(name, "Icmp6OutType1") == 0)) ptr = &Icmp6OutType1;
438
+ else if(unlikely(hash == hash_Icmp6OutType128 && strcmp(name, "Icmp6OutType128") == 0)) ptr = &Icmp6OutType128;
439
+ else if(unlikely(hash == hash_Icmp6OutType129 && strcmp(name, "Icmp6OutType129") == 0)) ptr = &Icmp6OutType129;
440
+ else if(unlikely(hash == hash_Icmp6OutType133 && strcmp(name, "Icmp6OutType133") == 0)) ptr = &Icmp6OutType133;
441
+ else if(unlikely(hash == hash_Icmp6OutType135 && strcmp(name, "Icmp6OutType135") == 0)) ptr = &Icmp6OutType135;
442
+ else if(unlikely(hash == hash_Icmp6OutType143 && strcmp(name, "Icmp6OutType143") == 0)) ptr = &Icmp6OutType143;
443
+ else if(unlikely(hash == hash_Udp6InDatagrams && strcmp(name, "Udp6InDatagrams") == 0)) ptr = &Udp6InDatagrams;
444
+ else if(unlikely(hash == hash_Udp6NoPorts && strcmp(name, "Udp6NoPorts") == 0)) ptr = &Udp6NoPorts;
445
+ else if(unlikely(hash == hash_Udp6InErrors && strcmp(name, "Udp6InErrors") == 0)) ptr = &Udp6InErrors;
446
+ else if(unlikely(hash == hash_Udp6OutDatagrams && strcmp(name, "Udp6OutDatagrams") == 0)) ptr = &Udp6OutDatagrams;
447
+ else if(unlikely(hash == hash_Udp6RcvbufErrors && strcmp(name, "Udp6RcvbufErrors") == 0)) ptr = &Udp6RcvbufErrors;
448
+ else if(unlikely(hash == hash_Udp6SndbufErrors && strcmp(name, "Udp6SndbufErrors") == 0)) ptr = &Udp6SndbufErrors;
449
+ else if(unlikely(hash == hash_Udp6InCsumErrors && strcmp(name, "Udp6InCsumErrors") == 0)) ptr = &Udp6InCsumErrors;
450
+ else if(unlikely(hash == hash_Udp6IgnoredMulti && strcmp(name, "Udp6IgnoredMulti") == 0)) ptr = &Udp6IgnoredMulti;
451
+ else if(unlikely(hash == hash_UdpLite6InDatagrams && strcmp(name, "UdpLite6InDatagrams") == 0)) ptr = &UdpLite6InDatagrams;
452
+ else if(unlikely(hash == hash_UdpLite6NoPorts && strcmp(name, "UdpLite6NoPorts") == 0)) ptr = &UdpLite6NoPorts;
453
+ else if(unlikely(hash == hash_UdpLite6InErrors && strcmp(name, "UdpLite6InErrors") == 0)) ptr = &UdpLite6InErrors;
454
+ else if(unlikely(hash == hash_UdpLite6OutDatagrams && strcmp(name, "UdpLite6OutDatagrams") == 0)) ptr = &UdpLite6OutDatagrams;
455
+ else if(unlikely(hash == hash_UdpLite6RcvbufErrors && strcmp(name, "UdpLite6RcvbufErrors") == 0)) ptr = &UdpLite6RcvbufErrors;
456
+ else if(unlikely(hash == hash_UdpLite6SndbufErrors && strcmp(name, "UdpLite6SndbufErrors") == 0)) ptr = &UdpLite6SndbufErrors;
457
+ else if(unlikely(hash == hash_UdpLite6InCsumErrors && strcmp(name, "UdpLite6InCsumErrors") == 0)) ptr = &UdpLite6InCsumErrors;
458
+
459
+ if(unlikely(ptr)) {
460
+ *ptr = str2ull(value);
461
+ ptr = NULL;
462
+ }
463
}
464
465
RRDSET *st;
src/proc_net_softnet_stat.c
+1
-1
@@ -62,7 +62,7 @@ int do_proc_net_softnet_stat(int update_every, usec_t dt) {
62
63
for(w = 0; w < words ; w++) {
64
if(unlikely(softnet_column_name(w))) {
65
- uint32_t t = strtoul(procfile_lineword(ff, l, w), NULL, 16);
65
+ uint32_t t = (uint32_t)strtoul(procfile_lineword(ff, l, w), NULL, 16);
66
data[w] += t;
67
data[((l + 1) * allocated_columns) + w] = t;
68
}
src/proc_self_mountinfo.c
+4
-4
@@ -197,8 +197,8 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
197
mi = mallocz(sizeof(struct mountinfo));
198
199
unsigned long w = 0;
200
- mi->id = strtoul(procfile_lineword(ff, l, w), NULL, 10); w++;
201
- mi->parentid = strtoul(procfile_lineword(ff, l, w), NULL, 10); w++;
200
+ mi->id = str2ul(procfile_lineword(ff, l, w)); w++;
201
+ mi->parentid = str2ul(procfile_lineword(ff, l, w)); w++;
202
203
char *major = procfile_lineword(ff, l, w), *minor; w++;
204
for(minor = major; *minor && *minor != ':' ;minor++) ;
@@ -214,8 +214,8 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
214
215
mi->flags = 0;
216
217
- mi->major = strtoul(major, NULL, 10);
218
- mi->minor = strtoul(minor, NULL, 10);
217
+ mi->major = str2ul(major);
218
+ mi->minor = str2ul(minor);
219
220
mi->root = strdupz(procfile_lineword(ff, l, w)); w++;
221
mi->root_hash = simple_hash(mi->root);
src/proc_softirqs.c
+1
-1
@@ -112,7 +112,7 @@ int do_proc_softirqs(int update_every, usec_t dt) {
112
int c;
113
for(c = 0; c < cpus ;c++) {
114
if(likely((c + 1) < (int)words))
115
- irr->cpu[c].value = strtoull(procfile_lineword(ff, l, (uint32_t)(c + 1)), NULL, 10);
115
+ irr->cpu[c].value = str2ull(procfile_lineword(ff, l, (uint32_t)(c + 1)));
116
else
117
irr->cpu[c].value = 0;
118
src/proc_stat.c
+16
-16
@@ -54,19 +54,19 @@ int do_proc_stat(int update_every, usec_t dt) {
54
unsigned long long user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0, steal = 0, guest = 0, guest_nice = 0;
55
56
id = row_key;
57
- user = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
58
- nice = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
59
- system = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
60
- idle = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
61
- iowait = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
62
- irq = strtoull(procfile_lineword(ff, l, 6), NULL, 10);
63
- softirq = strtoull(procfile_lineword(ff, l, 7), NULL, 10);
64
- steal = strtoull(procfile_lineword(ff, l, 8), NULL, 10);
65
-
66
- guest = strtoull(procfile_lineword(ff, l, 9), NULL, 10);
57
+ user = str2ull(procfile_lineword(ff, l, 1));
58
+ nice = str2ull(procfile_lineword(ff, l, 2));
59
+ system = str2ull(procfile_lineword(ff, l, 3));
60
+ idle = str2ull(procfile_lineword(ff, l, 4));
61
+ iowait = str2ull(procfile_lineword(ff, l, 5));
62
+ irq = str2ull(procfile_lineword(ff, l, 6));
63
+ softirq = str2ull(procfile_lineword(ff, l, 7));
64
+ steal = str2ull(procfile_lineword(ff, l, 8));
65
+
66
+ guest = str2ull(procfile_lineword(ff, l, 9));
67
user -= guest;
68
69
- guest_nice = strtoull(procfile_lineword(ff, l, 10), NULL, 10);
69
+ guest_nice = str2ull(procfile_lineword(ff, l, 10));
70
nice -= guest_nice;
71
72
char *title, *type, *context, *family;
@@ -127,7 +127,7 @@ int do_proc_stat(int update_every, usec_t dt) {
127
}
128
}
129
else if(unlikely(hash == hash_intr && strcmp(row_key, "intr") == 0)) {
130
- unsigned long long value = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
130
+ unsigned long long value = str2ull(procfile_lineword(ff, l, 1));
131
132
// --------------------------------------------------------------------
133
@@ -146,7 +146,7 @@ int do_proc_stat(int update_every, usec_t dt) {
146
}
147
}
148
else if(unlikely(hash == hash_ctxt && strcmp(row_key, "ctxt") == 0)) {
149
- unsigned long long value = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
149
+ unsigned long long value = str2ull(procfile_lineword(ff, l, 1));
150
151
// --------------------------------------------------------------------
152
@@ -164,13 +164,13 @@ int do_proc_stat(int update_every, usec_t dt) {
164
}
165
}
166
else if(unlikely(hash == hash_processes && !processes && strcmp(row_key, "processes") == 0)) {
167
- processes = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
167
+ processes = str2ull(procfile_lineword(ff, l, 1));
168
}
169
else if(unlikely(hash == hash_procs_running && !running && strcmp(row_key, "procs_running") == 0)) {
170
- running = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
170
+ running = str2ull(procfile_lineword(ff, l, 1));
171
}
172
else if(unlikely(hash == hash_procs_blocked && !blocked && strcmp(row_key, "procs_blocked") == 0)) {
173
- blocked = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
173
+ blocked = str2ull(procfile_lineword(ff, l, 1));
174
}
175
}
176
src/proc_sys_kernel_random_entropy_avail.c
+1
-1
@@ -15,7 +15,7 @@ int do_proc_sys_kernel_random_entropy_avail(int update_every, usec_t dt) {
15
ff = procfile_readall(ff);
16
if(unlikely(!ff)) return 0; // we return 0, so that we will retry to open it next time
17
18
- unsigned long long entropy = strtoull(procfile_lineword(ff, 0, 0), NULL, 10);
18
+ unsigned long long entropy = str2ull(procfile_lineword(ff, 0, 0));
19
20
RRDSET *st = rrdset_find_bytype("system", "entropy");
21
if(unlikely(!st)) {
src/proc_vmstat.c
+132
-125
@@ -404,6 +404,8 @@ int do_proc_vmstat(int update_every, usec_t dt) {
404
// unsigned long long workingset_refault = 0ULL;
405
// unsigned long long zone_reclaim_failed = 0ULL;
406
407
+ unsigned long long *ptr = NULL;
408
+
409
for(l = 0; l < lines ;l++) {
410
uint32_t words = procfile_linewords(ff, l);
411
if(unlikely(words < 2)) {
@@ -418,131 +420,136 @@ int do_proc_vmstat(int update_every, usec_t dt) {
420
uint32_t hash = simple_hash(name);
421
422
if(unlikely(0)) ;
421
- // else if(unlikely(hash == hash_allocstall_dma32 && strcmp(name, "allocstall_dma32") == 0)) allocstall_dma32 = strtoull(value, NULL, 10);
422
- // else if(unlikely(hash == hash_allocstall_dma && strcmp(name, "allocstall_dma") == 0)) allocstall_dma = strtoull(value, NULL, 10);
423
- // else if(unlikely(hash == hash_allocstall_movable && strcmp(name, "allocstall_movable") == 0)) allocstall_movable = strtoull(value, NULL, 10);
424
- // else if(unlikely(hash == hash_allocstall_normal && strcmp(name, "allocstall_normal") == 0)) allocstall_normal = strtoull(value, NULL, 10);
425
- // else if(unlikely(hash == hash_balloon_deflate && strcmp(name, "balloon_deflate") == 0)) balloon_deflate = strtoull(value, NULL, 10);
426
- // else if(unlikely(hash == hash_balloon_inflate && strcmp(name, "balloon_inflate") == 0)) balloon_inflate = strtoull(value, NULL, 10);
427
- // else if(unlikely(hash == hash_balloon_migrate && strcmp(name, "balloon_migrate") == 0)) balloon_migrate = strtoull(value, NULL, 10);
428
- // else if(unlikely(hash == hash_compact_daemon_wake && strcmp(name, "compact_daemon_wake") == 0)) compact_daemon_wake = strtoull(value, NULL, 10);
429
- // else if(unlikely(hash == hash_compact_fail && strcmp(name, "compact_fail") == 0)) compact_fail = strtoull(value, NULL, 10);
430
- // else if(unlikely(hash == hash_compact_free_scanned && strcmp(name, "compact_free_scanned") == 0)) compact_free_scanned = strtoull(value, NULL, 10);
431
- // else if(unlikely(hash == hash_compact_isolated && strcmp(name, "compact_isolated") == 0)) compact_isolated = strtoull(value, NULL, 10);
432
- // else if(unlikely(hash == hash_compact_migrate_scanned && strcmp(name, "compact_migrate_scanned") == 0)) compact_migrate_scanned = strtoull(value, NULL, 10);
433
- // else if(unlikely(hash == hash_compact_stall && strcmp(name, "compact_stall") == 0)) compact_stall = strtoull(value, NULL, 10);
434
- // else if(unlikely(hash == hash_compact_success && strcmp(name, "compact_success") == 0)) compact_success = strtoull(value, NULL, 10);
435
- // else if(unlikely(hash == hash_drop_pagecache && strcmp(name, "drop_pagecache") == 0)) drop_pagecache = strtoull(value, NULL, 10);
436
- // else if(unlikely(hash == hash_drop_slab && strcmp(name, "drop_slab") == 0)) drop_slab = strtoull(value, NULL, 10);
437
- // else if(unlikely(hash == hash_htlb_buddy_alloc_fail && strcmp(name, "htlb_buddy_alloc_fail") == 0)) htlb_buddy_alloc_fail = strtoull(value, NULL, 10);
438
- // else if(unlikely(hash == hash_htlb_buddy_alloc_success && strcmp(name, "htlb_buddy_alloc_success") == 0)) htlb_buddy_alloc_success = strtoull(value, NULL, 10);
439
- // else if(unlikely(hash == hash_kswapd_high_wmark_hit_quickly && strcmp(name, "kswapd_high_wmark_hit_quickly") == 0)) kswapd_high_wmark_hit_quickly = strtoull(value, NULL, 10);
440
- // else if(unlikely(hash == hash_kswapd_inodesteal && strcmp(name, "kswapd_inodesteal") == 0)) kswapd_inodesteal = strtoull(value, NULL, 10);
441
- // else if(unlikely(hash == hash_kswapd_low_wmark_hit_quickly && strcmp(name, "kswapd_low_wmark_hit_quickly") == 0)) kswapd_low_wmark_hit_quickly = strtoull(value, NULL, 10);
442
- // else if(unlikely(hash == hash_nr_active_anon && strcmp(name, "nr_active_anon") == 0)) nr_active_anon = strtoull(value, NULL, 10);
443
- // else if(unlikely(hash == hash_nr_active_file && strcmp(name, "nr_active_file") == 0)) nr_active_file = strtoull(value, NULL, 10);
444
- // else if(unlikely(hash == hash_nr_anon_pages && strcmp(name, "nr_anon_pages") == 0)) nr_anon_pages = strtoull(value, NULL, 10);
445
- // else if(unlikely(hash == hash_nr_anon_transparent_hugepages && strcmp(name, "nr_anon_transparent_hugepages") == 0)) nr_anon_transparent_hugepages = strtoull(value, NULL, 10);
446
- // else if(unlikely(hash == hash_nr_bounce && strcmp(name, "nr_bounce") == 0)) nr_bounce = strtoull(value, NULL, 10);
447
- // else if(unlikely(hash == hash_nr_dirtied && strcmp(name, "nr_dirtied") == 0)) nr_dirtied = strtoull(value, NULL, 10);
448
- // else if(unlikely(hash == hash_nr_dirty_background_threshold && strcmp(name, "nr_dirty_background_threshold") == 0)) nr_dirty_background_threshold = strtoull(value, NULL, 10);
449
- // else if(unlikely(hash == hash_nr_dirty && strcmp(name, "nr_dirty") == 0)) nr_dirty = strtoull(value, NULL, 10);
450
- // else if(unlikely(hash == hash_nr_dirty_threshold && strcmp(name, "nr_dirty_threshold") == 0)) nr_dirty_threshold = strtoull(value, NULL, 10);
451
- // else if(unlikely(hash == hash_nr_file_pages && strcmp(name, "nr_file_pages") == 0)) nr_file_pages = strtoull(value, NULL, 10);
452
- // else if(unlikely(hash == hash_nr_free_cma && strcmp(name, "nr_free_cma") == 0)) nr_free_cma = strtoull(value, NULL, 10);
453
- // else if(unlikely(hash == hash_nr_free_pages && strcmp(name, "nr_free_pages") == 0)) nr_free_pages = strtoull(value, NULL, 10);
454
- // else if(unlikely(hash == hash_nr_inactive_anon && strcmp(name, "nr_inactive_anon") == 0)) nr_inactive_anon = strtoull(value, NULL, 10);
455
- // else if(unlikely(hash == hash_nr_inactive_file && strcmp(name, "nr_inactive_file") == 0)) nr_inactive_file = strtoull(value, NULL, 10);
456
- // else if(unlikely(hash == hash_nr_isolated_anon && strcmp(name, "nr_isolated_anon") == 0)) nr_isolated_anon = strtoull(value, NULL, 10);
457
- // else if(unlikely(hash == hash_nr_isolated_file && strcmp(name, "nr_isolated_file") == 0)) nr_isolated_file = strtoull(value, NULL, 10);
458
- // else if(unlikely(hash == hash_nr_kernel_stack && strcmp(name, "nr_kernel_stack") == 0)) nr_kernel_stack = strtoull(value, NULL, 10);
459
- // else if(unlikely(hash == hash_nr_mapped && strcmp(name, "nr_mapped") == 0)) nr_mapped = strtoull(value, NULL, 10);
460
- // else if(unlikely(hash == hash_nr_mlock && strcmp(name, "nr_mlock") == 0)) nr_mlock = strtoull(value, NULL, 10);
461
- // else if(unlikely(hash == hash_nr_pages_scanned && strcmp(name, "nr_pages_scanned") == 0)) nr_pages_scanned = strtoull(value, NULL, 10);
462
- // else if(unlikely(hash == hash_nr_page_table_pages && strcmp(name, "nr_page_table_pages") == 0)) nr_page_table_pages = strtoull(value, NULL, 10);
463
- // else if(unlikely(hash == hash_nr_shmem_hugepages && strcmp(name, "nr_shmem_hugepages") == 0)) nr_shmem_hugepages = strtoull(value, NULL, 10);
464
- // else if(unlikely(hash == hash_nr_shmem_pmdmapped && strcmp(name, "nr_shmem_pmdmapped") == 0)) nr_shmem_pmdmapped = strtoull(value, NULL, 10);
465
- // else if(unlikely(hash == hash_nr_shmem && strcmp(name, "nr_shmem") == 0)) nr_shmem = strtoull(value, NULL, 10);
466
- // else if(unlikely(hash == hash_nr_slab_reclaimable && strcmp(name, "nr_slab_reclaimable") == 0)) nr_slab_reclaimable = strtoull(value, NULL, 10);
467
- // else if(unlikely(hash == hash_nr_slab_unreclaimable && strcmp(name, "nr_slab_unreclaimable") == 0)) nr_slab_unreclaimable = strtoull(value, NULL, 10);
468
- // else if(unlikely(hash == hash_nr_unevictable && strcmp(name, "nr_unevictable") == 0)) nr_unevictable = strtoull(value, NULL, 10);
469
- // else if(unlikely(hash == hash_nr_unstable && strcmp(name, "nr_unstable") == 0)) nr_unstable = strtoull(value, NULL, 10);
470
- // else if(unlikely(hash == hash_nr_vmscan_immediate_reclaim && strcmp(name, "nr_vmscan_immediate_reclaim") == 0)) nr_vmscan_immediate_reclaim = strtoull(value, NULL, 10);
471
- // else if(unlikely(hash == hash_nr_vmscan_write && strcmp(name, "nr_vmscan_write") == 0)) nr_vmscan_write = strtoull(value, NULL, 10);
472
- // else if(unlikely(hash == hash_nr_writeback && strcmp(name, "nr_writeback") == 0)) nr_writeback = strtoull(value, NULL, 10);
473
- // else if(unlikely(hash == hash_nr_writeback_temp && strcmp(name, "nr_writeback_temp") == 0)) nr_writeback_temp = strtoull(value, NULL, 10);
474
- // else if(unlikely(hash == hash_nr_written && strcmp(name, "nr_written") == 0)) nr_written = strtoull(value, NULL, 10);
475
- // else if(unlikely(hash == hash_nr_zone_active_anon && strcmp(name, "nr_zone_active_anon") == 0)) nr_zone_active_anon = strtoull(value, NULL, 10);
476
- // else if(unlikely(hash == hash_nr_zone_active_file && strcmp(name, "nr_zone_active_file") == 0)) nr_zone_active_file = strtoull(value, NULL, 10);
477
- // else if(unlikely(hash == hash_nr_zone_inactive_anon && strcmp(name, "nr_zone_inactive_anon") == 0)) nr_zone_inactive_anon = strtoull(value, NULL, 10);
478
- // else if(unlikely(hash == hash_nr_zone_inactive_file && strcmp(name, "nr_zone_inactive_file") == 0)) nr_zone_inactive_file = strtoull(value, NULL, 10);
479
- // else if(unlikely(hash == hash_nr_zone_unevictable && strcmp(name, "nr_zone_unevictable") == 0)) nr_zone_unevictable = strtoull(value, NULL, 10);
480
- // else if(unlikely(hash == hash_nr_zone_write_pending && strcmp(name, "nr_zone_write_pending") == 0)) nr_zone_write_pending = strtoull(value, NULL, 10);
481
- // else if(unlikely(hash == hash_nr_zspages && strcmp(name, "nr_zspages") == 0)) nr_zspages = strtoull(value, NULL, 10);
482
- else if(unlikely(hash == hash_numa_foreign && strcmp(name, "numa_foreign") == 0)) numa_foreign = strtoull(value, NULL, 10);
483
- else if(unlikely(hash == hash_numa_hint_faults_local && strcmp(name, "numa_hint_faults_local") == 0)) numa_hint_faults_local = strtoull(value, NULL, 10);
484
- else if(unlikely(hash == hash_numa_hint_faults && strcmp(name, "numa_hint_faults") == 0)) numa_hint_faults = strtoull(value, NULL, 10);
485
- //else if(unlikely(hash == hash_numa_hit && strcmp(name, "numa_hit") == 0)) numa_hit = strtoull(value, NULL, 10);
486
- else if(unlikely(hash == hash_numa_huge_pte_updates && strcmp(name, "numa_huge_pte_updates") == 0)) numa_huge_pte_updates = strtoull(value, NULL, 10);
487
- else if(unlikely(hash == hash_numa_interleave && strcmp(name, "numa_interleave") == 0)) numa_interleave = strtoull(value, NULL, 10);
488
- else if(unlikely(hash == hash_numa_local && strcmp(name, "numa_local") == 0)) numa_local = strtoull(value, NULL, 10);
489
- //else if(unlikely(hash == hash_numa_miss && strcmp(name, "numa_miss") == 0)) numa_miss = strtoull(value, NULL, 10);
490
- else if(unlikely(hash == hash_numa_other && strcmp(name, "numa_other") == 0)) numa_other = strtoull(value, NULL, 10);
491
- else if(unlikely(hash == hash_numa_pages_migrated && strcmp(name, "numa_pages_migrated") == 0)) numa_pages_migrated = strtoull(value, NULL, 10);
492
- else if(unlikely(hash == hash_numa_pte_updates && strcmp(name, "numa_pte_updates") == 0)) numa_pte_updates = strtoull(value, NULL, 10);
493
- // else if(unlikely(hash == hash_pageoutrun && strcmp(name, "pageoutrun") == 0)) pageoutrun = strtoull(value, NULL, 10);
494
- // else if(unlikely(hash == hash_pgactivate && strcmp(name, "pgactivate") == 0)) pgactivate = strtoull(value, NULL, 10);
495
- // else if(unlikely(hash == hash_pgalloc_dma32 && strcmp(name, "pgalloc_dma32") == 0)) pgalloc_dma32 = strtoull(value, NULL, 10);
496
- // else if(unlikely(hash == hash_pgalloc_dma && strcmp(name, "pgalloc_dma") == 0)) pgalloc_dma = strtoull(value, NULL, 10);
497
- // else if(unlikely(hash == hash_pgalloc_movable && strcmp(name, "pgalloc_movable") == 0)) pgalloc_movable = strtoull(value, NULL, 10);
498
- // else if(unlikely(hash == hash_pgalloc_normal && strcmp(name, "pgalloc_normal") == 0)) pgalloc_normal = strtoull(value, NULL, 10);
499
- // else if(unlikely(hash == hash_pgdeactivate && strcmp(name, "pgdeactivate") == 0)) pgdeactivate = strtoull(value, NULL, 10);
500
- else if(unlikely(hash == hash_pgfault && strcmp(name, "pgfault") == 0)) pgfault = strtoull(value, NULL, 10);
501
- // else if(unlikely(hash == hash_pgfree && strcmp(name, "pgfree") == 0)) pgfree = strtoull(value, NULL, 10);
502
- // else if(unlikely(hash == hash_pginodesteal && strcmp(name, "pginodesteal") == 0)) pginodesteal = strtoull(value, NULL, 10);
503
- // else if(unlikely(hash == hash_pglazyfreed && strcmp(name, "pglazyfreed") == 0)) pglazyfreed = strtoull(value, NULL, 10);
504
- else if(unlikely(hash == hash_pgmajfault && strcmp(name, "pgmajfault") == 0)) pgmajfault = strtoull(value, NULL, 10);
505
- // else if(unlikely(hash == hash_pgmigrate_fail && strcmp(name, "pgmigrate_fail") == 0)) pgmigrate_fail = strtoull(value, NULL, 10);
506
- // else if(unlikely(hash == hash_pgmigrate_success && strcmp(name, "pgmigrate_success") == 0)) pgmigrate_success = strtoull(value, NULL, 10);
507
- else if(unlikely(hash == hash_pgpgin && strcmp(name, "pgpgin") == 0)) pgpgin = strtoull(value, NULL, 10);
508
- else if(unlikely(hash == hash_pgpgout && strcmp(name, "pgpgout") == 0)) pgpgout = strtoull(value, NULL, 10);
509
- // else if(unlikely(hash == hash_pgrefill && strcmp(name, "pgrefill") == 0)) pgrefill = strtoull(value, NULL, 10);
510
- // else if(unlikely(hash == hash_pgrotated && strcmp(name, "pgrotated") == 0)) pgrotated = strtoull(value, NULL, 10);
511
- // else if(unlikely(hash == hash_pgscan_direct && strcmp(name, "pgscan_direct") == 0)) pgscan_direct = strtoull(value, NULL, 10);
512
- // else if(unlikely(hash == hash_pgscan_direct_throttle && strcmp(name, "pgscan_direct_throttle") == 0)) pgscan_direct_throttle = strtoull(value, NULL, 10);
513
- // else if(unlikely(hash == hash_pgscan_kswapd && strcmp(name, "pgscan_kswapd") == 0)) pgscan_kswapd = strtoull(value, NULL, 10);
514
- // else if(unlikely(hash == hash_pgskip_dma32 && strcmp(name, "pgskip_dma32") == 0)) pgskip_dma32 = strtoull(value, NULL, 10);
515
- // else if(unlikely(hash == hash_pgskip_dma && strcmp(name, "pgskip_dma") == 0)) pgskip_dma = strtoull(value, NULL, 10);
516
- // else if(unlikely(hash == hash_pgskip_movable && strcmp(name, "pgskip_movable") == 0)) pgskip_movable = strtoull(value, NULL, 10);
517
- // else if(unlikely(hash == hash_pgskip_normal && strcmp(name, "pgskip_normal") == 0)) pgskip_normal = strtoull(value, NULL, 10);
518
- // else if(unlikely(hash == hash_pgsteal_direct && strcmp(name, "pgsteal_direct") == 0)) pgsteal_direct = strtoull(value, NULL, 10);
519
- // else if(unlikely(hash == hash_pgsteal_kswapd && strcmp(name, "pgsteal_kswapd") == 0)) pgsteal_kswapd = strtoull(value, NULL, 10);
520
- else if(unlikely(hash == hash_pswpin && strcmp(name, "pswpin") == 0)) pswpin = strtoull(value, NULL, 10);
521
- else if(unlikely(hash == hash_pswpout && strcmp(name, "pswpout") == 0)) pswpout = strtoull(value, NULL, 10);
522
- // else if(unlikely(hash == hash_slabs_scanned && strcmp(name, "slabs_scanned") == 0)) slabs_scanned = strtoull(value, NULL, 10);
523
- // else if(unlikely(hash == hash_thp_collapse_alloc_failed && strcmp(name, "thp_collapse_alloc_failed") == 0)) thp_collapse_alloc_failed = strtoull(value, NULL, 10);
524
- // else if(unlikely(hash == hash_thp_collapse_alloc && strcmp(name, "thp_collapse_alloc") == 0)) thp_collapse_alloc = strtoull(value, NULL, 10);
525
- // else if(unlikely(hash == hash_thp_deferred_split_page && strcmp(name, "thp_deferred_split_page") == 0)) thp_deferred_split_page = strtoull(value, NULL, 10);
526
- // else if(unlikely(hash == hash_thp_fault_alloc && strcmp(name, "thp_fault_alloc") == 0)) thp_fault_alloc = strtoull(value, NULL, 10);
527
- // else if(unlikely(hash == hash_thp_fault_fallback && strcmp(name, "thp_fault_fallback") == 0)) thp_fault_fallback = strtoull(value, NULL, 10);
528
- // else if(unlikely(hash == hash_thp_file_alloc && strcmp(name, "thp_file_alloc") == 0)) thp_file_alloc = strtoull(value, NULL, 10);
529
- // else if(unlikely(hash == hash_thp_file_mapped && strcmp(name, "thp_file_mapped") == 0)) thp_file_mapped = strtoull(value, NULL, 10);
530
- // else if(unlikely(hash == hash_thp_split_page_failed && strcmp(name, "thp_split_page_failed") == 0)) thp_split_page_failed = strtoull(value, NULL, 10);
531
- // else if(unlikely(hash == hash_thp_split_page && strcmp(name, "thp_split_page") == 0)) thp_split_page = strtoull(value, NULL, 10);
532
- // else if(unlikely(hash == hash_thp_split_pmd && strcmp(name, "thp_split_pmd") == 0)) thp_split_pmd = strtoull(value, NULL, 10);
533
- // else if(unlikely(hash == hash_thp_zero_page_alloc_failed && strcmp(name, "thp_zero_page_alloc_failed") == 0)) thp_zero_page_alloc_failed = strtoull(value, NULL, 10);
534
- // else if(unlikely(hash == hash_thp_zero_page_alloc && strcmp(name, "thp_zero_page_alloc") == 0)) thp_zero_page_alloc = strtoull(value, NULL, 10);
535
- // else if(unlikely(hash == hash_unevictable_pgs_cleared && strcmp(name, "unevictable_pgs_cleared") == 0)) unevictable_pgs_cleared = strtoull(value, NULL, 10);
536
- // else if(unlikely(hash == hash_unevictable_pgs_culled && strcmp(name, "unevictable_pgs_culled") == 0)) unevictable_pgs_culled = strtoull(value, NULL, 10);
537
- // else if(unlikely(hash == hash_unevictable_pgs_mlocked && strcmp(name, "unevictable_pgs_mlocked") == 0)) unevictable_pgs_mlocked = strtoull(value, NULL, 10);
538
- // else if(unlikely(hash == hash_unevictable_pgs_munlocked && strcmp(name, "unevictable_pgs_munlocked") == 0)) unevictable_pgs_munlocked = strtoull(value, NULL, 10);
539
- // else if(unlikely(hash == hash_unevictable_pgs_rescued && strcmp(name, "unevictable_pgs_rescued") == 0)) unevictable_pgs_rescued = strtoull(value, NULL, 10);
540
- // else if(unlikely(hash == hash_unevictable_pgs_scanned && strcmp(name, "unevictable_pgs_scanned") == 0)) unevictable_pgs_scanned = strtoull(value, NULL, 10);
541
- // else if(unlikely(hash == hash_unevictable_pgs_stranded && strcmp(name, "unevictable_pgs_stranded") == 0)) unevictable_pgs_stranded = strtoull(value, NULL, 10);
542
- // else if(unlikely(hash == hash_workingset_activate && strcmp(name, "workingset_activate") == 0)) workingset_activate = strtoull(value, NULL, 10);
543
- // else if(unlikely(hash == hash_workingset_nodereclaim && strcmp(name, "workingset_nodereclaim") == 0)) workingset_nodereclaim = strtoull(value, NULL, 10);
544
- // else if(unlikely(hash == hash_workingset_refault && strcmp(name, "workingset_refault") == 0)) workingset_refault = strtoull(value, NULL, 10);
545
- // else if(unlikely(hash == hash_zone_reclaim_failed && strcmp(name, "zone_reclaim_failed") == 0)) zone_reclaim_failed = strtoull(value, NULL, 10);
423
+ // else if(unlikely(hash == hash_allocstall_dma32 && strcmp(name, "allocstall_dma32") == 0)) ptr = &allocstall_dma32;
424
+ // else if(unlikely(hash == hash_allocstall_dma && strcmp(name, "allocstall_dma") == 0)) ptr = &allocstall_dma;
425
+ // else if(unlikely(hash == hash_allocstall_movable && strcmp(name, "allocstall_movable") == 0)) ptr = &allocstall_movable;
426
+ // else if(unlikely(hash == hash_allocstall_normal && strcmp(name, "allocstall_normal") == 0)) ptr = &allocstall_normal;
427
+ // else if(unlikely(hash == hash_balloon_deflate && strcmp(name, "balloon_deflate") == 0)) ptr = &balloon_deflate;
428
+ // else if(unlikely(hash == hash_balloon_inflate && strcmp(name, "balloon_inflate") == 0)) ptr = &balloon_inflate;
429
+ // else if(unlikely(hash == hash_balloon_migrate && strcmp(name, "balloon_migrate") == 0)) ptr = &balloon_migrate;
430
+ // else if(unlikely(hash == hash_compact_daemon_wake && strcmp(name, "compact_daemon_wake") == 0)) ptr = &compact_daemon_wake;
431
+ // else if(unlikely(hash == hash_compact_fail && strcmp(name, "compact_fail") == 0)) ptr = &compact_fail;
432
+ // else if(unlikely(hash == hash_compact_free_scanned && strcmp(name, "compact_free_scanned") == 0)) ptr = &compact_free_scanned;
433
+ // else if(unlikely(hash == hash_compact_isolated && strcmp(name, "compact_isolated") == 0)) ptr = &compact_isolated;
434
+ // else if(unlikely(hash == hash_compact_migrate_scanned && strcmp(name, "compact_migrate_scanned") == 0)) ptr = &compact_migrate_scanned;
435
+ // else if(unlikely(hash == hash_compact_stall && strcmp(name, "compact_stall") == 0)) ptr = &compact_stall;
436
+ // else if(unlikely(hash == hash_compact_success && strcmp(name, "compact_success") == 0)) ptr = &compact_success;
437
+ // else if(unlikely(hash == hash_drop_pagecache && strcmp(name, "drop_pagecache") == 0)) ptr = &drop_pagecache;
438
+ // else if(unlikely(hash == hash_drop_slab && strcmp(name, "drop_slab") == 0)) ptr = &drop_slab;
439
+ // else if(unlikely(hash == hash_htlb_buddy_alloc_fail && strcmp(name, "htlb_buddy_alloc_fail") == 0)) ptr = &htlb_buddy_alloc_fail;
440
+ // else if(unlikely(hash == hash_htlb_buddy_alloc_success && strcmp(name, "htlb_buddy_alloc_success") == 0)) ptr = &htlb_buddy_alloc_success;
441
+ // else if(unlikely(hash == hash_kswapd_high_wmark_hit_quickly && strcmp(name, "kswapd_high_wmark_hit_quickly") == 0)) ptr = &kswapd_high_wmark_hit_quickly;
442
+ // else if(unlikely(hash == hash_kswapd_inodesteal && strcmp(name, "kswapd_inodesteal") == 0)) ptr = &kswapd_inodesteal;
443
+ // else if(unlikely(hash == hash_kswapd_low_wmark_hit_quickly && strcmp(name, "kswapd_low_wmark_hit_quickly") == 0)) ptr = &kswapd_low_wmark_hit_quickly;
444
+ // else if(unlikely(hash == hash_nr_active_anon && strcmp(name, "nr_active_anon") == 0)) ptr = &nr_active_anon;
445
+ // else if(unlikely(hash == hash_nr_active_file && strcmp(name, "nr_active_file") == 0)) ptr = &nr_active_file;
446
+ // else if(unlikely(hash == hash_nr_anon_pages && strcmp(name, "nr_anon_pages") == 0)) ptr = &nr_anon_pages;
447
+ // else if(unlikely(hash == hash_nr_anon_transparent_hugepages && strcmp(name, "nr_anon_transparent_hugepages") == 0)) ptr = &nr_anon_transparent_hugepages;
448
+ // else if(unlikely(hash == hash_nr_bounce && strcmp(name, "nr_bounce") == 0)) ptr = &nr_bounce;
449
+ // else if(unlikely(hash == hash_nr_dirtied && strcmp(name, "nr_dirtied") == 0)) ptr = &nr_dirtied;
450
+ // else if(unlikely(hash == hash_nr_dirty_background_threshold && strcmp(name, "nr_dirty_background_threshold") == 0)) ptr = &nr_dirty_background_threshold;
451
+ // else if(unlikely(hash == hash_nr_dirty && strcmp(name, "nr_dirty") == 0)) ptr = &nr_dirty;
452
+ // else if(unlikely(hash == hash_nr_dirty_threshold && strcmp(name, "nr_dirty_threshold") == 0)) ptr = &nr_dirty_threshold;
453
+ // else if(unlikely(hash == hash_nr_file_pages && strcmp(name, "nr_file_pages") == 0)) ptr = &nr_file_pages;
454
+ // else if(unlikely(hash == hash_nr_free_cma && strcmp(name, "nr_free_cma") == 0)) ptr = &nr_free_cma;
455
+ // else if(unlikely(hash == hash_nr_free_pages && strcmp(name, "nr_free_pages") == 0)) ptr = &nr_free_pages;
456
+ // else if(unlikely(hash == hash_nr_inactive_anon && strcmp(name, "nr_inactive_anon") == 0)) ptr = &nr_inactive_anon;
457
+ // else if(unlikely(hash == hash_nr_inactive_file && strcmp(name, "nr_inactive_file") == 0)) ptr = &nr_inactive_file;
458
+ // else if(unlikely(hash == hash_nr_isolated_anon && strcmp(name, "nr_isolated_anon") == 0)) ptr = &nr_isolated_anon;
459
+ // else if(unlikely(hash == hash_nr_isolated_file && strcmp(name, "nr_isolated_file") == 0)) ptr = &nr_isolated_file;
460
+ // else if(unlikely(hash == hash_nr_kernel_stack && strcmp(name, "nr_kernel_stack") == 0)) ptr = &nr_kernel_stack;
461
+ // else if(unlikely(hash == hash_nr_mapped && strcmp(name, "nr_mapped") == 0)) ptr = &nr_mapped;
462
+ // else if(unlikely(hash == hash_nr_mlock && strcmp(name, "nr_mlock") == 0)) ptr = &nr_mlock;
463
+ // else if(unlikely(hash == hash_nr_pages_scanned && strcmp(name, "nr_pages_scanned") == 0)) ptr = &nr_pages_scanned;
464
+ // else if(unlikely(hash == hash_nr_page_table_pages && strcmp(name, "nr_page_table_pages") == 0)) ptr = &nr_page_table_pages;
465
+ // else if(unlikely(hash == hash_nr_shmem_hugepages && strcmp(name, "nr_shmem_hugepages") == 0)) ptr = &nr_shmem_hugepages;
466
+ // else if(unlikely(hash == hash_nr_shmem_pmdmapped && strcmp(name, "nr_shmem_pmdmapped") == 0)) ptr = &nr_shmem_pmdmapped;
467
+ // else if(unlikely(hash == hash_nr_shmem && strcmp(name, "nr_shmem") == 0)) ptr = &nr_shmem;
468
+ // else if(unlikely(hash == hash_nr_slab_reclaimable && strcmp(name, "nr_slab_reclaimable") == 0)) ptr = &nr_slab_reclaimable;
469
+ // else if(unlikely(hash == hash_nr_slab_unreclaimable && strcmp(name, "nr_slab_unreclaimable") == 0)) ptr = &nr_slab_unreclaimable;
470
+ // else if(unlikely(hash == hash_nr_unevictable && strcmp(name, "nr_unevictable") == 0)) ptr = &nr_unevictable;
471
+ // else if(unlikely(hash == hash_nr_unstable && strcmp(name, "nr_unstable") == 0)) ptr = &nr_unstable;
472
+ // else if(unlikely(hash == hash_nr_vmscan_immediate_reclaim && strcmp(name, "nr_vmscan_immediate_reclaim") == 0)) ptr = &nr_vmscan_immediate_reclaim;
473
+ // else if(unlikely(hash == hash_nr_vmscan_write && strcmp(name, "nr_vmscan_write") == 0)) ptr = &nr_vmscan_write;
474
+ // else if(unlikely(hash == hash_nr_writeback && strcmp(name, "nr_writeback") == 0)) ptr = &nr_writeback;
475
+ // else if(unlikely(hash == hash_nr_writeback_temp && strcmp(name, "nr_writeback_temp") == 0)) ptr = &nr_writeback_temp;
476
+ // else if(unlikely(hash == hash_nr_written && strcmp(name, "nr_written") == 0)) ptr = &nr_written;
477
+ // else if(unlikely(hash == hash_nr_zone_active_anon && strcmp(name, "nr_zone_active_anon") == 0)) ptr = &nr_zone_active_anon;
478
+ // else if(unlikely(hash == hash_nr_zone_active_file && strcmp(name, "nr_zone_active_file") == 0)) ptr = &nr_zone_active_file;
479
+ // else if(unlikely(hash == hash_nr_zone_inactive_anon && strcmp(name, "nr_zone_inactive_anon") == 0)) ptr = &nr_zone_inactive_anon;
480
+ // else if(unlikely(hash == hash_nr_zone_inactive_file && strcmp(name, "nr_zone_inactive_file") == 0)) ptr = &nr_zone_inactive_file;
481
+ // else if(unlikely(hash == hash_nr_zone_unevictable && strcmp(name, "nr_zone_unevictable") == 0)) ptr = &nr_zone_unevictable;
482
+ // else if(unlikely(hash == hash_nr_zone_write_pending && strcmp(name, "nr_zone_write_pending") == 0)) ptr = &nr_zone_write_pending;
483
+ // else if(unlikely(hash == hash_nr_zspages && strcmp(name, "nr_zspages") == 0)) ptr = &nr_zspages;
484
+ else if(unlikely(hash == hash_numa_foreign && strcmp(name, "numa_foreign") == 0)) ptr = &numa_foreign;
485
+ else if(unlikely(hash == hash_numa_hint_faults_local && strcmp(name, "numa_hint_faults_local") == 0)) ptr = &numa_hint_faults_local;
486
+ else if(unlikely(hash == hash_numa_hint_faults && strcmp(name, "numa_hint_faults") == 0)) ptr = &numa_hint_faults;
487
+ //else if(unlikely(hash == hash_numa_hit && strcmp(name, "numa_hit") == 0)) ptr = &numa_hit;
488
+ else if(unlikely(hash == hash_numa_huge_pte_updates && strcmp(name, "numa_huge_pte_updates") == 0)) ptr = &numa_huge_pte_updates;
489
+ else if(unlikely(hash == hash_numa_interleave && strcmp(name, "numa_interleave") == 0)) ptr = &numa_interleave;
490
+ else if(unlikely(hash == hash_numa_local && strcmp(name, "numa_local") == 0)) ptr = &numa_local;
491
+ //else if(unlikely(hash == hash_numa_miss && strcmp(name, "numa_miss") == 0)) ptr = &numa_miss;
492
+ else if(unlikely(hash == hash_numa_other && strcmp(name, "numa_other") == 0)) ptr = &numa_other;
493
+ else if(unlikely(hash == hash_numa_pages_migrated && strcmp(name, "numa_pages_migrated") == 0)) ptr = &numa_pages_migrated;
494
+ else if(unlikely(hash == hash_numa_pte_updates && strcmp(name, "numa_pte_updates") == 0)) ptr = &numa_pte_updates;
495
+ // else if(unlikely(hash == hash_pageoutrun && strcmp(name, "pageoutrun") == 0)) ptr = &pageoutrun;
496
+ // else if(unlikely(hash == hash_pgactivate && strcmp(name, "pgactivate") == 0)) ptr = &pgactivate;
497
+ // else if(unlikely(hash == hash_pgalloc_dma32 && strcmp(name, "pgalloc_dma32") == 0)) ptr = &pgalloc_dma32;
498
+ // else if(unlikely(hash == hash_pgalloc_dma && strcmp(name, "pgalloc_dma") == 0)) ptr = &pgalloc_dma;
499
+ // else if(unlikely(hash == hash_pgalloc_movable && strcmp(name, "pgalloc_movable") == 0)) ptr = &pgalloc_movable;
500
+ // else if(unlikely(hash == hash_pgalloc_normal && strcmp(name, "pgalloc_normal") == 0)) ptr = &pgalloc_normal;
501
+ // else if(unlikely(hash == hash_pgdeactivate && strcmp(name, "pgdeactivate") == 0)) ptr = &pgdeactivate;
502
+ else if(unlikely(hash == hash_pgfault && strcmp(name, "pgfault") == 0)) ptr = &pgfault;
503
+ // else if(unlikely(hash == hash_pgfree && strcmp(name, "pgfree") == 0)) ptr = &pgfree;
504
+ // else if(unlikely(hash == hash_pginodesteal && strcmp(name, "pginodesteal") == 0)) ptr = &pginodesteal;
505
+ // else if(unlikely(hash == hash_pglazyfreed && strcmp(name, "pglazyfreed") == 0)) ptr = &pglazyfreed;
506
+ else if(unlikely(hash == hash_pgmajfault && strcmp(name, "pgmajfault") == 0)) ptr = &pgmajfault;
507
+ // else if(unlikely(hash == hash_pgmigrate_fail && strcmp(name, "pgmigrate_fail") == 0)) ptr = &pgmigrate_fail;
508
+ // else if(unlikely(hash == hash_pgmigrate_success && strcmp(name, "pgmigrate_success") == 0)) ptr = &pgmigrate_success;
509
+ else if(unlikely(hash == hash_pgpgin && strcmp(name, "pgpgin") == 0)) ptr = &pgpgin;
510
+ else if(unlikely(hash == hash_pgpgout && strcmp(name, "pgpgout") == 0)) ptr = &pgpgout;
511
+ // else if(unlikely(hash == hash_pgrefill && strcmp(name, "pgrefill") == 0)) ptr = &pgrefill;
512
+ // else if(unlikely(hash == hash_pgrotated && strcmp(name, "pgrotated") == 0)) ptr = &pgrotated;
513
+ // else if(unlikely(hash == hash_pgscan_direct && strcmp(name, "pgscan_direct") == 0)) ptr = &pgscan_direct;
514
+ // else if(unlikely(hash == hash_pgscan_direct_throttle && strcmp(name, "pgscan_direct_throttle") == 0)) ptr = &pgscan_direct_throttle;
515
+ // else if(unlikely(hash == hash_pgscan_kswapd && strcmp(name, "pgscan_kswapd") == 0)) ptr = &pgscan_kswapd;
516
+ // else if(unlikely(hash == hash_pgskip_dma32 && strcmp(name, "pgskip_dma32") == 0)) ptr = &pgskip_dma32;
517
+ // else if(unlikely(hash == hash_pgskip_dma && strcmp(name, "pgskip_dma") == 0)) ptr = &pgskip_dma;
518
+ // else if(unlikely(hash == hash_pgskip_movable && strcmp(name, "pgskip_movable") == 0)) ptr = &pgskip_movable;
519
+ // else if(unlikely(hash == hash_pgskip_normal && strcmp(name, "pgskip_normal") == 0)) ptr = &pgskip_normal;
520
+ // else if(unlikely(hash == hash_pgsteal_direct && strcmp(name, "pgsteal_direct") == 0)) ptr = &pgsteal_direct;
521
+ // else if(unlikely(hash == hash_pgsteal_kswapd && strcmp(name, "pgsteal_kswapd") == 0)) ptr = &pgsteal_kswapd;
522
+ else if(unlikely(hash == hash_pswpin && strcmp(name, "pswpin") == 0)) ptr = &pswpin;
523
+ else if(unlikely(hash == hash_pswpout && strcmp(name, "pswpout") == 0)) ptr = &pswpout;
524
+ // else if(unlikely(hash == hash_slabs_scanned && strcmp(name, "slabs_scanned") == 0)) ptr = &slabs_scanned;
525
+ // else if(unlikely(hash == hash_thp_collapse_alloc_failed && strcmp(name, "thp_collapse_alloc_failed") == 0)) ptr = &thp_collapse_alloc_failed;
526
+ // else if(unlikely(hash == hash_thp_collapse_alloc && strcmp(name, "thp_collapse_alloc") == 0)) ptr = &thp_collapse_alloc;
527
+ // else if(unlikely(hash == hash_thp_deferred_split_page && strcmp(name, "thp_deferred_split_page") == 0)) ptr = &thp_deferred_split_page;
528
+ // else if(unlikely(hash == hash_thp_fault_alloc && strcmp(name, "thp_fault_alloc") == 0)) ptr = &thp_fault_alloc;
529
+ // else if(unlikely(hash == hash_thp_fault_fallback && strcmp(name, "thp_fault_fallback") == 0)) ptr = &thp_fault_fallback;
530
+ // else if(unlikely(hash == hash_thp_file_alloc && strcmp(name, "thp_file_alloc") == 0)) ptr = &thp_file_alloc;
531
+ // else if(unlikely(hash == hash_thp_file_mapped && strcmp(name, "thp_file_mapped") == 0)) ptr = &thp_file_mapped;
532
+ // else if(unlikely(hash == hash_thp_split_page_failed && strcmp(name, "thp_split_page_failed") == 0)) ptr = &thp_split_page_failed;
533
+ // else if(unlikely(hash == hash_thp_split_page && strcmp(name, "thp_split_page") == 0)) ptr = &thp_split_page;
534
+ // else if(unlikely(hash == hash_thp_split_pmd && strcmp(name, "thp_split_pmd") == 0)) ptr = &thp_split_pmd;
535
+ // else if(unlikely(hash == hash_thp_zero_page_alloc_failed && strcmp(name, "thp_zero_page_alloc_failed") == 0)) ptr = &thp_zero_page_alloc_failed;
536
+ // else if(unlikely(hash == hash_thp_zero_page_alloc && strcmp(name, "thp_zero_page_alloc") == 0)) ptr = &thp_zero_page_alloc;
537
+ // else if(unlikely(hash == hash_unevictable_pgs_cleared && strcmp(name, "unevictable_pgs_cleared") == 0)) ptr = &unevictable_pgs_cleared;
538
+ // else if(unlikely(hash == hash_unevictable_pgs_culled && strcmp(name, "unevictable_pgs_culled") == 0)) ptr = &unevictable_pgs_culled;
539
+ // else if(unlikely(hash == hash_unevictable_pgs_mlocked && strcmp(name, "unevictable_pgs_mlocked") == 0)) ptr = &unevictable_pgs_mlocked;
540
+ // else if(unlikely(hash == hash_unevictable_pgs_munlocked && strcmp(name, "unevictable_pgs_munlocked") == 0)) ptr = &unevictable_pgs_munlocked;
541
+ // else if(unlikely(hash == hash_unevictable_pgs_rescued && strcmp(name, "unevictable_pgs_rescued") == 0)) ptr = &unevictable_pgs_rescued;
542
+ // else if(unlikely(hash == hash_unevictable_pgs_scanned && strcmp(name, "unevictable_pgs_scanned") == 0)) ptr = &unevictable_pgs_scanned;
543
+ // else if(unlikely(hash == hash_unevictable_pgs_stranded && strcmp(name, "unevictable_pgs_stranded") == 0)) ptr = &unevictable_pgs_stranded;
544
+ // else if(unlikely(hash == hash_workingset_activate && strcmp(name, "workingset_activate") == 0)) ptr = &workingset_activate;
545
+ // else if(unlikely(hash == hash_workingset_nodereclaim && strcmp(name, "workingset_nodereclaim") == 0)) ptr = &workingset_nodereclaim;
546
+ // else if(unlikely(hash == hash_workingset_refault && strcmp(name, "workingset_refault") == 0)) ptr = &workingset_refault;
547
+ // else if(unlikely(hash == hash_zone_reclaim_failed && strcmp(name, "zone_reclaim_failed") == 0)) ptr = &zone_reclaim_failed;
548
+
549
+ if(unlikely(ptr)) {
550
+ *ptr = str2ull(value);
551
+ ptr = NULL;
552
+ }
553
}
554
555
// --------------------------------------------------------------------
src/sys_devices_system_edac_mc.c
+2
-2
@@ -95,7 +95,7 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
95
if(unlikely(!m->ce_ff || procfile_lines(m->ce_ff) < 1 || procfile_linewords(m->ce_ff, 0) < 1))
96
continue;
97
98
- m->ce_count = strtoull(procfile_lineword(m->ce_ff, 0, 0), NULL, 0);
98
+ m->ce_count = str2ull(procfile_lineword(m->ce_ff, 0, 0));
99
ce_sum += m->ce_count;
100
m->ce_updated = 1;
101
}
@@ -117,7 +117,7 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
117
if(unlikely(!m->ue_ff || procfile_lines(m->ue_ff) < 1 || procfile_linewords(m->ue_ff, 0) < 1))
118
continue;
119
120
- m->ue_count = strtoull(procfile_lineword(m->ue_ff, 0, 0), NULL, 0);
120
+ m->ue_count = str2ull(procfile_lineword(m->ue_ff, 0, 0));
121
ue_sum += m->ue_count;
122
m->ue_updated = 1;
123
}
src/sys_kernel_mm_ksm.c
+5
-5
@@ -64,23 +64,23 @@ int do_sys_kernel_mm_ksm(int update_every, usec_t dt) {
64
65
ff_pages_shared = procfile_readall(ff_pages_shared);
66
if(!ff_pages_shared) return 0; // we return 0, so that we will retry to open it next time
67
- pages_shared = strtoull(procfile_lineword(ff_pages_shared, 0, 0), NULL, 10);
67
+ pages_shared = str2ull(procfile_lineword(ff_pages_shared, 0, 0));
68
69
ff_pages_sharing = procfile_readall(ff_pages_sharing);
70
if(!ff_pages_sharing) return 0; // we return 0, so that we will retry to open it next time
71
- pages_sharing = strtoull(procfile_lineword(ff_pages_sharing, 0, 0), NULL, 10);
71
+ pages_sharing = str2ull(procfile_lineword(ff_pages_sharing, 0, 0));
72
73
ff_pages_unshared = procfile_readall(ff_pages_unshared);
74
if(!ff_pages_unshared) return 0; // we return 0, so that we will retry to open it next time
75
- pages_unshared = strtoull(procfile_lineword(ff_pages_unshared, 0, 0), NULL, 10);
75
+ pages_unshared = str2ull(procfile_lineword(ff_pages_unshared, 0, 0));
76
77
ff_pages_volatile = procfile_readall(ff_pages_volatile);
78
if(!ff_pages_volatile) return 0; // we return 0, so that we will retry to open it next time
79
- pages_volatile = strtoull(procfile_lineword(ff_pages_volatile, 0, 0), NULL, 10);
79
+ pages_volatile = str2ull(procfile_lineword(ff_pages_volatile, 0, 0));
80
81
ff_pages_to_scan = procfile_readall(ff_pages_to_scan);
82
if(!ff_pages_to_scan) return 0; // we return 0, so that we will retry to open it next time
83
- pages_to_scan = strtoull(procfile_lineword(ff_pages_to_scan, 0, 0), NULL, 10);
83
+ pages_to_scan = str2ull(procfile_lineword(ff_pages_to_scan, 0, 0));
84
85
offered = pages_sharing + pages_shared + pages_unshared + pages_volatile;
86
saved = pages_sharing - pages_shared;
src/unit_test.c
+1
-1
@@ -18,7 +18,7 @@ int check_storage_number(calculated_number n, int debug) {
18
if(dcdiff < 0) dcdiff = -dcdiff;
19
20
size_t len = print_calculated_number(buffer, d);
21
- calculated_number p = strtold(buffer, NULL);
21
+ calculated_number p = str2l(buffer);
22
calculated_number pdiff = n - p;
23
calculated_number pcdiff = pdiff * 100.0 / n;
24
if(pcdiff < 0) pcdiff = -pcdiff;
src/web_buffer_svg.c
+1
-1
@@ -470,7 +470,7 @@ static inline void calc_colorz(const char *color, char *final, size_t len, calcu
470
break;
471
}
472
else {
473
- calculated_number v = strtold(value_buffer, NULL);
473
+ calculated_number v = str2l(value_buffer);
474
475
if(comparison == '<' && value < v) break;
476
else if(comparison == '(' && value <= v) break;
src/web_client.c
+14
-14
@@ -912,12 +912,12 @@ int web_client_api_request_v1_badge(struct web_client *w, char *url) {
912
}
913
}
914
915
- long long multiply = (multiply_str && *multiply_str )?atol(multiply_str):1;
916
- long long divide = (divide_str && *divide_str )?atol(divide_str):1;
917
- long long before = (before_str && *before_str )?atol(before_str):0;
918
- long long after = (after_str && *after_str )?atol(after_str):-st->update_every;
919
- int points = (points_str && *points_str )?atoi(points_str):1;
920
- int precision = (precision_str && *precision_str)?atoi(precision_str):-1;
915
+ long long multiply = (multiply_str && *multiply_str )?str2l(multiply_str):1;
916
+ long long divide = (divide_str && *divide_str )?str2l(divide_str):1;
917
+ long long before = (before_str && *before_str )?str2l(before_str):0;
918
+ long long after = (after_str && *after_str )?str2l(after_str):-st->update_every;
919
+ int points = (points_str && *points_str )?str2i(points_str):1;
920
+ int precision = (precision_str && *precision_str)?str2i(precision_str):-1;
921
922
if(!multiply) multiply = 1;
923
if(!divide) divide = 1;
@@ -934,7 +934,7 @@ int web_client_api_request_v1_badge(struct web_client *w, char *url) {
934
}
935
}
936
else {
937
- refresh = atoi(refresh_str);
937
+ refresh = str2i(refresh_str);
938
if(refresh < 0) refresh = -refresh;
939
}
940
}
@@ -1192,9 +1192,9 @@ int web_client_api_request_v1_data(struct web_client *w, char *url)
1192
goto cleanup;
1193
}
1194
1195
- long long before = (before_str && *before_str)?atol(before_str):0;
1196
- long long after = (after_str && *after_str) ?atol(after_str):0;
1197
- int points = (points_str && *points_str)?atoi(points_str):0;
1195
+ long long before = (before_str && *before_str)?str2l(before_str):0;
1196
+ long long after = (after_str && *after_str) ?str2l(after_str):0;
1197
+ int points = (points_str && *points_str)?str2i(points_str):0;
1198
1199
debug(D_WEB_CLIENT, "%llu: API command 'data' for chart '%s', dimensions '%s', after '%lld', before '%lld', points '%d', group '%d', format '%u', options '0x%08x'"
1200
, w->id
@@ -1550,13 +1550,13 @@ int web_client_api_old_data_request(struct web_client *w, char *url, int datasou
1550
if(url) {
1551
// parse the lines required
1552
tok = mystrsep(&url, "/");
1553
- if(tok) lines = atoi(tok);
1553
+ if(tok) lines = str2i(tok);
1554
if(lines < 1) lines = 1;
1555
}
1556
if(url) {
1557
// parse the group count required
1558
tok = mystrsep(&url, "/");
1559
- if(tok && *tok) group_count = atoi(tok);
1559
+ if(tok && *tok) group_count = str2i(tok);
1560
if(group_count < 1) group_count = 1;
1561
//if(group_count > save_history / 20) group_count = save_history / 20;
1562
}
@@ -1573,13 +1573,13 @@ int web_client_api_old_data_request(struct web_client *w, char *url, int datasou
1573
if(url) {
1574
// parse after time
1575
tok = mystrsep(&url, "/");
1576
- if(tok && *tok) after = strtoul(tok, NULL, 10);
1576
+ if(tok && *tok) after = str2ul(tok);
1577
if(after < 0) after = 0;
1578
}
1579
if(url) {
1580
// parse before time
1581
tok = mystrsep(&url, "/");
1582
- if(tok && *tok) before = strtoul(tok, NULL, 10);
1582
+ if(tok && *tok) before = str2ul(tok);
1583
if(before < 0) before = 0;
1584
}
1585
if(url) {