Lines Matching refs:fsd
81 void ffsb_statsd_init(ffsb_statsd_t * fsd, ffsb_statsc_t * fsc) in ffsb_statsd_init() argument
84 memset(fsd, 0, sizeof(*fsd)); in ffsb_statsd_init()
87 fsd->totals[i] = 0; in ffsb_statsd_init()
88 fsd->mins[i] = UINT_MAX; in ffsb_statsd_init()
89 fsd->maxs[i] = 0; in ffsb_statsd_init()
90 fsd->buckets[i] = ffsb_malloc(sizeof(uint32_t) * in ffsb_statsd_init()
92 assert(fsd->buckets[i] != NULL); in ffsb_statsd_init()
94 memset(fsd->buckets[i], 0, sizeof(uint32_t) * fsc->num_buckets); in ffsb_statsd_init()
96 fsd->config = fsc; in ffsb_statsd_init()
99 void ffsb_statsd_destroy(ffsb_statsd_t * fsd) in ffsb_statsd_destroy() argument
103 free(fsd->buckets[i]); in ffsb_statsd_destroy()
106 void ffsb_add_data(ffsb_statsd_t * fsd, syscall_t s, uint32_t value) in ffsb_add_data() argument
111 if (!fsd || fsc_ignore_sys(fsd->config, s)) in ffsb_add_data()
114 if (value < fsd->mins[s]) in ffsb_add_data()
115 fsd->mins[s] = value; in ffsb_add_data()
116 if (value > fsd->maxs[s]) in ffsb_add_data()
117 fsd->maxs[s] = value; in ffsb_add_data()
119 fsd->counts[s]++; in ffsb_add_data()
120 fsd->totals[s] += value; in ffsb_add_data()
122 if (fsd->config->num_buckets == 0) in ffsb_add_data()
125 num_buckets = fsd->config->num_buckets; in ffsb_add_data()
126 bucket_defs = fsd->config->buckets; in ffsb_add_data()
132 fsd->buckets[s][i]++; in ffsb_add_data()
183 void ffsb_statsd_print(ffsb_statsd_t * fsd) in ffsb_statsd_print() argument
190 if (fsd->counts[i]) { in ffsb_statsd_print()
192 syscall_names[i], (float)fsd->mins[i] / 1000.0f, in ffsb_statsd_print()
193 (fsd->totals[i] / (1000.0f * in ffsb_statsd_print()
194 (double)fsd->counts[i])), in ffsb_statsd_print()
195 (float)fsd->maxs[i] / 1000.0f, fsd->counts[i]); in ffsb_statsd_print()
196 print_buckets_helper(fsd->config, fsd->buckets[i]); in ffsb_statsd_print()
212 ffsb_statsd_t fsd;
228 ffsb_statsd_init(&fsd, &fsc);
232 ffsb_add_data(&fsd, SYS_READ, (float)i);
235 ffsb_statsd_destroy(&fsd);