2019-09-19 21:13:36 +00:00
|
|
|
from .helpers import deprecated_alias
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated_alias('kill_instance')
|
|
|
|
def spdk_kill_instance(client, sig_name):
|
2018-05-21 20:07:12 +00:00
|
|
|
"""Send a signal to the SPDK process.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
sig_name: signal to send ("SIGINT", "SIGTERM", "SIGQUIT", "SIGHUP", or "SIGKILL")
|
|
|
|
"""
|
|
|
|
params = {'sig_name': sig_name}
|
2019-09-19 21:13:36 +00:00
|
|
|
return client.call('spdk_kill_instance', params)
|
2017-06-06 21:22:03 +00:00
|
|
|
|
2018-02-14 21:34:55 +00:00
|
|
|
|
2019-09-18 08:12:48 +00:00
|
|
|
@deprecated_alias('context_switch_monitor')
|
|
|
|
def framework_monitor_context_switch(client, enabled=None):
|
2018-05-21 20:07:12 +00:00
|
|
|
"""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).
|
|
|
|
"""
|
2017-06-06 21:22:03 +00:00
|
|
|
params = {}
|
2018-05-21 20:07:12 +00:00
|
|
|
if enabled is not None:
|
|
|
|
params['enabled'] = enabled
|
2019-09-18 08:12:48 +00:00
|
|
|
return client.call('framework_monitor_context_switch', params)
|
2019-03-02 08:32:19 +00:00
|
|
|
|
|
|
|
|
2019-12-17 22:32:51 +00:00
|
|
|
def framework_get_reactors(client):
|
|
|
|
"""Query list of all reactors.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
List of all reactors.
|
|
|
|
"""
|
|
|
|
return client.call('framework_get_reactors')
|
|
|
|
|
|
|
|
|
2019-03-02 08:32:19 +00:00
|
|
|
def thread_get_stats(client):
|
|
|
|
"""Query threads statistics.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Current threads statistics.
|
|
|
|
"""
|
|
|
|
return client.call('thread_get_stats')
|
2020-02-20 22:50:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
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)
|
2020-02-06 07:26:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def thread_get_pollers(client):
|
|
|
|
"""Query current pollers.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Current pollers.
|
|
|
|
"""
|
|
|
|
return client.call('thread_get_pollers')
|
2020-02-13 12:19:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
def thread_get_io_channels(client):
|
|
|
|
"""Query current IO channels.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Current IO channels.
|
|
|
|
"""
|
|
|
|
return client.call('thread_get_io_channels')
|