bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
661 stars 78 forks source link

What are the field definitions for org.freedesktop.DBus.Debug.Status.UserAccounting #352

Closed md-thomas closed 2 months ago

md-thomas commented 3 months ago

I'm trying to understand what the fields represent. What do the fields in each array represent? And what if the second array is empty?

dvdhrm commented 3 months ago

This is a dump of the internal resource accounting of dbus-broker. It is not a stable interface and represents a 1-to-1 mapping of src/util/user.c and related structures.

To fully understand all parts of the message, I recommend reading up on the accounting-model of dbus-broker first: https://github.com/bus1/dbus-broker/wiki/Accounting

The dump consists of 2 parts:

1) Peer Info: This is a dump of all peers currently connected to the bus. It shows the unique-name of the peer, its connection credentials, and then the amount of resources this peer has currently allocated/reserved.

2) User Info: This is a dump of all users that are currently tracked by the bus (i.e., there is at least one resource accounted to this user). This shows the UID of each user, followed by the remaining quota of the 4 different resource types (i.e., how much the user can still request of each type before the quota is hit). This is then followed by an array listing the resources accounted for this UID, but on behalf of another UID.

(I might have misremembered some parts of the message, or mixed it up. If something does not check out, let me know, or look at src/bus/driver.c to verify yourself.)

dvdhrm commented 2 months ago

I will close this as resolved. Feel free to reopen if needed! Thanks!