Lines Matching refs:queues
218 int auxtrace_queues__init(struct auxtrace_queues *queues) in auxtrace_queues__init() argument
220 queues->nr_queues = AUXTRACE_INIT_NR_QUEUES; in auxtrace_queues__init()
221 queues->queue_array = auxtrace_alloc_queue_array(queues->nr_queues); in auxtrace_queues__init()
222 if (!queues->queue_array) in auxtrace_queues__init()
227 static int auxtrace_queues__grow(struct auxtrace_queues *queues, in auxtrace_queues__grow() argument
230 unsigned int nr_queues = queues->nr_queues; in auxtrace_queues__grow()
240 if (nr_queues < queues->nr_queues || nr_queues < new_nr_queues) in auxtrace_queues__grow()
247 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__grow()
248 list_splice_tail(&queues->queue_array[i].head, in auxtrace_queues__grow()
250 queue_array[i].tid = queues->queue_array[i].tid; in auxtrace_queues__grow()
251 queue_array[i].cpu = queues->queue_array[i].cpu; in auxtrace_queues__grow()
252 queue_array[i].set = queues->queue_array[i].set; in auxtrace_queues__grow()
253 queue_array[i].priv = queues->queue_array[i].priv; in auxtrace_queues__grow()
256 queues->nr_queues = nr_queues; in auxtrace_queues__grow()
257 queues->queue_array = queue_array; in auxtrace_queues__grow()
284 static int auxtrace_queues__queue_buffer(struct auxtrace_queues *queues, in auxtrace_queues__queue_buffer() argument
291 if (idx >= queues->nr_queues) { in auxtrace_queues__queue_buffer()
292 err = auxtrace_queues__grow(queues, idx + 1); in auxtrace_queues__queue_buffer()
297 queue = &queues->queue_array[idx]; in auxtrace_queues__queue_buffer()
305 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer()
309 queues->new_data = true; in auxtrace_queues__queue_buffer()
310 queues->populated = true; in auxtrace_queues__queue_buffer()
318 static int auxtrace_queues__split_buffer(struct auxtrace_queues *queues, in auxtrace_queues__split_buffer() argument
333 err = auxtrace_queues__queue_buffer(queues, idx, b); in auxtrace_queues__split_buffer()
356 static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues, in auxtrace_queues__add_buffer() argument
381 err = auxtrace_queues__split_buffer(queues, idx, buffer); in auxtrace_queues__add_buffer()
386 err = auxtrace_queues__queue_buffer(queues, idx, buffer); in auxtrace_queues__add_buffer()
401 int auxtrace_queues__add_event(struct auxtrace_queues *queues, in auxtrace_queues__add_event() argument
417 return auxtrace_queues__add_buffer(queues, session, idx, &buffer, in auxtrace_queues__add_event()
421 static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues, in auxtrace_queues__add_indexed_event() argument
441 err = auxtrace_queues__add_event(queues, session, event, in auxtrace_queues__add_indexed_event()
448 void auxtrace_queues__free(struct auxtrace_queues *queues) in auxtrace_queues__free() argument
452 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__free()
453 while (!list_empty(&queues->queue_array[i].head)) { in auxtrace_queues__free()
456 buffer = list_entry(queues->queue_array[i].head.next, in auxtrace_queues__free()
463 zfree(&queues->queue_array); in auxtrace_queues__free()
464 queues->nr_queues = 0; in auxtrace_queues__free()
986 static int auxtrace_queues__process_index_entry(struct auxtrace_queues *queues, in auxtrace_queues__process_index_entry() argument
990 return auxtrace_queues__add_indexed_event(queues, session, in auxtrace_queues__process_index_entry()
994 int auxtrace_queues__process_index(struct auxtrace_queues *queues, in auxtrace_queues__process_index() argument
1008 err = auxtrace_queues__process_index_entry(queues, in auxtrace_queues__process_index()
1034 struct auxtrace_queue *auxtrace_queues__sample_queue(struct auxtrace_queues *queues, in auxtrace_queues__sample_queue() argument
1052 if (idx >= queues->nr_queues) in auxtrace_queues__sample_queue()
1055 return &queues->queue_array[idx]; in auxtrace_queues__sample_queue()
1058 int auxtrace_queues__add_sample(struct auxtrace_queues *queues, in auxtrace_queues__add_sample() argument
1084 return auxtrace_queues__add_buffer(queues, session, idx, &buffer, NULL); in auxtrace_queues__add_sample()