Spdk/scripts/rpc/app.py
Vitaliy Mysak d267d0e874 lib/log: add RPC to toggle timestamps
Allow toggling log timestamps on and off by adding new RPC call.

Change-Id: I34c84bf89fae352ade266fbf7fd20594ff67bced
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2024
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-08-31 07:46:36 +00:00

92 lines
2.1 KiB
Python

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 log_enable_timestamps(client, enabled):
"""Enable or disable timestamps.
Args:
value: on or off
Returns:
None
"""
params = {'enabled': enabled}
return client.call('log_enable_timestamps', 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')