Lines Matching refs:stat
207 struct thread_stat *stat = par->stats; in timerthread() local
229 stat->tid = gettid(); in timerthread()
238 sigev.sigev_notify_thread_id = stat->tid; in timerthread()
270 stat->threadstarted++; in timerthread()
316 if (diff < stat->min) in timerthread()
317 stat->min = diff; in timerthread()
318 if (diff > stat->max) in timerthread()
319 stat->max = diff; in timerthread()
320 stat->avg += (double) diff; in timerthread()
330 stat->act = diff; in timerthread()
331 stat->cycles++; in timerthread()
334 stat->values[stat->cycles & par->bufmsk] = diff; in timerthread()
340 if (par->max_cycles && par->max_cycles == stat->cycles) in timerthread()
360 stat->threadstarted = -1; in timerthread()
499 struct thread_stat *stat = par->stats; in print_stat() local
505 index, stat->tid, par->prio, par->interval, in print_stat()
506 stat->cycles, stat->min, stat->act, in print_stat()
507 stat->cycles ? in print_stat()
508 (long)(stat->avg/stat->cycles) : 0, stat->max); in print_stat()
511 while (stat->cycles != stat->cyclesread) { in print_stat()
512 long diff = stat->values[stat->cyclesread & par->bufmsk]; in print_stat()
513 printf("%8d:%8lu:%8ld\n", index, stat->cyclesread, diff); in print_stat()
514 stat->cyclesread++; in print_stat()
525 struct thread_stat *stat; in main() local
552 stat = calloc(num_threads, sizeof(struct thread_stat)); in main()
553 if (!stat) in main()
558 stat[i].values = calloc(VALBUF_SIZE, sizeof(long)); in main()
559 if (!stat[i].values) in main()
574 par[i].stats = &stat[i]; in main()
575 stat[i].min = 1000000; in main()
576 stat[i].max = -1000000; in main()
577 stat[i].avg = 0.0; in main()
578 pthread_create(&stat[i].thread, NULL, timerthread, &par[i]); in main()
579 stat[i].threadstarted = 1; in main()
597 if(max_cycles && stat[i].cycles >= max_cycles) in main()
613 if (stat[i].threadstarted > 0) in main()
614 pthread_kill(stat[i].thread, SIGTERM); in main()
615 if (stat[i].threadstarted) { in main()
616 pthread_join(stat[i].thread, NULL); in main()
620 if (stat[i].values) in main()
621 free(stat[i].values); in main()
623 free(stat); in main()