lib/event: Rename context switch monitoring APIs to be concise
spdk_reactor_enable_framework_monitor_context_switch and spdk_reactor_framework_monitor_context_switch_enabled had been a little long and not easy to get the meaning. spdk_framework_enable_context_switch_monitor and spdk_framework_context_switch_monitor_enabled will be a little more concise, and hence change the names accordingly. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I5f1d50e8b62846cbd0f91b94f94cbaf16fefa39b Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478538 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
43d7867243
commit
25c5e3f59d
@ -51,6 +51,13 @@ An new RPC `framework_get_reactors` has been added to retrieve list of all react
|
|||||||
|
|
||||||
Updated DPDK submodule to DPDK 19.11.
|
Updated DPDK submodule to DPDK 19.11.
|
||||||
|
|
||||||
|
### event
|
||||||
|
|
||||||
|
The functions `spdk_reactor_enable_framework_monitor_context_switch()` and
|
||||||
|
`spdk_reactor_framework_monitor_context_switch_enabled()` have been changed to
|
||||||
|
`spdk_framework_enable_context_switch_monitor()` and
|
||||||
|
`spdk_framework_context_switch_monitor_enabled()`, respectively.
|
||||||
|
|
||||||
## v19.10:
|
## v19.10:
|
||||||
|
|
||||||
### rpc
|
### rpc
|
||||||
|
@ -289,14 +289,14 @@ void spdk_event_call(struct spdk_event *event);
|
|||||||
*
|
*
|
||||||
* \param enabled True to enable, false to disable.
|
* \param enabled True to enable, false to disable.
|
||||||
*/
|
*/
|
||||||
void spdk_reactor_enable_framework_monitor_context_switch(bool enabled);
|
void spdk_framework_enable_context_switch_monitor(bool enabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether context switch monitoring is enabled.
|
* Return whether context switch monitoring is enabled.
|
||||||
*
|
*
|
||||||
* \return true if enabled or false otherwise.
|
* \return true if enabled or false otherwise.
|
||||||
*/
|
*/
|
||||||
bool spdk_reactor_framework_monitor_context_switch_enabled(void);
|
bool spdk_framework_context_switch_monitor_enabled(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ static struct spdk_reactor *g_reactors;
|
|||||||
static struct spdk_cpuset g_reactor_core_mask;
|
static struct spdk_cpuset g_reactor_core_mask;
|
||||||
static enum spdk_reactor_state g_reactor_state = SPDK_REACTOR_STATE_UNINITIALIZED;
|
static enum spdk_reactor_state g_reactor_state = SPDK_REACTOR_STATE_UNINITIALIZED;
|
||||||
|
|
||||||
static bool g_framework_monitor_context_switch_enabled = true;
|
static bool g_framework_context_switch_monitor_enabled = true;
|
||||||
|
|
||||||
static struct spdk_mempool *g_spdk_event_mempool = NULL;
|
static struct spdk_mempool *g_spdk_event_mempool = NULL;
|
||||||
|
|
||||||
@ -276,19 +276,19 @@ get_rusage(struct spdk_reactor *reactor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_reactor_enable_framework_monitor_context_switch(bool enable)
|
spdk_framework_enable_context_switch_monitor(bool enable)
|
||||||
{
|
{
|
||||||
/* This global is being read by multiple threads, so this isn't
|
/* This global is being read by multiple threads, so this isn't
|
||||||
* strictly thread safe. However, we're toggling between true and
|
* strictly thread safe. However, we're toggling between true and
|
||||||
* false here, and if a thread sees the value update later than it
|
* false here, and if a thread sees the value update later than it
|
||||||
* should, it's no big deal. */
|
* should, it's no big deal. */
|
||||||
g_framework_monitor_context_switch_enabled = enable;
|
g_framework_context_switch_monitor_enabled = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
spdk_reactor_framework_monitor_context_switch_enabled(void)
|
spdk_framework_context_switch_monitor_enabled(void)
|
||||||
{
|
{
|
||||||
return g_framework_monitor_context_switch_enabled;
|
return g_framework_context_switch_monitor_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -341,7 +341,7 @@ _spdk_reactor_run(void *arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_framework_monitor_context_switch_enabled) {
|
if (g_framework_context_switch_monitor_enabled) {
|
||||||
if ((last_rusage + rusage_period) < now) {
|
if ((last_rusage + rusage_period) < now) {
|
||||||
get_rusage(reactor);
|
get_rusage(reactor);
|
||||||
last_rusage = now;
|
last_rusage = now;
|
||||||
|
@ -137,13 +137,13 @@ spdk_rpc_framework_monitor_context_switch(struct spdk_jsonrpc_request *request,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_reactor_enable_framework_monitor_context_switch(req.enabled);
|
spdk_framework_enable_context_switch_monitor(req.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
w = spdk_jsonrpc_begin_result(request);
|
w = spdk_jsonrpc_begin_result(request);
|
||||||
spdk_json_write_object_begin(w);
|
spdk_json_write_object_begin(w);
|
||||||
|
|
||||||
spdk_json_write_named_bool(w, "enabled", spdk_reactor_framework_monitor_context_switch_enabled());
|
spdk_json_write_named_bool(w, "enabled", spdk_framework_context_switch_monitor_enabled());
|
||||||
|
|
||||||
spdk_json_write_object_end(w);
|
spdk_json_write_object_end(w);
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
|
Loading…
Reference in New Issue
Block a user