| Function report | 
| Source Code: arch\x86\kernel\cpu\resctrl\pseudo_lock.c | Create Date:2022-07-28 08:14:06 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:measure_residency_fn
Proto: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)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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 | If IS_ERR(miss_event) Then Go to 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) | 
| 955 | local_irq_disable() | 
| 960 | If perf_event_read_local(miss_event, & tmp, NULL, NULL) Then | 
| 962 | Go to out_hit | 
| 964 | If perf_event_read_local(hit_event, & tmp, NULL, NULL) Then | 
| 966 | Go to 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) | 
| 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() | 
| 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) | 
| 1032 | out_hit : | 
| 1034 | out_miss : | 
| 1036 | out : | 
| 1040 | miss_before = miss_before | 
| 1041 | hits_before = hits_before | 
| 1042 | miss_after = miss_after | 
| 1043 | hits_after = hits_after | 
| 1044 | Return 0 | 
| Name | Describe | 
|---|---|
| measure_l2_residency | |
| measure_l3_residency | 
| 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 |