numam-spdk/scripts/rpc/app.py
Evgeniy Kochetov 7535cdbd62 rpc: Add thread_get_stats RPC method
SPDK threads collect busy and idle time statistics. This commit adds
thread_get_stats RPC method to retrieve these values.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I8ed8041c6164eb0c0a9336f4e50b5f26a3f20190
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445285
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-07-10 04:28:14 +00:00

33 lines
893 B
Python

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