函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:event_sched_in

函数原型:static int event_sched_in(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx)

返回类型:int

参数:

类型参数名称
struct perf_event *event
struct perf_cpu_context *cpuctx
struct perf_event_context *ctx
2351  ret等于0
2353  lockdep_assert_held( & Protect the states of the events in the list,* nr_active, and the list:)
2355  如果state小于等于PERF_EVENT_STATE_OFF则返回:0
2358  WRITE_ONCE(oncpu, 当前cpu ID())
2364  smp_wmb()
2365  perf_event_set_state(event, PERF_EVENT_STATE_ACTIVE)
2372  如果此条件成立可能性小(为编译器优化)(interrupts == MAX_INTERRUPTS)则
2373  perf_log_throttle(event, 1)
2374  interrupts等于0
2377  perf_pmu_disable(pmu)
2379  perf_set_shadow_time(event, ctx)
2381  perf_log_itrace_start(event)
2383  如果add(event, start the counter when adding )则
2384  perf_event_set_state(event, PERF_EVENT_STATE_INACTIVE)
2385  oncpu等于负1
2386  ret等于负EAGAIN
2387  转到:out
2390  如果非is_software_event(event)则active_oncpu自加
2392  如果非nr_active自加则perf_event_ctx_activate(), perf_event_ctx_deactivate(), and* perf_event_task_tick() are fully serialized because they're strictly cpu* affine and perf_event_ctx{activate,deactivate} are called with IRQs
2394  如果freqsample_freqnr_freq自加
2397  如果exclusiveexclusive等于1
2400  out :
2401  perf_pmu_enable(pmu)
2403  返回:ret
调用者
名称描述
group_sched_in