Lines Matching defs:reader

99  * associated with the CPU it is currently executing on.  A reader may read
102 * The reader is special. For each per cpu buffer, the reader has its own
103 * reader page. When a reader has read the entire reader page, this reader
106 * Now, as long as the writer is off the reader page, the reader can do what
113 * |reader| RING BUFFER
124 * |reader| RING BUFFER
135 * |reader| RING BUFFER
156 * After we make this swap, the reader can hand this page off to the splice
780 /* The reader can read an empty page, but not more than that */
1160 * The reader page is always off the ring buffer, but when the
1161 * reader finishes with a page, it needs to swap its page with
1162 * a new one from the buffer. The reader needs to take from
1168 * The reader must be careful to replace only the head page, and
1170 * ASCII art, the reader sets its old page to point to the next
1172 * the old reader page. But if the writer moves the head page
1173 * during this operation, the reader could end up with the tail.
1211 * What the above shows is that the reader just swapped out
1212 * the reader page with a page in the buffer, but before it
1215 * the new page added by the reader and is about to move forward
1246 * Because the reader may move the head_page pointer, we can
1248 * the reader page). But if the next page is a header page,
1267 * The unique thing about the reader page, is that, if the
1269 * back to the reader page.
1350 /* check if the reader took the page */
1639 /* Include the reader page */
2004 /* Make the head_page the reader page */
2057 /* Do the reader page - reader must be previous to head. */
2095 * If the ring buffer was rewound, then inject the reader page
2105 /* If the commit_buffer is the reader page, update the commit page */
2108 /* Nothing more to do, the only page is the reader page */
2116 /* The original reader page has already been checked/counted. */
2161 /* Reset the reader page */
2551 bpage->page = ring_buffer_desc_page(desc, cpu_buffer->meta_page->reader.id);
2784 /* Need at least two pages plus the reader page */
2803 /* nr_pages should not count the reader page */
2999 * We don't race with the readers since we have acquired the reader
3010 * tail page might be on reader page, we remove the next page
3105 * We are holding the reader lock, so the reader page won't be swapped
3108 * We are going to adapt the reader page update process where:
3244 * Don't succeed if resizing is disabled, as a reader might be
3328 * Don't succeed if resizing is disabled, as a reader might be
3524 * The iterator could be on the reader page (it starts there).
3525 * But the head could have moved, since the reader was
3570 struct buffer_page *reader)
3574 void *new_reader = reader->page;
3577 id = reader->id;
3579 reader->id = 0;
3584 /* The head pointer is the one after the reader */
3585 rb_update_meta_head(cpu_buffer, reader);
3621 * MOVED - a reader on another CPU moved the next
3622 * pointer to its reader page. Give up
3662 * The reader is on another CPU and just did
3674 * set to UPDATE. This will keep the reader from
3675 * swapping the head page with the reader page.
3676 * The reader (on another CPU) will spin till
3769 * and the reader will ignore it.
3782 * This will be used by the reader to add lost event
3862 * We are fighting against races between a reader that
3863 * could be on another CPU trying to swap its reader
3871 * reader page.
3876 * If the commit is not on the reader page, then
3899 * commit page could still be on the reader
5022 * Because the commit page may be on the reader page we
5349 * if the tail is on reader_page, oldest time stamp is on the reader
5636 struct buffer_page *reader;
5645 reader = cpu_buffer->reader_page;
5671 (iter->head_page == reader && commit_page == head_page &&
5745 /* More to read on the reader page */
5752 prev_reader = cpu_buffer->subbuf_ids[cpu_buffer->meta_page->reader.id];
5756 /* nr_pages doesn't include the reader page */
5757 if (WARN_ON_ONCE(cpu_buffer->meta_page->reader.id > cpu_buffer->nr_pages))
5760 new_reader = cpu_buffer->subbuf_ids[cpu_buffer->meta_page->reader.id];
5764 prev_head = new_reader; /* New reader was also the previous head */
5790 cpu_buffer->lost_events = cpu_buffer->meta_page->reader.lost_events;
5800 struct buffer_page *reader = NULL;
5813 * start of the reader inserts an empty page, it causes a
5821 reader = NULL;
5825 reader = cpu_buffer->reader_page;
5828 if (cpu_buffer->reader_page->read < rb_page_size(reader))
5833 cpu_buffer->reader_page->read > rb_page_size(reader)))
5837 reader = NULL;
5846 * Reset the reader page to size zero.
5855 * Splice the empty reader page into the list around the head.
5857 reader = rb_set_head_page(cpu_buffer);
5858 if (!reader)
5860 cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next);
5861 cpu_buffer->reader_page->list.prev = reader->list.prev;
5868 cpu_buffer->pages = reader->list.prev;
5870 /* The reader page will be pointing to the new head */
5877 * side. Note, the reader will constantly fail the swap
5896 ret = rb_head_page_replace(reader, cpu_buffer->reader_page);
5904 if (rb_page_commit(reader) & RB_MISSED_EVENTS)
5908 rb_update_meta_reader(cpu_buffer, reader);
5913 * Now make the new head point back to the reader page.
5915 rb_list_head(reader->list.next)->prev = &cpu_buffer->reader_page->list;
5921 /* Finally update the reader page to the new head */
5922 cpu_buffer->reader_page = reader;
5934 if (reader && reader->read == 0)
5935 cpu_buffer->read_stamp = reader->page->time_stamp;
5947 if (likely(!reader || rb_page_write(reader) <= bsize))
5952 /* Get the latest version of the reader write value */
5958 reader = NULL;
5964 * In addition, a writer may be writing on the reader page
5974 return reader;
5987 struct buffer_page *reader;
5990 reader = rb_get_reader_page(cpu_buffer);
5993 if (RB_WARN_ON(cpu_buffer, !reader))
6047 struct buffer_page *reader;
6062 reader = rb_get_reader_page(cpu_buffer);
6063 if (!reader)
6090 *ts = rb_fix_abs_ts(*ts, reader->page->time_stamp);
6493 * where the current reader page is.
6530 meta->reader.read = cpu_buffer->reader_page->read;
6531 meta->reader.id = rb_page_id(cpu_buffer, cpu_buffer->reader_page,
6534 meta->reader.lost_events = cpu_buffer->lost_events;
7053 * the writer is off the reader page.
7071 struct buffer_page *reader;
7103 reader = rb_get_reader_page(cpu_buffer);
7104 if (!reader)
7109 read = reader->read;
7110 commit = rb_page_commit(reader);
7111 size = rb_page_size(reader);
7138 * the reader page.
7174 rpos = reader->read;
7193 cpu_buffer->read += rb_page_entries(reader);
7194 cpu_buffer->read_bytes += rb_page_size(reader);
7198 dpage = reader->page;
7199 reader->page = data_page->data;
7200 local_set(&reader->write, 0);
7201 local_set(&reader->entries, 0);
7202 reader->read = 0;
7212 if (reader->real_end)
7213 local_set(&dpage->commit, reader->real_end);
7376 /* Include the reader page */
7414 /* One page was allocated for the reader page */
7642 nr_subbufs = cpu_buffer->nr_pages + 1; /* + reader-subbuf */
7743 /* subbuf_ids includes the reader while nr_pages does not */
7839 struct buffer_page *reader;
7857 * There are data to be read on the current reader page, we can
7859 * everything. Let's update the kernel reader accordingly.
7867 /* Did the reader catch up with the writer? */
7871 reader = rb_get_reader_page(cpu_buffer);
7872 if (WARN_ON(!reader))
7880 struct buffer_data_page *dpage = reader->page;
7887 if (reader->real_end)
7888 local_set(&dpage->commit, reader->real_end);
7893 commit = rb_page_size(reader);
7905 * is on the reader page. But if the tail page is not on the
7906 * reader page and the commit_page is, that would mean that