Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_sysinfo - fill in sysinfo struct*@info: pointer to buffer to fill

Proto:static int do_sysinfo(struct sysinfo *info)

Type:int

Parameter:

TypeParameterName
struct sysinfo *info
2521  memset(info, 0, sizeof(structsysinfo))
2523  mespec64/time64_t interfaces utilizing the ktime based ones* for API completeness, these could be implemented more efficiently* if needed.
2524  Seconds since boot = seconds + If nanoseconds Then 1 Else 0
2526  get_avenrun( 1, 5, and 15 minute load averages , 0, SI_LOAD_SHIFT - r of bits of precision )
2528  Number of current processes = counter of threads
2530  si_meminfo(info)
2531  si_swapinfo(info)
2542  mem_total = Total usable main memory size + Total swap space size
2543  If mem_total < Total usable main memory size || mem_total < Total swap space size Then Go to out
2545  bitcount = 0
2546  mem_unit = Memory unit size in bytes
2547  When mem_unit > 1 cycle
2548  bitcount++
2549  mem_unit >>= 1
2550  sav_total = mem_total
2551  mem_total <<= 1
2552  If mem_total < sav_total Then Go to out
2563  Memory unit size in bytes = 1
2564  Total usable main memory size <<= bitcount
2565  Available memory size <<= bitcount
2566  Amount of shared memory <<= bitcount
2567  Memory used by buffers <<= bitcount
2568  Total swap space size <<= bitcount
2569  swap space still available <<= bitcount
2570  Total high memory size <<= bitcount
2571  Available high memory size <<= bitcount
2573  out :
2574  Return 0
Caller
NameDescribe
SYSCALL_DEFINE1
COMPAT_SYSCALL_DEFINE1