summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-03-29 18:36:11 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-03-29 18:36:11 +0000
commitdc262f4df67e3241d3af67e28fc45936af5a7025 (patch)
tree01f0eeb7e7c7c974f0c457de143bbb0f916f540c /Process.c
parent22b0d7df64cdfae8bab6ba8df07a16afd5dbed75 (diff)
STARTTIME column
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Process.c b/Process.c
index 41c7d40d..e1fbd688 100644
--- a/Process.c
+++ b/Process.c
@@ -27,6 +27,7 @@ in the source distribution for its full text.
#include <stdbool.h>
#include <pwd.h>
#include <sched.h>
+#include <time.h>
#ifdef HAVE_PLPA
#include <plpa.h>
@@ -98,9 +99,10 @@ typedef struct Process_ {
long int priority;
long int nice;
long int nlwp;
+ char starttime_show[8];
+ time_t starttime_ctime;
#ifdef DEBUG
long int itrealvalue;
- unsigned long int starttime;
unsigned long int vsize;
long int rss;
unsigned long int rlim;
@@ -186,7 +188,7 @@ const char *Process_fieldTitles[] = {
"", " PID ", "Command ", "S ", " PPID ", " PGRP ", " SESN ",
" TTY ", "TPGID ", "- ", "- ", "- ", "- ", "- ",
" UTIME+ ", " STIME+ ", "- ", "- ", "PRI ", " NI ", "- ",
- "- ", "- ", "- ", "- ", "- ", "- ", "- ",
+ "START ", "- ", "- ", "- ", "- ", "- ", "- ",
"- ", "- ", "- ", "- ", "- ", "- ", "- ",
"- ", "- ", "- ", "CPU ", " VIRT ", " RES ", " SHR ",
" CODE ", " DATA ", " LIB ", " DIRTY ", " UID ", "CPU% ", "MEM% ",
@@ -403,6 +405,7 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
}
break;
}
+ case STARTTIME: snprintf(buffer, n, "%s", this->starttime_show); break;
#ifdef HAVE_OPENVZ
case CTID: snprintf(buffer, n, "%5u ", this->ctid); break;
case VPID: snprintf(buffer, n, "%5u ", this->vpid); break;
@@ -578,6 +581,8 @@ int Process_compare(const void* v1, const void* v2) {
return strcmp(p1->comm, p2->comm);
case NLWP:
return (p1->nlwp - p2->nlwp);
+ case STARTTIME:
+ return (p1->starttime_ctime - p2->starttime_ctime);
#ifdef HAVE_OPENVZ
case CTID:
return (p1->ctid - p2->ctid);

© 2014-2024 Faster IT GmbH | imprint | privacy policy