Dreport: Add D-Bus Information Collection

Add functionality to collect D-Bus service
information as part of the debug data
collection process. The new file will gather:

dbuslist: A comprehensive list of D-Bus services,
objects, and interfaces currently active on the
system

Including this information in debug reports will
enhance troubleshooting capabilities for D-Bus
related issues in OpenBMC based systems. It
provides a snapshot of the system's D-Bus config
and usage at the time of report generation.

These additions will help identify potential
D-Bus communication bottlenecks, unexpected
service behaviors, and assist in diagnosing
issues related to sensor data retrieval,
system management interfaces, and inter-process
communication on the BMC.

Tested on qemuarm.

'''
Dump size: 17K
Untar Dump Size:  220K
Added File Size: 12k
Time for the Dump Completion: 24 sec
Time for the command to run: 0.254s

root@qemuarm:~# time busctl -l
[1] xyz.openbmc_project.User.Manager                       228 phosphor-user-m root             :1.24         xyz.openbmc_project.User.Manager.service            -       -
[2] xyz.openbmc_project.bmcweb                             168 bmcwebd         root             :1.5          bmcweb.service                                      -       -

real    0m0.254s
user    0m0.069s
sys     0m0.128s

Tested a negative case by making the health monitor stuck by making the service in sleep
by adding this in the service

[Service]
ExecStartPost=/bin/sleep infinity

Initial prints service was active

root@qemuarm:~# systemctl status  phosphor-health-monitor.service
* phosphor-health-monitor.service - BMC health monitoring
[3]     Loaded: loaded (/usr/lib/systemd/system/phosphor-health-monitor.service; enabled; preset: enabled)
[4]     Active: active (running) since Wed 2025-04-02 02:53:33 UTC; 4min 4s ago
 Invocation: e1970ecf1dc84167aa5489ef7ba09c56
   Main PID: 177 (health-monitor)
      Tasks: 2 (limit: 553)
     Memory: 828K (peak: 1M)
        CPU: 2.097s
     CGroup: /system.slice/phosphor-health-monitor.service
             `-177 /usr/bin/health-monitor

Make the service sleep and created hung like service scenario.

root@qemuarm:~# systemctl status  phosphor-health-monitor.service
* phosphor-health-monitor.service - BMC health monitoring
[5]     Loaded: loaded (/usr/lib/systemd/system/phosphor-health-monitor.service; enabled; preset: enabled)
[6]     Active: activating (start-post) since Wed 2025-04-02 03:04:21 UTC; 13s ago
        Job: 548
 Invocation: 132ed98c6ba24f519e20f1feb2e03ecf
   Main PID: 369 (health-monitor); Control PID: 370 (sleep)
      Tasks: 3 (limit: 553)
     Memory: 576K (peak: 1.2M)
        CPU: 367ms
     CGroup: /system.slice/phosphor-health-monitor.service
             |-369 /usr/bin/health-monitor
             `-370 /bin/sleep infinity

Took the dump while service is hung.

[7] root@qemuarm:~# busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/bmc xyz.openbmc_project.Dump.Create CreateDump a{sv} 1 "i" i 1234
root@qemuarm:~# journalctl -u xyz.openbmc_project.Dump.Manager
...
[8] Apr 02 03:05:08 qemuarm phosphor-dump-manager[212]: OriginatorId is not provided
...
[9] Apr 02 03:05:32 qemuarm phosphor-dump-manager[375]: Wed Apr 2 03:05:32 UTC 2025 Successfully completed
[10] Apr 02 03:05:32 qemuarm phosphor-dump-manager[212]: User initiated dump completed, resetting flag

Dump was successful, downloaded the dump and checked for the dbus-list file.

ls -lrth obmcdump_4_1743563108/
total 220K
-rw-r--r-- 1 dkamat domain-users  219 Apr  2 08:35 summary.log
-rw-r--r-- 1 dkamat domain-users  950 Apr  2 08:35 disk-usage.log

ls -lrth obmcdump_4_1743563108/dbus-list.log
12K Apr  2 08:35 obmcdump_4_1743563108/dbus-list.log

cat obmcdump_4_1743563108/dbus-list.log | grep -i health
[11] :1.47                                                  369 health-monitor  root             :1.47         phosphor-health-monitor.service                     -       -
[12] xyz.openbmc_project.HealthMon                          369 health-monitor  root             :1.47         phosphor-health-monitor.service                     -       -
'''

Change-Id: I1fd2f1970a79903a800e454ff9592c3d1a6b1eff
Signed-off-by: Deepak Kamat <dkamat@nvidia.com>
1 file changed
tree: 228be928002db9cb456783a5ed8022d9a3bc8631
  1. dump-extensions/
  2. host-transport-extensions/
  3. subprojects/
  4. test/
  5. tools/
  6. .clang-format
  7. .clang-tidy
  8. .gitignore
  9. .shellcheck-ignore
  10. bmc_dump_entry.cpp
  11. bmc_dump_entry.hpp
  12. core_manager.cpp
  13. core_manager.hpp
  14. core_manager_main.cpp
  15. dump-extensions.hpp
  16. dump_entry.cpp
  17. dump_entry.hpp
  18. dump_manager.cpp
  19. dump_manager.hpp
  20. dump_manager_bmc.cpp
  21. dump_manager_bmc.hpp
  22. dump_manager_faultlog.cpp
  23. dump_manager_faultlog.hpp
  24. dump_manager_main.cpp
  25. dump_offload.cpp
  26. dump_offload.hpp
  27. dump_serialize.cpp
  28. dump_serialize.hpp
  29. dump_types.cpp.mako
  30. dump_types.hpp.mako
  31. dump_utils.cpp
  32. dump_utils.hpp
  33. elog_watch.cpp
  34. elog_watch.hpp
  35. example_dump_types.yaml
  36. example_errors_watch.yaml
  37. faultlog_dump_entry.cpp
  38. faultlog_dump_entry.hpp
  39. ffdc
  40. host_transport_exts.hpp
  41. LICENSE
  42. map_gen.py
  43. meson.build
  44. meson.options
  45. OWNERS
  46. ramoops_manager.cpp
  47. ramoops_manager.hpp
  48. ramoops_manager_main.cpp
  49. README.md
  50. watch.cpp
  51. watch.hpp
README.md

phosphor-debug-collector

Phosphor Debug Collector provides mechanisms to collect various log files and system parameters. Used to troubleshoot problems in OpenBMC based systems.

One such mechanism is dreport, a script that collects debug data and packages it into an archive file.

To Build

To build this package with meson, do the following steps:

    1. meson builddir
    2. ninja -C builddir

To clean the built files run ninja -C builddir clean.

To run unit tests

Tests can be run in the CI docker container, refer local-ci-build

or with an OpenBMC x86 sdk(see below for x86 steps).

meson -Dtests=enabled build
ninja -C build test