{ "org.freedesktop.systemd1.Unit", "ActiveState", bus_unit_append_active_state, "s", u }, \
{ "org.freedesktop.systemd1.Unit", "SubState", bus_unit_append_sub_state, "s", u }, \
{ "org.freedesktop.systemd1.Unit", "FragmentPath", bus_property_append_string, "s", u->meta.fragment_path }, \
- { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64, "t", &u->meta.inactive_exit_timestamp }, \
- { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64, "t", &u->meta.active_enter_timestamp }, \
- { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp", bus_property_append_uint64, "t", &u->meta.active_exit_timestamp }, \
- { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_uint64, "t", &u->meta.inactive_enter_timestamp }, \
+ { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64, "t", &u->meta.inactive_exit_timestamp.realtime }, \
+ { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64, "t", &u->meta.active_enter_timestamp.realtime }, \
+ { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp", bus_property_append_uint64, "t", &u->meta.active_exit_timestamp.realtime }, \
+ { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_uint64, "t", &u->meta.inactive_enter_timestamp.realtime }, \
{ "org.freedesktop.systemd1.Unit", "CanStart", bus_unit_append_can_start, "b", u }, \
{ "org.freedesktop.systemd1.Unit", "CanReload", bus_unit_append_can_reload, "b", u }, \
{ "org.freedesktop.systemd1.Unit", "Job", bus_unit_append_job, "(uo)", u }, \
log_debug("Forked %s as %lu", command->path, (unsigned long) pid);
command->exec_status.pid = pid;
- command->exec_status.start_timestamp = now(CLOCK_REALTIME);
+ dual_timestamp_get(&command->exec_status.start_timestamp);
*ret = pid;
return 0;
assert(s);
s->pid = pid;
- s->exit_timestamp = now(CLOCK_REALTIME);
+ dual_timestamp_get(&s->exit_timestamp);
s->code = code;
s->status = status;
"%sPID: %lu\n",
prefix, (unsigned long) s->pid);
- if (s->start_timestamp > 0)
+ if (s->start_timestamp.realtime > 0)
fprintf(f,
"%sStart Timestamp: %s\n",
- prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp));
+ prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp.realtime));
- if (s->exit_timestamp > 0)
+ if (s->exit_timestamp.realtime > 0)
fprintf(f,
"%sExit Timestamp: %s\n"
"%sExit Code: %s\n"
"%sExit Status: %i\n",
- prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp),
+ prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp.realtime),
prefix, sigchld_code_to_string(s->code),
prefix, s->status);
}
} ExecOutput;
struct ExecStatus {
- usec_t start_timestamp;
- usec_t exit_timestamp;
+ dual_timestamp start_timestamp;
+ dual_timestamp exit_timestamp;
pid_t pid;
int code; /* as in siginfo_t::si_code */
int status; /* as in sigingo_t::si_status */
goto fail;
}
- f->fd = SD_LISTEN_FDS_START+i;
+ f->fd = fd;
LIST_PREPEND(Fifo, fifo, s->fifos, f);
f->server = s;
s->n_fifos ++;
if (!(m = new0(Manager, 1)))
return -ENOMEM;
- timestamp_get(&m->startup_timestamp);
+ dual_timestamp_get(&m->startup_timestamp);
m->running_as = running_as;
m->confirm_spawn = confirm_spawn;
char **environment;
- timestamp startup_timestamp;
+ dual_timestamp startup_timestamp;
/* Data specific to the device subsystem */
struct udev* udev;
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
bool unexpected = false;
- timestamp ts;
+ dual_timestamp ts;
assert(u);
assert(os < _UNIT_ACTIVE_STATE_MAX);
* this function will be called too and the utmp code below
* relies on that! */
- timestamp_get(&ts);
+ dual_timestamp_get(&ts);
if (os == UNIT_INACTIVE && ns != UNIT_INACTIVE)
u->meta.inactive_exit_timestamp = ts;
* the job for it */
Job *job;
- timestamp inactive_exit_timestamp;
- timestamp active_enter_timestamp;
- timestamp active_exit_timestamp;
- timestamp inactive_enter_timestamp;
+ dual_timestamp inactive_exit_timestamp;
+ dual_timestamp active_enter_timestamp;
+ dual_timestamp active_exit_timestamp;
+ dual_timestamp inactive_enter_timestamp;
/* Counterparts in the cgroup filesystem */
CGroupBonding *cgroup_bondings;
return timespec_load(&ts);
}
-timestamp* timestamp_get(timestamp *ts) {
+dual_timestamp* dual_timestamp_get(dual_timestamp *ts) {
assert(ts);
ts->realtime = now(CLOCK_REALTIME);
typedef uint64_t usec_t;
-typedef struct timestamp {
+typedef struct dual_timestamp {
usec_t realtime;
usec_t monotonic;
-} timestamp;
+} dual_timestamp;
#define MSEC_PER_SEC 1000ULL
#define USEC_PER_SEC 1000000ULL
usec_t now(clockid_t clock);
-timestamp* timestamp_get(timestamp *ts);
+dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
usec_t timespec_load(const struct timespec *ts);
struct timespec *timespec_store(struct timespec *ts, usec_t u);