chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5b24471
)
coredumpctl: include timestamp information in "coredumpctl info" output
author
Lennart Poettering
<lennart@poettering.net>
Mon, 23 Jun 2014 13:51:09 +0000
(15:51 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 23 Jun 2014 13:51:09 +0000
(15:51 +0200)
src/journal/coredumpctl.c
patch
|
blob
|
history
diff --git
a/src/journal/coredumpctl.c
b/src/journal/coredumpctl.c
index 4f50f1b1394f2a632da3cae4d92ee341039493d9..56b7becfcd42d8058feea2c9b28f869a5fd25b7a 100644
(file)
--- a/
src/journal/coredumpctl.c
+++ b/
src/journal/coredumpctl.c
@@
-409,9
+409,10
@@
static int print_info(FILE *file, sd_journal *j, bool need_space) {
*unit = NULL, *user_unit = NULL, *session = NULL,
*boot_id = NULL, *machine_id = NULL, *hostname = NULL,
*coredump = NULL, *slice = NULL, *cgroup = NULL,
*unit = NULL, *user_unit = NULL, *session = NULL,
*boot_id = NULL, *machine_id = NULL, *hostname = NULL,
*coredump = NULL, *slice = NULL, *cgroup = NULL,
- *owner_uid = NULL, *message = NULL;
+ *owner_uid = NULL, *message = NULL
, *timestamp = NULL
;
const void *d;
size_t l;
const void *d;
size_t l;
+ int r;
assert(file);
assert(j);
assert(file);
assert(j);
@@
-430,6
+431,7
@@
static int print_info(FILE *file, sd_journal *j, bool need_space) {
retrieve(d, l, "COREDUMP_OWNER_UID", &owner_uid);
retrieve(d, l, "COREDUMP_SLICE", &slice);
retrieve(d, l, "COREDUMP_CGROUP", &cgroup);
retrieve(d, l, "COREDUMP_OWNER_UID", &owner_uid);
retrieve(d, l, "COREDUMP_SLICE", &slice);
retrieve(d, l, "COREDUMP_CGROUP", &cgroup);
+ retrieve(d, l, "COREDUMP_TIMESTAMP", ×tamp);
retrieve(d, l, "_BOOT_ID", &boot_id);
retrieve(d, l, "_MACHINE_ID", &machine_id);
retrieve(d, l, "_HOSTNAME", &hostname);
retrieve(d, l, "_BOOT_ID", &boot_id);
retrieve(d, l, "_MACHINE_ID", &machine_id);
retrieve(d, l, "_HOSTNAME", &hostname);
@@
-486,6
+488,22
@@
static int print_info(FILE *file, sd_journal *j, bool need_space) {
fprintf(file, " Signal: %s\n", sgnl);
}
fprintf(file, " Signal: %s\n", sgnl);
}
+ if (timestamp) {
+ usec_t u;
+
+ r = safe_atou64(timestamp, &u);
+ if (r >= 0) {
+ char absolute[FORMAT_TIMESTAMP_MAX], relative[FORMAT_TIMESPAN_MAX];
+
+ fprintf(file,
+ " Timestamp: %s (%s)\n",
+ format_timestamp(absolute, sizeof(absolute), u),
+ format_timestamp_relative(relative, sizeof(relative), u));
+
+ } else
+ fprintf(file, " Timestamp: %s\n", timestamp);
+ }
+
if (exe)
fprintf(file, " Executable: %s%s%s\n", ansi_highlight(), exe, ansi_highlight_off());
if (comm)
if (exe)
fprintf(file, " Executable: %s%s%s\n", ansi_highlight(), exe, ansi_highlight_off());
if (comm)