Skip to content

Commit 8b9636e

Browse files
authored
Merge pull request #18 from jfsmig/M-start-date
lib: Display startup time in wall clock instead of monotonic clock
2 parents 0a441ab + bdfcee0 commit 8b9636e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/children.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,15 @@ struct child_s {
109109
/* Useful stats */
110110
guint counter_started;
111111
guint counter_died;
112+
113+
/* wall-clock time */
114+
time_t last_start;
115+
116+
/* monotonic-clock time */
112117
time_t last_start_attempt;
113118
time_t first_kill_attempt;
114119
time_t last_kill_attempt;
120+
115121
struct {
116122
time_t t0;
117123
time_t t1;
@@ -232,8 +238,7 @@ _child_get_info(struct child_s *c, struct child_info_s *ci)
232238
ci->gid = c->gid;
233239
ci->counter_started = c->counter_started;
234240
ci->counter_died = c->counter_died;
235-
ci->last_start_attempt = c->last_start_attempt;
236-
ci->last_kill_attempt = c->last_kill_attempt;
241+
ci->last_start_attempt = c->last_start;
237242

238243
ci->rlimits.core_size = i64tolong(c->rlimits.core_size);
239244
ci->rlimits.stack_size = i64tolong(c->rlimits.stack_size);
@@ -397,6 +402,7 @@ _child_start(struct child_s *sd, void *udata, supervisor_cb_f cb)
397402
bzero(&saved_limits, sizeof(saved_limits));
398403

399404
sd->last_start_attempt = _monotonic_seconds();
405+
sd->last_start = time(0);
400406

401407
_child_set_rlimits(&(sd->rlimits), &saved_limits);
402408
sd->pid = fork();

lib/gridinit-utils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ struct child_info_s {
5151
gboolean enabled;
5252
gboolean respawn;
5353
time_t last_start_attempt;
54-
time_t last_kill_attempt;
5554
guint counter_started;
5655
guint counter_died;
5756
struct {

main/gridinit_cmd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ struct child_info_s {
6969
gboolean breakable;
7070
guint32 user_flags;
7171
time_t last_start_attempt;
72-
time_t last_kill_attempt;
7372
guint counter_started;
7473
guint counter_died;
7574
struct {

0 commit comments

Comments
 (0)