跳转到主要内容

检查程序发送和接收的D-Bus消息

项目描述

dbus-trace是一个包装器,可以查看程序发送和接收的D-Bus消息。

安装

pip install dbus-trace

使用

dbus-trace <command>
# For example - notify-send creates a desktop notification using D-Bus
$ dbus-trace notify-send "Hello world"

* Connected to session bus (connection 0)
◀ method_call: Hello [serial = 1]
  path = /org/freedesktop/DBus
  interface = org.freedesktop.DBus
  destination = org.freedesktop.DBus

...

◀ method_call: Notify [serial = 7]
  path = /org/freedesktop/Notifications
  interface = org.freedesktop.Notifications
  destination = :1.44
  Data (susssasa{sv}i): (
       'notify-send',
       0,
       '',
       'Hello world',
       '',
       [],
       {'sender-pid': ('x', 31559), 'urgency': ('y', 1)},
       -1,
    )

▷ method_return:  [serial = 88]
  Flags: 1 (no_reply_expected)
  destination = :1.944
  reply_serial = 7
  sender = :1.44
  Data (u): (8,)

...

dbus-trace监听系统总线会话的Unix套接字,并将发送到这些套接字的数据传递到真实总线。它使用指向这些代理套接字的环境变量运行子程序,当然它解码正在通过的内容并将其打印到终端。

有关D-Bus的更多信息,请参阅什么是D-Bus?

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

dbus_trace-0.1.tar.gz (4.4 kB 查看哈希值)

上传时间:

构建分发

dbus_trace-0.1-py3-none-any.whl (5.0 kB 查看哈希值)

上传时间: Python 3

支持者