Home | History | Annotate | Download | only in src

Lines Matching defs:stat

27 #include <sys/stat.h>
98 struct thread_stat *stat = par->stats;
119 stat->tid = gettid();
129 stat->threadstarted++;
154 if (!par->id && !(stat->cycles & 0x0F))
159 pthread_kill(stat->tothread, SIGUSR1);
170 if (diff < stat->min)
171 stat->min = diff;
172 if (diff > stat->max)
173 stat->max = diff;
174 stat->avg += (double) diff;
184 stat->act = diff;
185 stat->cycles++;
188 stat->values[stat->cycles & par->bufmsk] = diff;
190 if (par->max_cycles && par->max_cycles == stat->cycles)
199 stat->threadstarted = -1;
293 struct thread_stat *stat = par->stats;
299 index, stat->tid, par->prio,
300 stat->cycles, stat->min, stat->act,
301 stat->cycles ?
302 (long)(stat->avg/stat->cycles) : 0, stat->max);
305 while (stat->cycles != stat->cyclesread) {
306 long diff = stat->values[stat->cyclesread & par->bufmsk];
307 printf("%8d:%8lu:%8ld\n", index, stat->cyclesread, diff);
308 stat->cyclesread++;
318 struct thread_stat *stat;
340 stat = calloc(num_threads, sizeof(struct thread_stat));
341 if (!stat)
346 stat[i].values = calloc(VALBUF_SIZE, sizeof(long));
347 if (!stat[i].values)
360 par[i].stats = &stat[i];
361 stat[i].min = 1000000;
362 stat[i].max = -1000000;
363 stat[i].avg = 0.0;
364 stat[i].threadstarted = 1;
365 pthread_create(&stat[i].thread, NULL, signalthread, &par[i]);
372 if (stat[i].threadstarted != 2)
379 stat[i].tothread = stat[i+1].thread;
380 stat[i].tothread = stat[0].thread;
383 pthread_kill(stat[0].thread, signum);
398 if(max_cycles && stat[0].cycles >= max_cycles)
414 if (stat[i].threadstarted > 0)
415 pthread_kill(stat[i].thread, SIGTERM);
416 if (stat[i].threadstarted) {
417 pthread_join(stat[i].thread, NULL);
421 if (stat[i].values)
422 free(stat[i].values);
424 free(stat);