proc: switch /proc/uptime to seq_file
PATCH 2/31 proc: switch /proc/uptime to seq_file
Quoted 2 lines
From
ca4e424af8016656de18ac7c39f65cbc081d7643Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan <[email protected]>
Date: Fri, 3 Oct 2008 02:38:18 +0400
Subject: [PATCH 02/31] proc: switch /proc/uptime to seq_file
and move it to fs/proc/uptime.c while I'm at it.
Signed-off-by Alexey Dobriyan <[email protected]>
--- fs/proc/Makefile | 1 + fs/proc/proc_misc.c | 21 --------------------- fs/proc/uptime.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 fs/proc/uptime.c
fs/proc/Makefile +1 -0
@@ -10,6 +10,7 @@ proc-$(CONFIG_MMU) := mmu.o task_mmu.o proc-y += inode.o root.o base.o generic.o array.o \ proc_tty.o proc_misc.o proc-y += loadavg.o +proc-y += uptime.o proc-$(CONFIG_PROC_SYSCTL) += proc_sysctl.o proc-$(CONFIG_NET) += proc_net.o proc-$(CONFIG_PROC_KCORE) += kcore.o
fs/proc/proc_misc.c +0 -21
@@ -77,26 +77,6 @@ static int proc_calc_metrics(char *page, char **start, off_t off,return len; } -static int uptime_read_proc (char *page,char **start,off_t off, -int count,int *eof,void *data) -{ -struct timespec uptime; -struct timespec idle; -int len; -cputime_t idletime =cputime_add (init_task.utime, init_task.stime); - -do_posix_clock_monotonic_gettime (&uptime); -monotonic_to_bootbased (&uptime); -cputime_to_timespec (idletime, &idle); - len =sprintf (page,"%lu.%02lu %lu.%02lu\n" , - (unsigned long ) uptime.tv_sec, - (uptime.tv_nsec / (NSEC_PER_SEC /100 )), - (unsigned long ) idle.tv_sec, - (idle.tv_nsec / (NSEC_PER_SEC /100 ))); - -return proc_calc_metrics (page, start, off, count, eof, len); -} -int __attribute__((weak))arch_report_meminfo (char *page) {return 0 ;
@@ -817,7 +797,6 @@ void __init proc_misc_init(void)char *name;int (*read_proc)(char *,char **,off_t ,int ,int *,void *); } *p, simple_ones[] = { - {"uptime", uptime_read_proc}, {"meminfo", meminfo_read_proc}, {"version", version_read_proc}, #ifdef CONFIG_PROC_HARDWARE
fs/proc/uptime.c new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
1.5.6.5