dbus_handler: Add DBus interfaces to export boot info
Adding DBus interfaces for adding/getting checkpoint and duration from
DBus.
Tested:
```
\# DBus interfaces are added
bmc:~# busctl introspect \
com.google.gbmc.boot_time_monitor \
/xyz/openbmc_project/time/boot/host0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
......
xyz.openbmc_project.Time.Boot.Checkpoint interface - - -
.GetCheckpointList method - a(sxx) -
.RebootComplete method - - -
.SetCheckpoint method sxx - -
xyz.openbmc_project.Time.Boot.Duration interface - - -
.GetAdditionalDurations method - a(sx) -
.SetDuration method sx - -
xyz.openbmc_project.Time.Boot.Statistic interface - - -
.IsRebooting property b true emits-change
\# Try to call `SetCheckpoint`
bmc:~# busctl call \
com.google.gbmc.boot_time_monitor \
/xyz/openbmc_project/time/boot/host0 \
xyz.openbmc_project.Time.Boot.Checkpoint \
SetCheckpoint sxx "checkpoint1" 0 0
\# Check if it set correctly
bmc:~# busctl --verbose call \
com.google.gbmc.boot_time_monitor \
/xyz/openbmc_project/time/boot/host0 \
xyz.openbmc_project.Time.Boot.Checkpoint \
GetCheckpointList
MESSAGE "a(sxx)" {
ARRAY "(sxx)" {
STRUCT "sxx" {
STRING "ShutDownEnd";
INT64 1693915751696;
INT64 39660;
};
STRUCT "sxx" {
STRING "PowerOffEnd";
INT64 1693915885932;
INT64 173900;
};
STRUCT "sxx" {
STRING "checkpoint1";
INT64 1693919548471;
INT64 3740020;
};
};
};
```
Google-Bug-Id: 296530445
Change-Id: Iee6fd10190d275195959cace296e9b2795beb2d0
Signed-off-by: Michael Shen <gpgpgp@google.com>
5 files changed