Lines Matching refs:bpage

344 static void rb_init_page(struct buffer_data_page *bpage)  in rb_init_page()  argument
346 local_set(&bpage->commit, 0); in rb_init_page()
353 static void free_buffer_page(struct buffer_page *bpage) in free_buffer_page() argument
355 free_page((unsigned long)bpage->page); in free_buffer_page()
356 kfree(bpage); in free_buffer_page()
1328 static inline void rb_inc_page(struct buffer_page **bpage) in rb_inc_page() argument
1330 struct list_head *p = rb_list_head((*bpage)->list.next); in rb_inc_page()
1332 *bpage = list_entry(p, struct buffer_page, list); in rb_inc_page()
1453 struct buffer_page *bpage) in rb_check_bpage() argument
1455 unsigned long val = (unsigned long)bpage; in rb_check_bpage()
1486 struct buffer_page *bpage, *tmp; in rb_check_pages() local
1502 list_for_each_entry_safe(bpage, tmp, head, list) { in rb_check_pages()
1504 bpage->list.next->prev != &bpage->list)) in rb_check_pages()
1507 bpage->list.prev->next != &bpage->list)) in rb_check_pages()
1509 if (rb_check_list(cpu_buffer, &bpage->list)) in rb_check_pages()
1521 struct buffer_page *bpage, *tmp; in __rb_allocate_pages() local
1558 bpage = kzalloc_node(ALIGN(sizeof(*bpage), cache_line_size()), in __rb_allocate_pages()
1560 if (!bpage) in __rb_allocate_pages()
1563 rb_check_bpage(cpu_buffer, bpage); in __rb_allocate_pages()
1565 list_add(&bpage->list, pages); in __rb_allocate_pages()
1570 bpage->page = page_address(page); in __rb_allocate_pages()
1571 rb_init_page(bpage->page); in __rb_allocate_pages()
1582 list_for_each_entry_safe(bpage, tmp, pages, list) { in __rb_allocate_pages()
1583 list_del_init(&bpage->list); in __rb_allocate_pages()
1584 free_buffer_page(bpage); in __rb_allocate_pages()
1621 struct buffer_page *bpage; in rb_allocate_cpu_buffer() local
1641 bpage = kzalloc_node(ALIGN(sizeof(*bpage), cache_line_size()), in rb_allocate_cpu_buffer()
1643 if (!bpage) in rb_allocate_cpu_buffer()
1646 rb_check_bpage(cpu_buffer, bpage); in rb_allocate_cpu_buffer()
1648 cpu_buffer->reader_page = bpage; in rb_allocate_cpu_buffer()
1652 bpage->page = page_address(page); in rb_allocate_cpu_buffer()
1653 rb_init_page(bpage->page); in rb_allocate_cpu_buffer()
1681 struct buffer_page *bpage, *tmp; in rb_free_cpu_buffer() local
1688 list_for_each_entry_safe(bpage, tmp, head, list) { in rb_free_cpu_buffer()
1689 list_del_init(&bpage->list); in rb_free_cpu_buffer()
1690 free_buffer_page(bpage); in rb_free_cpu_buffer()
1692 bpage = list_entry(head, struct buffer_page, list); in rb_free_cpu_buffer()
1693 free_buffer_page(bpage); in rb_free_cpu_buffer()
1817 static inline unsigned long rb_page_entries(struct buffer_page *bpage) in rb_page_entries() argument
1819 return local_read(&bpage->entries) & RB_WRITE_MASK; in rb_page_entries()
1822 static inline unsigned long rb_page_write(struct buffer_page *bpage) in rb_page_write() argument
1824 return local_read(&bpage->write) & RB_WRITE_MASK; in rb_page_write()
2006 struct buffer_page *bpage, *tmp; in rb_insert_pages() local
2007 list_for_each_entry_safe(bpage, tmp, &cpu_buffer->new_pages, in rb_insert_pages()
2009 list_del_init(&bpage->list); in rb_insert_pages()
2010 free_buffer_page(bpage); in rb_insert_pages()
2218 struct buffer_page *bpage, *tmp; in ring_buffer_resize() local
2226 list_for_each_entry_safe(bpage, tmp, &cpu_buffer->new_pages, in ring_buffer_resize()
2228 list_del_init(&bpage->list); in ring_buffer_resize()
2229 free_buffer_page(bpage); in ring_buffer_resize()
2249 static __always_inline void *__rb_page_index(struct buffer_page *bpage, unsigned index) in __rb_page_index() argument
2251 return bpage->page->data + index; in __rb_page_index()
2261 static __always_inline unsigned rb_page_commit(struct buffer_page *bpage) in rb_page_commit() argument
2263 return local_read(&bpage->page->commit); in rb_page_commit()
2321 static __always_inline unsigned rb_page_size(struct buffer_page *bpage) in rb_page_size() argument
2323 return rb_page_commit(bpage); in rb_page_size()
2876 struct buffer_page *bpage; in rb_try_to_discard() local
2887 bpage = READ_ONCE(cpu_buffer->tail_page); in rb_try_to_discard()
2897 if (bpage->page == (void *)addr && rb_page_write(bpage) == old_index) { in rb_try_to_discard()
2899 local_read(&bpage->write) & ~RB_WRITE_MASK; in rb_try_to_discard()
2934 index = local_cmpxchg(&bpage->write, old_index, new_index); in rb_try_to_discard()
3287 static void dump_buffer_page(struct buffer_data_page *bpage, in dump_buffer_page() argument
3295 ts = bpage->time_stamp; in dump_buffer_page()
3300 event = (struct ring_buffer_event *)(bpage->data + e); in dump_buffer_page()
3344 struct buffer_data_page *bpage; in check_buffer() local
3349 bpage = info->tail_page->page; in check_buffer()
3353 tail = local_read(&bpage->commit); in check_buffer()
3364 if (tail <= 8 || tail > local_read(&bpage->commit)) in check_buffer()
3373 ts = bpage->time_stamp; in check_buffer()
3377 event = (struct ring_buffer_event *)(bpage->data + e); in check_buffer()
3418 dump_buffer_page(bpage, info, tail); in check_buffer()
3724 struct buffer_page *bpage = cpu_buffer->commit_page; in rb_decrement_entry() local
3730 if (likely(bpage->page == (void *)addr)) { in rb_decrement_entry()
3731 local_dec(&bpage->entries); in rb_decrement_entry()
3739 rb_inc_page(&bpage); in rb_decrement_entry()
3740 start = bpage; in rb_decrement_entry()
3742 if (bpage->page == (void *)addr) { in rb_decrement_entry()
3743 local_dec(&bpage->entries); in rb_decrement_entry()
3746 rb_inc_page(&bpage); in rb_decrement_entry()
3747 } while (bpage != start); in rb_decrement_entry()
4074 struct buffer_page *bpage; in ring_buffer_oldest_event_ts() local
4087 bpage = cpu_buffer->reader_page; in ring_buffer_oldest_event_ts()
4089 bpage = rb_set_head_page(cpu_buffer); in ring_buffer_oldest_event_ts()
4090 if (bpage) in ring_buffer_oldest_event_ts()
4091 ret = bpage->page->time_stamp; in ring_buffer_oldest_event_ts()
5407 struct buffer_data_page *bpage = NULL; in ring_buffer_alloc_read_page() local
5419 bpage = cpu_buffer->free_page; in ring_buffer_alloc_read_page()
5426 if (bpage) in ring_buffer_alloc_read_page()
5434 bpage = page_address(page); in ring_buffer_alloc_read_page()
5437 rb_init_page(bpage); in ring_buffer_alloc_read_page()
5439 return bpage; in ring_buffer_alloc_read_page()
5454 struct buffer_data_page *bpage = data; in ring_buffer_free_read_page() local
5455 struct page *page = virt_to_page(bpage); in ring_buffer_free_read_page()
5466 cpu_buffer->free_page = bpage; in ring_buffer_free_read_page()
5467 bpage = NULL; in ring_buffer_free_read_page()
5474 free_page((unsigned long)bpage); in ring_buffer_free_read_page()
5516 struct buffer_data_page *bpage; in ring_buffer_read_page() local
5540 bpage = *data_page; in ring_buffer_read_page()
5541 if (!bpage) in ring_buffer_read_page()
5596 memcpy(bpage->data + pos, rpage->data + rpos, size); in ring_buffer_read_page()
5613 local_set(&bpage->commit, pos); in ring_buffer_read_page()
5614 bpage->time_stamp = save_timestamp; in ring_buffer_read_page()
5624 rb_init_page(bpage); in ring_buffer_read_page()
5625 bpage = reader->page; in ring_buffer_read_page()
5630 *data_page = bpage; in ring_buffer_read_page()
5638 local_set(&bpage->commit, reader->real_end); in ring_buffer_read_page()
5644 commit = local_read(&bpage->commit); in ring_buffer_read_page()
5653 memcpy(&bpage->data[commit], &missed_events, in ring_buffer_read_page()
5655 local_add(RB_MISSED_STORED, &bpage->commit); in ring_buffer_read_page()
5658 local_add(RB_MISSED_EVENTS, &bpage->commit); in ring_buffer_read_page()
5665 memset(&bpage->data[commit], 0, BUF_PAGE_SIZE - commit); in ring_buffer_read_page()