Lines Matching refs:gr

231 query_cpu_load(struct hud_graph *gr, struct pipe_context *pipe)
233 struct cpu_info *info = gr->query_data;
237 if (info->last_time + gr->pane->period <= now) {
245 hud_graph_add_value(gr, cpu_load);
269 struct hud_graph *gr;
278 gr = CALLOC_STRUCT(hud_graph);
279 if (!gr)
283 strcpy(gr->name, "cpu");
285 sprintf(gr->name, "cpu%u", cpu_index);
287 gr->query_data = CALLOC_STRUCT(cpu_info);
288 if (!gr->query_data) {
289 FREE(gr);
293 gr->query_new_value = query_cpu_load;
298 gr->free_query_data = free_query_data;
300 info = gr->query_data;
303 hud_pane_add_graph(pane, gr);
326 query_api_thread_busy_status(struct hud_graph *gr, struct pipe_context *pipe)
328 struct thread_info *info = gr->query_data;
332 if (info->last_time + gr->pane->period*1000 <= now) {
338 struct util_queue_monitoring *mon = gr->pane->hud->monitored_queue;
355 hud_graph_add_value(gr, percent);
370 struct hud_graph *gr;
372 gr = CALLOC_STRUCT(hud_graph);
373 if (!gr)
376 strcpy(gr->name, name);
378 gr->query_data = CALLOC_STRUCT(thread_info);
379 if (!gr->query_data) {
380 FREE(gr);
384 ((struct thread_info*)gr->query_data)->main_thread = main;
385 gr->query_new_value = query_api_thread_busy_status;
390 gr->free_query_data = free_query_data;
392 hud_pane_add_graph(pane, gr);
402 static unsigned get_counter(struct hud_graph *gr, enum hud_counter counter)
404 struct util_queue_monitoring *mon = gr->pane->hud->monitored_queue;
423 query_thread_counter(struct hud_graph *gr, struct pipe_context *pipe)
425 struct counter_info *info = gr->query_data;
429 if (info->last_time + gr->pane->period*1000 <= now) {
430 unsigned current_value = get_counter(gr, info->counter);
432 hud_graph_add_value(gr, current_value - info->last_value);
438 info->last_value = get_counter(gr, info->counter);
446 struct hud_graph *gr = CALLOC_STRUCT(hud_graph);
447 if (!gr)
450 strcpy(gr->name, name);
452 gr->query_data = CALLOC_STRUCT(counter_info);
453 if (!gr->query_data) {
454 FREE(gr);
458 ((struct counter_info*)gr->query_data)->counter = counter;
459 gr->query_new_value = query_thread_counter;
464 gr->free_query_data = free_query_data;
466 hud_pane_add_graph(pane, gr);