FreeBSD Bugzilla – Attachment 145651 Details for
Bug 192573
Add ps(1) option: Print process start time in seconds since 1970
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
code patch for ps(1)
ps-sstart-dave-eddy-8-11-2014.patch (text/plain), 2.04 KB, created by
Dave Eddy
on 2014-08-11 08:11:37 UTC
(
hide
)
Description:
code patch for ps(1)
Filename:
MIME Type:
Creator:
Dave Eddy
Created:
2014-08-11 08:11:37 UTC
Size:
2.04 KB
patch
obsolete
>Index: extern.h >=================================================================== >--- extern.h (revision 269804) >+++ extern.h (working copy) >@@ -59,6 +59,7 @@ > char *logname(KINFO *, VARENT *); > char *longtname(KINFO *, VARENT *); > char *lstarted(KINFO *, VARENT *); >+char *sstarted(KINFO *, VARENT *); > char *maxrss(KINFO *, VARENT *); > char *lockname(KINFO *, VARENT *); > char *mwchan(KINFO *, VARENT *); >Index: keyword.c >=================================================================== >--- keyword.c (revision 269804) >+++ keyword.c (working copy) >@@ -146,6 +146,7 @@ > {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, > {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, > {"ssiz", "SSIZ", NULL, 0, kvar, KOFF(ki_ssize), PGTOK, "ld", 0}, >+ {"sstart", "STARTED", NULL, LJUST|USER, sstarted, 0, CHAR, NULL, 0}, > {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, > {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, > {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, >Index: print.c >=================================================================== >--- print.c (revision 269804) >+++ print.c (working copy) >@@ -429,6 +429,25 @@ > } > > char * >+sstarted(KINFO *k, VARENT *ve __unused) >+{ >+ time_t then; >+ char *buf; >+ size_t buflen = 100; >+ >+ if (!k->ki_valid) >+ return (NULL); >+ >+ buf = malloc(buflen); >+ if (buf == NULL) >+ errx(1, "malloc failed"); >+ >+ then = k->ki_p->ki_start.tv_sec; >+ (void)strftime(buf, buflen, "%s", localtime(&then)); >+ return (buf); >+} >+ >+char * > lockname(KINFO *k, VARENT *ve __unused) > { > char *str; >Index: ps.1 >=================================================================== >--- ps.1 (revision 269804) >+++ ps.1 (working copy) >@@ -376,6 +376,11 @@ > .Xr setpriority 2 ) . > .It Cm rss > the real memory (resident set) size of the process (in 1024 byte units). >+.It Cm sstart >+The exact time in seconds the command started, using the >+.Ql %s >+format described in >+.Xr strftime 3 . > .It Cm start > The time the command started. > If the command started less than 24 hours ago, the start time is
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192573
: 145651