Record boot_id in events
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 10 May 2017 18:34:36 +0000 (20:34 +0200)
committerKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 10 May 2017 18:49:58 +0000 (20:49 +0200)
src/core/event.c
src/core/event.h

index 481827eb304ae7cb60b55ad9f218920f4b80297a..7fd04adc92f10bda20fa758755537b580754747d 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 fe1f8ed6e0d0eb1d65844039c2da2ef2ff68560b..6c15389c586d624669c859ab399bccdf36f9d3d6 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 */