函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\pseudo_lock.c Create Date:2022-07-27 09:14:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:measure_residency_fn

函数原型:static int measure_residency_fn(struct perf_event_attr *miss_attr, struct perf_event_attr *hit_attr, struct pseudo_lock_region *plr, struct residency_counts *counts)

返回类型:int

参数:

类型参数名称
struct perf_event_attr *miss_attr
struct perf_event_attr *hit_attr
struct pseudo_lock_region *plr
struct residency_counts *counts
936  hits_before等于0, hits_after等于0, miss_before等于0, miss_after等于0
945  miss_event等于perf_event_create_kernel_counter*@attr: attributes of the counter to create*@cpu: cpu in which the counter is bound*@task: task to profile (NULL for percpu)
947  如果是错误则转到:out
950  hit_event等于perf_event_create_kernel_counter*@attr: attributes of the counter to create*@cpu: cpu in which the counter is bound*@task: task to profile (NULL for percpu)
952  如果是错误则转到:out_miss
955  禁止中断()
960  如果perf_event_read_local(miss_event, & tmp, NULL, NULL)则
961  开中断()
962  转到:out_hit
964  如果perf_event_read_local(hit_event, & tmp, NULL, NULL)则
965  开中断()
966  转到:out_hit
972  wrmsr(MSR_MISC_FEATURE_CONTROL, The bits needed to disable hardware prefetching varies based on the* platform. During initialization we will discover which bits to use., 0x0)
979  miss_pmcnum等于x86_perf_rdpmc_index(miss_event)
980  hit_pmcnum等于x86_perf_rdpmc_index(hit_event)
981  line_size等于READ_ONCE(line_size)
982  mem_r等于READ_ONCE(kmem)
983  size等于READ_ONCE(size)
990  rdpmcl(hit_pmcnum, hits_before)
991  rdpmcl(miss_pmcnum, miss_before)
998  rmb()
999  rdpmcl(hit_pmcnum, hits_before)
1000  rdpmcl(miss_pmcnum, miss_before)
1005  rmb()
1006 i小于size循环
1011  rmb()
1012  asm volatile
1021  rmb()
1022  rdpmcl(hit_pmcnum, hits_after)
1023  rdpmcl(miss_pmcnum, miss_after)
1028  rmb()
1030  wrmsr(MSR_MISC_FEATURE_CONTROL, 0x0, 0x0)
1031  开中断()
1032  out_hit :
1033  perf_event_release_kernel(hit_event)
1034  out_miss :
1035  perf_event_release_kernel(miss_event)
1036  out :
1040  miss_before等于miss_before
1041  hits_before等于hits_before
1042  miss_after等于miss_after
1043  hits_after等于hits_after
1044  返回:0
调用者
名称描述
measure_l2_residency
measure_l3_residency