Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\cpuacct.c Create Date:2022-07-28 09:44:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:cpuacct_cpuusage_read

Proto:static u64 cpuacct_cpuusage_read(struct cpuacct *ca, int cpu, enum cpuacct_stat_index index)

Type:u64

Parameter:

TypeParameterName
struct cpuacct *ca
intcpu
enum cpuacct_stat_indexindex
101  cpuusage = per_cpu_ptr(cpuusage holds pointer to a u64-type object on every CPU , cpu)
108  BUG_ON(index > CPUACCT_STAT_NSTATS)
114  raw_spin_lock_irq( & lock)
117  If index == CPUACCT_STAT_NSTATS Then
118  i = 0
120  data = 0
121  When i < CPUACCT_STAT_NSTATS cycle data += usages[i]
123  Else
124  data = usages[index]
128  raw_spin_unlock_irq( & lock)
131  Return data
Caller
NameDescribe
__cpuusage_readReturn total CPU usage (in nanoseconds) of a group
__cpuacct_percpu_seq_show