Function report |
Source Code:kernel\events\core.c |
Create Date:2022-07-28 13:37:08 |
Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:perf_prepare_sample
Proto:void perf_prepare_sample(struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event, struct pt_regs *regs)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct perf_event_header * | header | |
struct perf_sample_data * | data | |
struct perf_event * | event | |
struct pt_regs * | regs |
6787 | sample_type = sample_type |
6789 | type = PERF_RECORD_SAMPLE |
6790 | size = size of header + header_size |
6792 | misc = 0 |
6793 | misc |= perf_misc_flags(regs) |
6795 | __perf_event_header__init_id(header, data, event) |
6797 | If sample_type & PERF_SAMPLE_IP Then ip = perf_instruction_pointer(regs) |
6800 | If sample_type & PERF_SAMPLE_CALLCHAIN Then |
6801 | size = 1 |
6803 | If Not (sample_type & __PERF_SAMPLE_CALLCHAIN_EARLY) Then callchain = perf_callchain(event, regs) |
6811 | If sample_type & PERF_SAMPLE_RAW Then |
6815 | If raw Then |
6817 | sum = 0 |
6819 | Do |
6824 | When 1 cycle |
6829 | Else |
6836 | If sample_type & PERF_SAMPLE_BRANCH_STACK Then |
6838 | If br_stack Then |
6839 | size += nr * sizeof(structperf_branch_entry) |
6845 | If sample_type & (PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER) Then perf_sample_regs_user( & regs_user, regs, & regs_user_copy) |
6849 | If sample_type & PERF_SAMPLE_REGS_USER Then |
6853 | If regs Then |
6854 | mask = sample_regs_user |
6855 | size += returns the hamming weight of a N-bit word(mask) * sizeof(u64) |
6861 | If sample_type & PERF_SAMPLE_STACK_USER Then |
6868 | stack_size = sample_stack_user |
6871 | stack_size = perf_sample_ustack_size(stack_size, size, regs) |
6879 | If stack_size Then size += sizeof(u64) + stack_size |
6882 | stack_user_size = stack_size |
6886 | If sample_type & PERF_SAMPLE_REGS_INTR Then |
6890 | perf_sample_regs_intr( & regs_intr, regs) |
6892 | If regs Then |
6893 | mask = sample_regs_intr |
6895 | size += returns the hamming weight of a N-bit word(mask) * sizeof(u64) |
6901 | If sample_type & PERF_SAMPLE_PHYS_ADDR Then phys_addr = perf_virt_to_phys(addr) |
6904 | If sample_type & PERF_SAMPLE_AUX Then |
6915 | size = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, U16_MAX - size, aux_sample_size) |
6918 | size = perf_prepare_sample_aux(event, data, size) |
6920 | WARN_ON_ONCE(size + size > U16_MAX) |
6931 | WARN_ON_ONCE(size & 7) |
Name | Describe |
---|---|
__perf_event_output |
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 |