diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/scripts/rpc/app.py | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/scripts/rpc/app.py')
-rw-r--r-- | src/spdk/scripts/rpc/app.py | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/spdk/scripts/rpc/app.py b/src/spdk/scripts/rpc/app.py new file mode 100644 index 000000000..9412de17d --- /dev/null +++ b/src/spdk/scripts/rpc/app.py @@ -0,0 +1,78 @@ +from .helpers import deprecated_alias + + +@deprecated_alias('kill_instance') +def spdk_kill_instance(client, sig_name): + """Send a signal to the SPDK process. + + Args: + sig_name: signal to send ("SIGINT", "SIGTERM", "SIGQUIT", "SIGHUP", or "SIGKILL") + """ + params = {'sig_name': sig_name} + return client.call('spdk_kill_instance', params) + + +@deprecated_alias('context_switch_monitor') +def framework_monitor_context_switch(client, enabled=None): + """Query or set state of context switch monitoring. + + Args: + enabled: True to enable monitoring; False to disable monitoring; None to query (optional) + + Returns: + Current context switch monitoring state (after applying enabled flag). + """ + params = {} + if enabled is not None: + params['enabled'] = enabled + return client.call('framework_monitor_context_switch', params) + + +def framework_get_reactors(client): + """Query list of all reactors. + + Returns: + List of all reactors. + """ + return client.call('framework_get_reactors') + + +def thread_get_stats(client): + """Query threads statistics. + + Returns: + Current threads statistics. + """ + return client.call('thread_get_stats') + + +def thread_set_cpumask(client, id, cpumask): + """Set the cpumask of the thread whose ID matches to the specified value. + + Args: + id: thread ID + cpumask: cpumask for this thread + + Returns: + True or False + """ + params = {'id': id, 'cpumask': cpumask} + return client.call('thread_set_cpumask', params) + + +def thread_get_pollers(client): + """Query current pollers. + + Returns: + Current pollers. + """ + return client.call('thread_get_pollers') + + +def thread_get_io_channels(client): + """Query current IO channels. + + Returns: + Current IO channels. + """ + return client.call('thread_get_io_channels') |