搜索

1.16. 使用 TuneD D-Bus 接口

download PDF

您可以通过 TuneD D-Bus 接口在运行时直接与 TuneD 进行通信,以控制各种 TuneD 服务。

您可以使用 busctldbus-send 命令访问 D-Bus API。

注意

虽然您可以使用 busctldbus-send 命令,但 busctl 命令是 systemd 的一部分,因此已在大多数主机上存在。

1.16.1. 使用 TuneD D-Bus 接口来显示可用的 TuneD D-Bus API 方法

您可以使用 TuneD D-Bus 接口查看可与 TuneD 一起使用的的 D-Bus API 方法。

先决条件

步骤

  • 要查看可用的 TuneD API 方法,请运行:

    $ busctl introspect com.redhat.tuned /Tuned com.redhat.tuned.control

    输出应类似于以下内容:

    NAME                       	TYPE  	SIGNATURE RESULT/VALUE FLAGS
    .active_profile            	method	-     	  s            -
    .auto_profile              	method	-     	  (bs)         -
    .disable                   	method	-      	  b            -
    .get_all_plugins           	method	-     	  a{sa{ss}}    -
    .get_plugin_documentation  	method	s     	  s            -
    .get_plugin_hints          	method	s     	  a{ss}        -
    .instance_acquire_devices  	method	ss    	  (bs)         -
    .is_running                	method	-     	  b            -
    .log_capture_finish        	method	s     	  s            -
    .log_capture_start         	method	ii    	  s            -
    .post_loaded_profile       	method	-     	  s            -
    .profile_info              	method	s     	  (bsss)       -
    .profile_mode              	method	-     	  (ss)         -
    .profiles                  	method	-     	  as           -
    .profiles2                 	method	-     	  a(ss)        -
    .recommend_profile         	method	-     	  s            -
    .register_socket_signal_path    method	s     	  b            -
    .reload                    	method	-     	  b            -
    .start                     	method	-     	  b            -
    .stop                      	method	-     	  b            -
    .switch_profile            	method	s     	  (bs)         -
    .verify_profile            	method	-     	  b            -
    .verify_profile_ignore_missing  method	-     	  b            -
    .profile_changed           	signal	sbs   	  -            -

    您可以在 TuneD 上游存储库 中找到不同的可用方法的描述。

1.16.2. 使用 TuneD D-Bus 接口来更改活跃的 TuneD 配置文件

您可以使用 TuneD D-Bus 接口,将活跃的 TuneD 配置文件替换为所需的 TuneD 配置文件。

先决条件

步骤

  • 要更改活跃的 TuneD 配置文件,请运行:

    $ busctl call com.redhat.tuned /Tuned com.redhat.tuned.control switch_profile s profile
    (bs) true "OK"

    使用所需的配置文件的名称替换 profile

验证

  • 要查看当前活跃的 TuneD 配置文件,请运行:

    $ busctl call com.redhat.tuned /Tuned com.redhat.tuned.control active_profile
    s "profile"
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.