函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:56:55
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perf_prepare_sample

函数原型:void perf_prepare_sample(struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event, struct pt_regs *regs)

返回类型:void

参数:

类型参数名称
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等于header的长度加header_size
6792  misc等于0
6793  misc或等于perf_misc_flags(regs)
6795  __perf_event_header__init_id(header, data, event)
6797  如果sample_type按位与PERF_SAMPLE_IPip等于perf_instruction_pointer(regs)
6800  如果sample_type按位与PERF_SAMPLE_CALLCHAIN
6801  size等于1
6803  如果非sample_type按位与__PERF_SAMPLE_CALLCHAIN_EARLY的值则callchain等于perf_callchain(event, regs)
6806  size加等于nr
6808  size加等于sizesizeof(u64)
6811  如果sample_type按位与PERF_SAMPLE_RAW
6812  raw等于raw
6815  如果raw
6816  frag等于frag
6817  sum等于0
6819  循环
6820  sum加等于size
6821  如果perf_raw_frag_last(frag)则退出
6823  frag等于next
6824  当1循环
6827  size等于sizesizeof(u32)
6828  pad等于sizesum
6829  否则
6830  size等于sizeof(u64)
6833  size加等于size
6836  如果sample_type按位与PERF_SAMPLE_BRANCH_STACK
6837  size等于sizeof(u64)
6838  如果br_stack
6839  size加等于nrsizeof(structperf_branch_entry)
6842  size加等于size
6845  如果sample_type按位与PERF_SAMPLE_REGS_USER按位或PERF_SAMPLE_STACK_USER的值则perf_sample_regs_user( & regs_user, regs, & regs_user_copy)
6849  如果sample_type按位与PERF_SAMPLE_REGS_USER
6851  size等于sizeof(u64)
6853  如果regs
6854  mask等于sample_regs_user
6855  size加等于hweight64(mask)乘sizeof(u64)
6858  size加等于size
6861  如果sample_type按位与PERF_SAMPLE_STACK_USER
6868  stack_size等于sample_stack_user
6869  size等于sizeof(u64)
6871  stack_size等于perf_sample_ustack_size(stack_size, size, regs)
6879  如果stack_sizesize加等于sizeof(u64)加stack_size
6882  stack_user_size等于stack_size
6883  size加等于size
6886  如果sample_type按位与PERF_SAMPLE_REGS_INTR
6888  size等于sizeof(u64)
6890  perf_sample_regs_intr( & regs_intr, regs)
6892  如果regs
6893  mask等于sample_regs_intr
6895  size加等于hweight64(mask)乘sizeof(u64)
6898  size加等于size
6901  如果sample_type按位与PERF_SAMPLE_PHYS_ADDRphys_addr等于perf_virt_to_phys(addr)
6904  如果sample_type按位与PERF_SAMPLE_AUX
6907  size加等于sizeof(u64)
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)
6917  size等于unddown - round down to next specified multiple*@x: the value to round*@y: multiple to round down to* Rounds @x down to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_down().(size, 8)
6918  size等于perf_prepare_sample_aux(event, data, size)
6920  WARN_ON_ONCE(size + size > U16_MAX)
6921  size加等于size
6931  WARN_ON_ONCE(size & 7)
调用者
名称描述
__perf_event_output