• Home
  • Raw
  • Download

Lines Matching refs:iter

2335 rb_iter_head_event(struct ring_buffer_iter *iter)  in rb_iter_head_event()  argument
2338 struct buffer_page *iter_head_page = iter->head_page; in rb_iter_head_event()
2342 if (iter->head != iter->next_event) in rb_iter_head_event()
2343 return iter->event; in rb_iter_head_event()
2354 if (iter->head > commit - 8) in rb_iter_head_event()
2357 event = __rb_page_index(iter_head_page, iter->head); in rb_iter_head_event()
2366 if ((iter->head + length) > commit || length > BUF_PAGE_SIZE) in rb_iter_head_event()
2370 memcpy(iter->event, event, length); in rb_iter_head_event()
2378 if (iter->page_stamp != iter_head_page->page->time_stamp || in rb_iter_head_event()
2382 iter->next_event = iter->head + length; in rb_iter_head_event()
2383 return iter->event; in rb_iter_head_event()
2386 iter->page_stamp = iter->read_stamp = iter->head_page->page->time_stamp; in rb_iter_head_event()
2387 iter->head = 0; in rb_iter_head_event()
2388 iter->next_event = 0; in rb_iter_head_event()
2389 iter->missed_events = 1; in rb_iter_head_event()
2413 static void rb_inc_iter(struct ring_buffer_iter *iter) in rb_inc_iter() argument
2415 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; in rb_inc_iter()
2423 if (iter->head_page == cpu_buffer->reader_page) in rb_inc_iter()
2424 iter->head_page = rb_set_head_page(cpu_buffer); in rb_inc_iter()
2426 rb_inc_page(&iter->head_page); in rb_inc_iter()
2428 iter->page_stamp = iter->read_stamp = iter->head_page->page->time_stamp; in rb_inc_iter()
2429 iter->head = 0; in rb_inc_iter()
2430 iter->next_event = 0; in rb_inc_iter()
4332 static void rb_iter_reset(struct ring_buffer_iter *iter) in rb_iter_reset() argument
4334 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; in rb_iter_reset()
4337 iter->head_page = cpu_buffer->reader_page; in rb_iter_reset()
4338 iter->head = cpu_buffer->reader_page->read; in rb_iter_reset()
4339 iter->next_event = iter->head; in rb_iter_reset()
4341 iter->cache_reader_page = iter->head_page; in rb_iter_reset()
4342 iter->cache_read = cpu_buffer->read; in rb_iter_reset()
4344 if (iter->head) { in rb_iter_reset()
4345 iter->read_stamp = cpu_buffer->read_stamp; in rb_iter_reset()
4346 iter->page_stamp = cpu_buffer->reader_page->page->time_stamp; in rb_iter_reset()
4348 iter->read_stamp = iter->head_page->page->time_stamp; in rb_iter_reset()
4349 iter->page_stamp = iter->read_stamp; in rb_iter_reset()
4360 void ring_buffer_iter_reset(struct ring_buffer_iter *iter) in ring_buffer_iter_reset() argument
4365 if (!iter) in ring_buffer_iter_reset()
4368 cpu_buffer = iter->cpu_buffer; in ring_buffer_iter_reset()
4371 rb_iter_reset(iter); in ring_buffer_iter_reset()
4380 int ring_buffer_iter_empty(struct ring_buffer_iter *iter) in ring_buffer_iter_empty() argument
4391 cpu_buffer = iter->cpu_buffer; in ring_buffer_iter_empty()
4417 return ((iter->head_page == commit_page && iter->head >= commit) || in ring_buffer_iter_empty()
4418 (iter->head_page == reader && commit_page == head_page && in ring_buffer_iter_empty()
4420 iter->head == rb_page_commit(cpu_buffer->reader_page))); in ring_buffer_iter_empty()
4456 rb_update_iter_read_stamp(struct ring_buffer_iter *iter, in rb_update_iter_read_stamp() argument
4467 iter->read_stamp += delta; in rb_update_iter_read_stamp()
4472 delta = rb_fix_abs_ts(delta, iter->read_stamp); in rb_update_iter_read_stamp()
4473 iter->read_stamp = delta; in rb_update_iter_read_stamp()
4477 iter->read_stamp += event->time_delta; in rb_update_iter_read_stamp()
4481 RB_WARN_ON(iter->cpu_buffer, 1); in rb_update_iter_read_stamp()
4801 static void rb_advance_iter(struct ring_buffer_iter *iter) in rb_advance_iter() argument
4805 cpu_buffer = iter->cpu_buffer; in rb_advance_iter()
4808 if (iter->head == iter->next_event) { in rb_advance_iter()
4810 if (rb_iter_head_event(iter) == NULL) in rb_advance_iter()
4814 iter->head = iter->next_event; in rb_advance_iter()
4819 if (iter->next_event >= rb_page_size(iter->head_page)) { in rb_advance_iter()
4821 if (iter->head_page == cpu_buffer->commit_page) in rb_advance_iter()
4823 rb_inc_iter(iter); in rb_advance_iter()
4827 rb_update_iter_read_stamp(iter, iter->event); in rb_advance_iter()
4910 rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts) in rb_iter_peek() argument
4920 cpu_buffer = iter->cpu_buffer; in rb_iter_peek()
4928 if (unlikely(iter->cache_read != cpu_buffer->read || in rb_iter_peek()
4929 iter->cache_reader_page != cpu_buffer->reader_page)) in rb_iter_peek()
4930 rb_iter_reset(iter); in rb_iter_peek()
4933 if (ring_buffer_iter_empty(iter)) in rb_iter_peek()
4949 if (iter->head >= rb_page_size(iter->head_page)) { in rb_iter_peek()
4950 rb_inc_iter(iter); in rb_iter_peek()
4954 event = rb_iter_head_event(iter); in rb_iter_peek()
4961 rb_inc_iter(iter); in rb_iter_peek()
4964 rb_advance_iter(iter); in rb_iter_peek()
4969 rb_advance_iter(iter); in rb_iter_peek()
4975 *ts = rb_fix_abs_ts(*ts, iter->head_page->page->time_stamp); in rb_iter_peek()
4980 rb_advance_iter(iter); in rb_iter_peek()
4985 *ts = iter->read_stamp + event->time_delta; in rb_iter_peek()
5073 bool ring_buffer_iter_dropped(struct ring_buffer_iter *iter) in ring_buffer_iter_dropped() argument
5075 bool ret = iter->missed_events != 0; in ring_buffer_iter_dropped()
5077 iter->missed_events = 0; in ring_buffer_iter_dropped()
5091 ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts) in ring_buffer_iter_peek() argument
5093 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; in ring_buffer_iter_peek()
5099 event = rb_iter_peek(iter, ts); in ring_buffer_iter_peek()
5250 struct ring_buffer_iter *iter; in ring_buffer_read_prepare() local
5255 iter = kzalloc(sizeof(*iter), flags); in ring_buffer_read_prepare()
5256 if (!iter) in ring_buffer_read_prepare()
5260 iter->event = kmalloc(BUF_PAGE_SIZE, flags); in ring_buffer_read_prepare()
5261 if (!iter->event) { in ring_buffer_read_prepare()
5262 kfree(iter); in ring_buffer_read_prepare()
5268 iter->cpu_buffer = cpu_buffer; in ring_buffer_read_prepare()
5274 return iter; in ring_buffer_read_prepare()
5304 ring_buffer_read_start(struct ring_buffer_iter *iter) in ring_buffer_read_start() argument
5309 if (!iter) in ring_buffer_read_start()
5312 cpu_buffer = iter->cpu_buffer; in ring_buffer_read_start()
5316 rb_iter_reset(iter); in ring_buffer_read_start()
5330 ring_buffer_read_finish(struct ring_buffer_iter *iter) in ring_buffer_read_finish() argument
5332 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; in ring_buffer_read_finish()
5346 kfree(iter->event); in ring_buffer_read_finish()
5347 kfree(iter); in ring_buffer_read_finish()
5358 void ring_buffer_iter_advance(struct ring_buffer_iter *iter) in ring_buffer_iter_advance() argument
5360 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; in ring_buffer_iter_advance()
5365 rb_advance_iter(iter); in ring_buffer_iter_advance()