Lines Matching refs:sp
98 stats_delete(struct stats *sp)
102 if (sp == NULL)
106 if (s == sp)
120 FREE((void *)sp->name);
121 FREE((void *)sp->desc);
122 FREE(sp);
135 stats_counter_bump(struct stats *sp)
137 if (sp == NULL)
140 ASSERT(sp->t == STATS_COUNTER);
142 sp->u.counter++;
146 stats_counter_add(struct stats *sp, int n)
148 if (sp == NULL)
151 ASSERT(sp->t == STATS_COUNTER);
153 sp->u.counter += n;
157 stats_counter_reset(struct stats *sp)
159 if (sp == NULL)
162 ASSERT(sp->t == STATS_COUNTER);
164 sp->u.counter = 0;
168 stats_counter_value(struct stats *sp)
170 if (sp == NULL)
173 ASSERT(sp->t == STATS_COUNTER);
175 return (sp->u.counter);
188 stats_elapse_start(struct stats *sp)
190 if (sp == NULL)
193 ASSERT(sp->t == STATS_ELAPSE);
195 sp->u.elapse.start = gethrtime();
199 stats_elapse_stop(struct stats *sp)
201 if (sp == NULL)
204 ASSERT(sp->t == STATS_ELAPSE);
206 sp->u.elapse.stop = gethrtime();
219 stats_string_set(struct stats *sp, const char *s)
221 if (sp == NULL)
224 ASSERT(sp->t == STATS_STRING);
226 sp->u.string = s;
237 struct stats *sp;
239 for (sp = Statslist; sp; sp = sp->next)
240 switch (sp->t) {
242 out(O_OK, "%32s %13d %s", sp->name,
243 sp->u.counter, sp->desc);
247 if (sp->u.elapse.start && sp->u.elapse.stop) {
249 sp->u.elapse.stop - sp->u.elapse.start;
251 out(O_OK, "%32s %11lldns %s", sp->name,
252 delta, sp->desc);
257 out(O_OK, "%32s %13s %s", sp->name, sp->u.string,
258 sp->desc);
262 out(O_DIE, "stats_publish: unknown type %d", sp->t);