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
|
|
|
|
|
|
|
|
|
|
|
def thread_get_stats(client):
|
|
|
|
"""Query threads statistics.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Current threads statistics.
|
|
|
|
"""
|
|
|
|
return client.call('thread_get_stats')
|