Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\acct.c Create Date:2022-07-28 11:01:12
Last Modify:2020-03-17 15:14:29 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Write an accounting entry for an exiting process* The acct_process() call is the workhorse of the process* accounting system. The struct acct is built here and then written* into the accounting file. This function should only be called from

Proto:static void fill_ac(acct_t *ac)

Type:void

Parameter:

TypeParameterName
acct_t *ac
417  pacct = pacct
425  memset(ac, 0, sizeof(acct_t))
427  Always set to ACCT_VERSION = ACCT_VERSION | accounting file is little endian
428  Copy a NUL terminated string into a sized buffer
431  run_time = ktime_get_ns()
432  run_time -= start_time
434  elapsed = nsec_to_AHZ(run_time)
438  Elapsed Time = encode_comp_t(elapsed < (unsignedlong) - 1l ? (unsignedlong)elapsed : (unsignedlong) - 1l)
444  etime = encode_comp2_t(elapsed)
446  Elapsed Time MSB = etime >> 16
447  Elapsed Time LSB = etime
450  do_div() is NOT a C function(elapsed, AHZ)
451  Process Creation Time = These interfaces are all based on the old timespec type* and should get replaced with the timespec64 based versions* over time so we can remove the file here. - elapsed
453  AHZ = AHZ
456  spin_lock_irq( & siglock)
457  tty = tty
458  Control Terminal = If tty Then old_encode_dev(tty_devnum(tty)) Else 0
459  User Time = encode_comp_t(nsec_to_AHZ(ac_utime))
460  System Time = encode_comp_t(nsec_to_AHZ(ac_stime))
461  Flags = ac_flag
462  Average Memory Usage = encode_comp_t(ac_mem)
463  Minor Pagefaults = encode_comp_t(ac_minflt)
464  Major Pagefaults = encode_comp_t(ac_majflt)
465  Exitcode = ac_exitcode
466  spin_unlock_irq( & siglock)
Caller
NameDescribe
do_acct_process