diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-19 20:46:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-19 20:46:21 +0200 |
commit | 3e0dea57686d8a0cb8b870de0f5ccbd2e941d8b3 (patch) | |
tree | d8f97e74bfa8a4cd7b3757a5832cca88ec45f257 /kernel | |
parent | Merge tag 'perf-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
parent | proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets (diff) | |
download | linux-3e0dea57686d8a0cb8b870de0f5ccbd2e941d8b3.tar.xz linux-3e0dea57686d8a0cb8b870de0f5ccbd2e941d8b3.zip |
Merge tag 'timers-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull time namespace fix from Thomas Gleixner:
"An update for the proc interface of time namespaces: Use symbolic
names instead of clockid numbers. The usability nuisance of numbers
was noticed by Michael when polishing the man page"
* tag 'timers-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/namespace.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c index 3b30288793fe..53bce347cd50 100644 --- a/kernel/time/namespace.c +++ b/kernel/time/namespace.c @@ -338,7 +338,20 @@ static struct user_namespace *timens_owner(struct ns_common *ns) static void show_offset(struct seq_file *m, int clockid, struct timespec64 *ts) { - seq_printf(m, "%d %lld %ld\n", clockid, ts->tv_sec, ts->tv_nsec); + char *clock; + + switch (clockid) { + case CLOCK_BOOTTIME: + clock = "boottime"; + break; + case CLOCK_MONOTONIC: + clock = "monotonic"; + break; + default: + clock = "unknown"; + break; + } + seq_printf(m, "%-10s %10lld %9ld\n", clock, ts->tv_sec, ts->tv_nsec); } void proc_timens_show_offsets(struct task_struct *p, struct seq_file *m) |