Lines Matching refs:ctl
111 struct event_throttle_ctl *ctl; in event_throttle() local
117 ctl = &proc->throttle_ctl; in event_throttle()
118 if (ctl->is_up) { in event_throttle()
119 pthread_mutex_lock(&ctl->mtx); in event_throttle()
120 current_rate = ctl->event_counter / THROTTLE_WINDOW; in event_throttle()
122 ctl->event_counter++; in event_throttle()
126 ctl->throttle_count++; in event_throttle()
128 event->type, ctl->throttle_count); in event_throttle()
130 pthread_mutex_unlock(&ctl->mtx); in event_throttle()
138 struct event_throttle_ctl *ctl = (struct event_throttle_ctl *)arg; in throttle_timer_cb() local
139 pthread_mutex_lock(&ctl->mtx); in throttle_timer_cb()
140 ctl->event_counter = 0; in throttle_timer_cb()
141 pthread_mutex_unlock(&ctl->mtx); in throttle_timer_cb()
147 struct event_throttle_ctl *ctl; in vm_event_throttle_init() local
152 ctl = &ve_proc[i].throttle_ctl; in vm_event_throttle_init()
153 ctl->event_counter = 0U; in vm_event_throttle_init()
154 ctl->throttle_count = 0U; in vm_event_throttle_init()
155 ctl->is_up = false; in vm_event_throttle_init()
156 pthread_mutex_init(&ctl->mtx, NULL); in vm_event_throttle_init()
157 ctl->timer.clockid = CLOCK_MONOTONIC; in vm_event_throttle_init()
158 ret = acrn_timer_init(&ctl->timer, throttle_timer_cb, ctl); in vm_event_throttle_init()
167 ret = acrn_timer_settime(&ctl->timer, &timer_spec); in vm_event_throttle_init()
172 ctl->is_up = true; in vm_event_throttle_init()
179 struct event_throttle_ctl *ctl; in vm_event_throttle_deinit() local
182 ctl = &ve_proc[i].throttle_ctl; in vm_event_throttle_deinit()
183 if (ctl->timer.fd != -1) { in vm_event_throttle_deinit()
184 acrn_timer_deinit(&ctl->timer); in vm_event_throttle_deinit()