Skip to content

System accounting and taskstats update

Jay Lan lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3basic accounting over taskstatsinclude/linux/taskstats.h include/linux/tsacct_kern.h kernel/Makefile +2 more+117 -64 replies
2/3Extended system accounting over taskstatsinclude/linux/taskstats.h include/linux/tsacct_kern.h init/Kconfig +2 more+52 -00 replies
3/3convert CONFIG tag for extended accounting routinesfs/compat.c fs/exec.c include/linux/acct.h +7 more+42 -383 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/3] System accounting and taskstats update

This posting is to replace the "CSA accounting and taskstats update" patches i posted on 7/31.

This set of patches would provide basic system accounting and extended system accounting data to userland using the taskstats interface.

Patches are created against 2.6.18-rc2.

taskstats-rev2.patch
taskstats-acct.patch
bsd-to-xacct.patch

Regards,
Jay Lan <[email protected]>

ChageLog:
Feedbacks from Shailabh Nagar
- realign new fields, and rename some fields names
- keep ac_ prefix for basic accounting fields but remove prefix on extended accounting fields.
- fix typos
- use timespec_sub() routine simplify code
- fix compilation issue if some CONFIG flags off
- use 'static inlines' on CONFIG flag '#else' cases

Feedbacks from Balbir Singh
- use 'BUILD_DEBUG_ON' to check TS_COMM_LEN value
- use portable cputime_to_msecs() API
- set system time to 1 usec if both stime and utime are less than 1 usec.

Since most of the accounting data required by CSA are also used in BSD Process Accounting, i initially named those accounting fields handling as "basic accounting" and the rest as "CSA extension". However, there is not really much left in CSA. Thus, it makes sense to eliminate CSA from the kernel all together.

However, Shailabh liked to separate the taskstats interface part from the accounting data part and i agreed that it was the right thing to do.

Thus, there will be kernel/tsacct.c and include/linux/tsacct_kern.h to become home of the accounting data handling code. A new config flag "CONFIG_TASK_XACCT" is added so that three routines dealing with extended accouting can be defined as dummy.