janitorial: move dbus service files into sysprofd

This is the only place they are really used directly, so keep them there.
This commit is contained in:
Christian Hergert
2023-07-18 16:13:01 -07:00
parent 8a631d8f88
commit 8dd7478e96
5 changed files with 7 additions and 11 deletions

View File

@ -78,3 +78,10 @@ i18n.merge_file(
install: true,
install_dir: join_paths(datadir, 'polkit-1/actions'),
)
install_data([
'org.gnome.Sysprof3.Profiler.xml',
'org.gnome.Sysprof3.Service.xml',
],
install_dir: join_paths(datadir, 'dbus-1/interfaces'),
)

View File

@ -0,0 +1,43 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.gnome.Sysprof3.Profiler">
<!--
Capabilities:
The "Capabilities" property contains an a{sv} of capabilities
the profiler supports. This is implementation specific and allows
for peers to configure the profiler when calling Start() based on
what the profiler supports.
The contents of Capabilities are implementation specific.
-->
<property name="Capabilities" type="a{sv}" access="read"/>
<!--
Start:
@options: an a{sv} of implementation specific options
@fd: a file-descriptor for the profiler to write to
Start the profiler if it is not running.
If the profiler is already running, this method should return
an error so that the caller knows not to call Stop().
It is also suggested that implementations disable profiling if
they lose the peer connection.
The contents of @options are implementation specific.
-->
<method name="Start">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="h" name="fd" direction="in"/>
</method>
<!--
Stop:
Stop the profiler if it is running.
-->
<method name="Stop"/>
</interface>
</node>

View File

@ -0,0 +1,122 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.gnome.Sysprof3.Service">
<!--
PerfEventOpen:
@options: key-value pair of attributes for the perf_event_open() syscall.
@pid: the process id to monitor, or -1 for system-wide.
@cpu: affinity to cpu.
@group: a FD handle for an existing group
@flags: flags for perf_event_open() syscall.
@perf_stream_fd: (out): A fd to communicate with perf.
Performs the perf_event_open() syscall with elevated privileges and passes
the resulting fd back to the calling process.
-->
<method name="PerfEventOpen">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg name="options" type="a{sv}" direction="in"/>
<arg name="pid" type="i" direction="in"/>
<arg name="cpu" type="i" direction="in"/>
<arg name="group_fd" type="h" direction="in"/>
<arg name="flags" type="t" direction="in"/>
<arg name="perf_stream_fd" type="h" direction="out"/>
</method>
<!--
GetProcFile:
@path: the path including "/proc/" prefix.
Gets a file from /proc/ or /sys/.
The file must be a C-string (no embedded NUL bytes) but need not be UTF-8.
Returns: an array of bytes.
Since: 3.34
-->
<method name="GetProcFile">
<arg name="path" type="ay" direction="in"/>
<arg name="contents" type="ay" direction="out"/>
</method>
<!--
GetProcFd:
@path: the path within /proc or /sys
Like GetProcFile, but returns a FD for the file.
This is useful for situations where you need to seek() back to 0 to
optimize the parsing of the file contents.
Returns: a file-descriptor
Since: 3.34
-->
<method name="GetProcFd">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg name="path" type="ay" direction="in"/>
<arg name="fd" type="h" direction="out"/>
</method>
<!--
ListProcesses:
List the processes on the system.
Returns: an array of 32-bit integers
Since: 3.34
-->
<method name="ListProcesses">
<arg name="processes" type="ai" direction="out"/>
</method>
<!--
GetProcessInfo:
@attributes: a comma separated string of attributes to load
Gets information about the processes on the system.
Attributes can be a comma separated list of the following:
- pid: (int32): the process identifier, always included
- cmdline: (string): Provides the command line
- comm: (string): Provide the comm, useful when cmdline is empty
- maps: (string): Provide the contents of /proc/pid/maps
- statm: (string): Provide the contents of /proc/pid/statm
- mountinfo: (string): Provide the contents of/proc/pid/mountinfo
Returns: an array of vardict containing the requested attributs
-->
<method name="GetProcessInfo">
<arg name="attributes" type="s" direction="in"/>
<arg name="processes" type="aa{sv}" direction="out"/>
</method>
<!--
SetGovernor:
@governor: the new governor to use (such as "performance").
@old_governor: the governor that was in use before setting
Sets the CPU governor to be used on the system.
-->
<method name="SetGovernor">
<arg name="governor" type="s" direction="in"/>
<arg name="old_governor" type="s" direction="out"/>
</method>
<!--
SetParanoid:
@governor: the new perf paranoid setting
@old_governor: the old perf paranoid setting
Sets the perf_event_paranoid setting for the system.
-->
<method name="SetParanoid">
<arg name="paranoid" type="i" direction="in"/>
<arg name="old_paranoid" type="i" direction="out"/>
</method>
</interface>
</node>