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

From: Tomas Janousek
Date: Fri May 11 2007 - 04:47:17 EST


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@xxxxxxxxxx> 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@xxxxxxxxxx>
Date: Fri, 11 May 2007 10:38:47 +0200
Subject: [PATCH] Document start times in struct task_struct

Signed-off-by: Tomas Janousek <tjanouse@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Tomas Smetana <tsmetana@xxxxxxxxxx>
Cc: John Stultz <johnstul@xxxxxxxxxx>
---
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/