Re: [PATCH] Use boot based time for process start time and boot time in /proc

Tomas Janousek
2007-05-11T08:47:17Z

Hi,

On Thu, May 10, 2007 at 04:40:47PM -0700, Andrew Morton wrote:
> On Thu, 10 May 2007 19:10:42 +0200
> Tomas Janousek <tjanouse@redhat.com> wrote:
> > @@ -918,7 +918,7 @@ struct task_struct {
> > unsigned int rt_priority;
> > cputime_t utime, stime;
> > unsigned long nvcsw, nivcsw; /* context switch counts */
> > - struct timespec start_time;
> > + struct timespec start_time, real_start_time;
>
> no, please prefer to do
>
> struct timespec start_time;
> struct timespec real_start_time;
>
> which gives a nice place to add a comment documenting the field.
>
> Please document fields.
>
> What is the difference between start_time and real_start_time?

-------------------------
From: Tomas Janousek <tjanouse@redhat.com>
Date: Fri, 11 May 2007 10:38:47 +0200
Subject: [PATCH] Document start times in struct task_struct

Signed-off-by: Tomas Janousek <tjanouse@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tomas Smetana <tsmetana@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
---
include/linux/sched.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7eaa536..b852323 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -918,8 +918,8 @@ struct task_struct {
unsigned int rt_priority;
cputime_t utime, stime;
unsigned long nvcsw, nivcsw; /* context switch counts */
- struct timespec start_time;
- struct timespec real_start_time;
+ struct timespec start_time; /* monotonic time */
+ struct timespec real_start_time; /* boot based time */
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt;

--
1.5.1.4

--
TJ. (Brno, CZ), BaseOS, Red Hat