Function report |
Source Code:kernel\trace\ring_buffer.c |
Create Date:2022-07-28 11:55:44 |
Last Modify:2020-03-17 19:30:04 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:g_buffer_read_page - extract a page from the ring buffer*@buffer: buffer to extract from*@data_page: the page to use allocated from ring_buffer_alloc_read_page*@len: amount to extract*@cpu: the cpu of the buffer to extract
Proto:int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, size_t len, int cpu, int full)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct ring_buffer * | buffer | |
void ** | data_page | |
size_t | len | |
int | cpu | |
int | full |
4703 | cpu_buffer = buffers[cpu] |
4712 | ret = -1 |
4714 | If Not pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0 Then Go to out |
4721 | If len <= BUF_PAGE_HDR_SIZE Then Go to out |
4724 | len -= BUF_PAGE_HDR_SIZE |
4733 | raw_spin_lock_irqsave( & serialize readers , flags) |
4735 | reader = rb_get_reader_page(cpu_buffer) |
4736 | If Not reader Then Go to out_unlock |
4739 | event = rb_reader_event(cpu_buffer) |
4741 | read = dex for next read |
4742 | commit = rb_page_commit(reader) |
4745 | missed_events = lost_events |
4754 | If read || len < commit - read || reader_page == committed pages Then |
4756 | rpage = Actual data page |
4758 | pos = 0 |
4761 | If full Then Go to out_unlock |
4768 | size = Return total length of time extend and data,* or just the event length for all other events. |
4770 | If len < size Then Go to out_unlock |
4774 | save_timestamp = read_stamp |
4777 | Do |
4784 | size = Return the length of the given event. Will return* the length of the time extend if the event is a* time extend. |
4785 | No 3D Now!( data of buffer page + pos, data of buffer page + rpos, size) |
4789 | rb_advance_reader(cpu_buffer) |
4790 | rpos = dex for next read |
4796 | event = rb_reader_event(cpu_buffer) |
4802 | local_set( & write committed index , pos) |
4803 | page time stamp = save_timestamp |
4806 | read = 0 |
4807 | Else |
4809 | read += rb_page_entries(reader) |
4810 | read_bytes += BUF_PAGE_SIZE |
4813 | rb_init_page(bpage) |
4814 | bpage = Actual data page |
4815 | Actual data page = data_page |
4816 | local_set( & dex for next write , 0) |
4817 | local_set( & ries on this page , 0) |
4818 | dex for next read = 0 |
4826 | If al end of data Then local_set( & write committed index , al end of data ) |
4831 | lost_events = 0 |
4833 | commit = local_read( & write committed index ) |
4837 | If missed_events Then |
4841 | If BUF_PAGE_SIZE - commit >= size of missed_events Then |
4842 | No 3D Now!( & data of buffer page [commit], & missed_events, size of missed_events ) |
4845 | commit += size of missed_events |
4853 | If commit < BUF_PAGE_SIZE Then memset( & data of buffer page [commit], 0, BUF_PAGE_SIZE - commit) |
4856 | out_unlock : |
4857 | raw_spin_unlock_irqrestore( & serialize readers , flags) |
4859 | out : |
4860 | Return ret |
Name | Describe |
---|---|
read_page | |
tracing_buffers_read | |
tracing_buffers_splice_read |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |