Lines Matching refs:par
199 struct thread_param *par = param; in timerthread() local
207 struct thread_stat *stat = par->stats; in timerthread()
208 int policy = par->prio ? SCHED_FIFO : SCHED_OTHER; in timerthread()
211 interval.tv_sec = par->interval / USEC_PER_SEC; in timerthread()
212 interval.tv_nsec = (par->interval % USEC_PER_SEC) * 1000; in timerthread()
232 sigaddset(&sigset, par->signal); in timerthread()
235 if (par->mode == MODE_CYCLIC) { in timerthread()
237 sigev.sigev_signo = par->signal; in timerthread()
239 timer_create(par->clock, &sigev, &timer); in timerthread()
244 schedp.sched_priority = par->prio; in timerthread()
248 clock_gettime(par->clock, &now); in timerthread()
252 if (par->mode == MODE_CYCLIC) { in timerthread()
253 if (par->timermode == TIMER_ABSTIME) in timerthread()
259 timer_settime(timer, par->timermode, &tspec, NULL); in timerthread()
262 if (par->mode == MODE_SYS_ITIMER) { in timerthread()
284 switch (par->mode) { in timerthread()
292 if (par->timermode == TIMER_ABSTIME) in timerthread()
293 clock_nanosleep(par->clock, TIMER_ABSTIME, in timerthread()
296 clock_gettime(par->clock, &now); in timerthread()
297 clock_nanosleep(par->clock, TIMER_RELTIME, in timerthread()
306 clock_gettime(par->clock, &now); in timerthread()
313 clock_gettime(par->clock, &now); in timerthread()
333 if (par->bufmsk) in timerthread()
334 stat->values[stat->cycles & par->bufmsk] = diff; in timerthread()
340 if (par->max_cycles && par->max_cycles == stat->cycles) in timerthread()
345 if (par->mode == MODE_CYCLIC) in timerthread()
348 if (par->mode == MODE_SYS_ITIMER) { in timerthread()
497 static void print_stat(struct thread_param *par, int index, int verbose) in print_stat() argument
499 struct thread_stat *stat = par->stats; in print_stat()
505 index, stat->tid, par->prio, par->interval, in print_stat()
512 long diff = stat->values[stat->cyclesread & par->bufmsk]; in print_stat()
524 struct thread_param *par; in main() local
549 par = calloc(num_threads, sizeof(struct thread_param)); in main()
550 if (!par) in main()
561 par[i].bufmsk = VALBUF_SIZE - 1; in main()
564 par[i].prio = priority; in main()
567 par[i].clock = clocksources[clocksel]; in main()
568 par[i].mode = mode; in main()
569 par[i].timermode = timermode; in main()
570 par[i].signal = signum; in main()
571 par[i].interval = interval; in main()
573 par[i].max_cycles = max_cycles; in main()
574 par[i].stats = &stat[i]; in main()
578 pthread_create(&stat[i].thread, NULL, timerthread, &par[i]); in main()
596 print_stat(&par[i], i, verbose); in main()
618 print_stat(&par[i], i, 0); in main()
625 free(par); in main()