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>
diff --git a/tools/dreport.d/plugins.d/dbuslist b/tools/dreport.d/plugins.d/dbuslist
new file mode 100644
index 0000000..9e5125c
--- /dev/null
+++ b/tools/dreport.d/plugins.d/dbuslist
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# config: 2 50
+# @brief: Collect list of all D-Bus connections.
+#
+
+# shellcheck source=/dev/null
+. "$DREPORT_INCLUDE"/functions
+
+desc="dbus list"
+file_name="dbus-list.log"
+command="busctl -l"
+
+add_cmd_output "$command" "$file_name" "$desc"