diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-07-27 11:08:59 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-07-27 11:08:59 +0000 |
commit | 584b675ed657ee94cabcf475b1ed73bee4eb4054 (patch) | |
tree | e08e805219bd39e9a9c2d5cd174b1732cebd707f /sys/compat/linprocfs | |
parent | dc831186e32a0fbb7452d890f9ca459e192bae1d (diff) | |
download | src-584b675ed657ee94cabcf475b1ed73bee4eb4054.tar.gz src-584b675ed657ee94cabcf475b1ed73bee4eb4054.zip |
Hide the boottime and bootimebin globals, provide the getboottime(9)
and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI. The variables were renamed to avoid shadowing issues with local
variables of the same name.
Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure. As a
preparation, this commit only introduces the interface.
Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance. Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.
Tested by: pho (as part of the bigger patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302
Notes
Notes:
svn path=/head/; revision=303382
Diffstat (limited to 'sys/compat/linprocfs')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 56b2adeed5b8..a0dce473a85d 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS) struct pcpu *pcpu; long cp_time[CPUSTATES]; long *cp; + struct timeval boottime; int i; read_cpu_time(cp_time); + getboottime(&boottime); sbuf_printf(sb, "cpu %ld %ld %ld %ld\n", T2J(cp_time[CP_USER]), T2J(cp_time[CP_NICE]), @@ -624,10 +626,12 @@ static int linprocfs_doprocstat(PFS_FILL_ARGS) { struct kinfo_proc kp; + struct timeval boottime; char state; static int ratelimit = 0; vm_offset_t startcode, startdata; + getboottime(&boottime); sx_slock(&proctree_lock); PROC_LOCK(p); fill_kinfo_proc(p, &kp); |