Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ll in basic accounting fields

Proto:void bacct_add_tsk(struct user_namespace *user_ns, struct pid_namespace *pid_ns, struct taskstats *stats, struct task_struct *tsk)

Type:void

Parameter:

TypeParameterName
struct user_namespace *user_ns
struct pid_namespace *pid_ns
struct taskstats *stats
struct task_struct *tsk
28  BUILD_BUG_ON - break compile if a condition is true(should be >= TASK_COMM_LEN* in linux/sched.h < Task command name length: )
31  delta = ktime_get_ns() - Monotonic time in nsecs:
33  do_div() is NOT a C function(delta, NSEC_PER_USEC)
34  ac_etime = delta
36  do_div() is NOT a C function(delta, USEC_PER_SEC)
37  Begin time [sec since 1970] = 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. - delta
38  If thread_group_leader(tsk) Then
39  Exit status = exit code
40  If Per task flags (PF_*), defined further below: & Forked but didn't exec Then Record flags |= ... executed fork, but did not exec
43  If Per task flags (PF_*), defined further below: & Used super-user privileges Then Record flags |= ... used super-user privileges
45  If Per task flags (PF_*), defined further below: & Dumped core Then Record flags |= ... dumped core
47  If Per task flags (PF_*), defined further below: & Killed by a signal Then Record flags |= ... was killed by a signal
49  task_nice = ask_nice - return the nice value of a given task.*@p: the task in question.* Return: The nice value [ -20 ... 0 ... 19 ].
50  ac_sched = policy
51  Process ID = task_pid_nr_ns(tsk, pid_ns)
52  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
53  tcred = __task_cred - Access a task's objective credentials*@task: The task to query* Access the objective credentials of a task. The caller must hold the RCU* readlock.* The result of this function should not be passed directly to get_cred();(tsk)
54  ac_uid = m_kuid_munged - Create a uid from a kuid user-namespace pair.*@targ: The user namespace we want a uid in.*@kuid: The kernel internal uid to start with.* Map @kuid into the user-namespace specified by @targ and* return the resulting uid.
55  Group ID = m_kgid_munged - Create a gid from a kgid user-namespace pair.*@targ: The user namespace we want a gid in.*@kgid: The kernel internal gid to start with.* Map @kgid into the user-namespace specified by @targ and* return the resulting gid.
56  Parent process ID = If pid_alive - check that a task structure is not stale*@p: Task structure to be checked.* Test if a process is not yet dead (at most zombie state)* If pid_alive fails, then pointers within the task structure* can be stale and must not be dereferenced. Then task_tgid_nr_ns( fetch RCU-protected pointer for dereferencing( Real parent process: ), pid_ns) Else 0
58  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
60  task_cputime(tsk, & utime, & stime)
61  User CPU time [usec] = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
62  SYstem CPU time [usec] = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
64  task_cputime_scaled(tsk, & utimescaled, & stimescaled)
65  utime scaled on frequency etc = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
66  stime scaled on frequency etc = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
68  Minor Page Fault Count = MM fault and swap info: this can arguably be seen as either mm-specific or thread-specific:
69  Major Page Fault Count = maj_flt
71  strncpy( Command name , * executable name, excluding path. * - normally initialized setup_new_exec() * - access it with [gs]et_task_comm() * - lock it with task_lock(), size of Command name )
Caller
NameDescribe
fill_stats