Lines Matching refs:stat

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