Add restart time (in microseconds) for TH managed services using InactiveEnterTimestamp and ActiveEnterTimestamp

ActiveEnterTimestamp - InactiveEnterTimestamp = restart time.
if ActiveEnterTimestamp < InactiveEnterTimestamp, which means the service have never been restarted.

example: {
{
  "last_update_time": 1765875558,
  "true_hitless_activation": {
    "activated": true,
    "image_checksum_valid": null
  },
  "emmc_status": {
    "emmc_available_target": {
      "status": "active",
      "time_to_active_seconds": 168
    },
    "emmc_unavailable_target": {
      "status": "inactive",
      "time_to_active_seconds": null
    }
  },
  "intermediate_state": {
    "true_hitless_initialize_service": {
      "status": "active",
      "last_execution_time": 1765873903
    },
    "emmc_available_postprocessing_service": {
      "status": "inactive",
      "last_execution_time": 1765873915,
      "postprocessing_complete": true
    },
    "emmc_unavailable_postprocessing_service": {
      "status": "inactive",
      "last_execution_time": 1765614306,
      "postprocessing_complete": true
    }
  },
  "service_status": {
    "true_hitless_managed_services": [
      {
        "service_name": "authz_server.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 6305782
      },
      {
        "service_name": "bmcweb.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 6616478
      },
      {
        "service_name": "earlyoom.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 184738
      },
      {
        "service_name": "phosphor-pid-control.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 1537435
      },
      {
        "service_name": "rsyslog.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 654709
      },
      {
        "service_name": "xyz.openbmc_project.fansensor.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 42376
      },
      {
        "service_name": "xyz.openbmc_project.psusensor.service",
        "block_override_applied": true,
        "emmc_override_applied": true,
        "systemd_status": "active",
        "binary_running_on_emmc": true,
        "restart_count": 0,
        "coredump_count": 0,
        "restart_time": 250729
      }
    ]
  },
  "versions": {
    "true_hitless_version": "0.0.0.0",
    "gbmc_version": "25.48.30.0",
    "compatible": false
  }
}
~


Google-Bug-Id: 467780984
Tested: tested on BMC, status json can be updated succesfully.
Return null
Fusion: https://fusion2.corp.google.com/d0dc7613-1b3f-3282-bb72-c7a48ca4192b
Change-Id: Ibf9e0ed20ef030261b1f40e89537f975959499fa
Signed-off-by: Baicheng Zong <baichengz@google.com>
1 file changed
tree: 1af84fb11d744f91033d731a82649192152a8d25
  1. linux/
  2. .gitmodules