Record boot_id in events
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 8 May 2017 13:22:55 +0000 (15:22 +0200)
committerKrzysztof Opasiak <k.opasiak@samsung.com>
Tue, 9 May 2017 11:55:31 +0000 (13:55 +0200)
src/core/event.c
src/core/event.h

index d82e87d83fe0b13004370a21c13323218e4b3733..2c48a7181832a4deb6e3ff98b60e0d1edaf2b761 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <errno.h>
+#include <systemd/sd-id128.h>
 
 #include "event.h"
 #include "module.h"
@@ -111,6 +112,10 @@ int faultd_event_init_internal(struct faultd_event_type *ev_type,
         if (ret)
                 return ret;
 
+        ret = sd_id128_get_boot(&ev->boot_id);
+        if (ret < 0)
+                return ret;
+
         ev->type = ev_type;
         ev->ops = ev_type->default_ops;
 
index 04a8452f76e5e2244f4a368121c5f301642eac26..443c5074a4e9973b7ec8c958655fbbfb3dded4e5 100644 (file)
@@ -19,8 +19,9 @@
 #ifndef FAULTD_EVENT_H
 #define FAULTD_EVENT_H
 
-#include <time.h>
 #include <string.h>
+#include <systemd/sd-id128.h>
+#include <time.h>
 
 #include "uref.h"
 #include "list.h"
@@ -51,6 +52,7 @@ struct faultd_event_type {
 
 struct faultd_event {
        struct timespec timestamp;
+       sd_id128_t boot_id;
 
        /* TODO: add here some id field */