scheduler: add scheduler subsystem JSON configuration
Added writing out JSON configuration for the scheduler subsystem. Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com> Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I51b1f94b3f56d0bfb8a87127163c8e248d6846b6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7119 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
a86e40f320
commit
b05d4a7d19
@ -175,7 +175,7 @@ DEPDIRS-event_vmd := init vmd $(JSON_LIBS) log thread
|
|||||||
|
|
||||||
DEPDIRS-event_bdev := init bdev event_accel event_vmd event_sock
|
DEPDIRS-event_bdev := init bdev event_accel event_vmd event_sock
|
||||||
|
|
||||||
DEPDIRS-event_scheduler := event init
|
DEPDIRS-event_scheduler := event init json log
|
||||||
|
|
||||||
DEPDIRS-event_nbd := init nbd event_bdev
|
DEPDIRS-event_nbd := init nbd event_bdev
|
||||||
DEPDIRS-event_nvmf := init nvmf event_bdev event_scheduler event_sock thread log bdev util $(JSON_LIBS)
|
DEPDIRS-event_nvmf := init nvmf event_bdev event_scheduler event_sock thread log bdev util $(JSON_LIBS)
|
||||||
|
@ -63,10 +63,42 @@ scheduler_subsystem_fini(void)
|
|||||||
spdk_subsystem_fini_next();
|
spdk_subsystem_fini_next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
scheduler_write_config_json(struct spdk_json_write_ctx *w)
|
||||||
|
{
|
||||||
|
struct spdk_scheduler *scheduler;
|
||||||
|
uint64_t scheduler_period;
|
||||||
|
|
||||||
|
assert(w != NULL);
|
||||||
|
|
||||||
|
scheduler = spdk_scheduler_get();
|
||||||
|
if (scheduler == NULL) {
|
||||||
|
SPDK_ERRLOG("Unable to get scheduler info\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduler_period = spdk_scheduler_get_period();
|
||||||
|
|
||||||
|
spdk_json_write_array_begin(w);
|
||||||
|
|
||||||
|
spdk_json_write_object_begin(w);
|
||||||
|
spdk_json_write_named_string(w, "method", "framework_set_scheduler");
|
||||||
|
spdk_json_write_named_object_begin(w, "params");
|
||||||
|
spdk_json_write_named_string(w, "name", scheduler->name);
|
||||||
|
if (scheduler_period != 0) {
|
||||||
|
spdk_json_write_named_uint32(w, "period", scheduler_period);
|
||||||
|
}
|
||||||
|
spdk_json_write_object_end(w);
|
||||||
|
spdk_json_write_object_end(w);
|
||||||
|
|
||||||
|
spdk_json_write_array_end(w);
|
||||||
|
}
|
||||||
|
|
||||||
static struct spdk_subsystem g_spdk_subsystem_scheduler = {
|
static struct spdk_subsystem g_spdk_subsystem_scheduler = {
|
||||||
.name = "scheduler",
|
.name = "scheduler",
|
||||||
.init = scheduler_subsystem_init,
|
.init = scheduler_subsystem_init,
|
||||||
.fini = scheduler_subsystem_fini,
|
.fini = scheduler_subsystem_fini,
|
||||||
|
.write_config_json = scheduler_write_config_json,
|
||||||
};
|
};
|
||||||
|
|
||||||
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_scheduler);
|
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_scheduler);
|
||||||
|
@ -161,6 +161,10 @@ def clear_sock_subsystem(args, sock_config):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def clear_scheduler_subsystem(args, scheduler_config):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def call_test_cmd(func):
|
def call_test_cmd(func):
|
||||||
def rpc_test_cmd(*args, **kwargs):
|
def rpc_test_cmd(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
|
@ -35,6 +35,7 @@ def filter_methods(do_remove_global_rpcs):
|
|||||||
'bdev_nvme_set_hotplug',
|
'bdev_nvme_set_hotplug',
|
||||||
'sock_impl_set_options',
|
'sock_impl_set_options',
|
||||||
'sock_set_default_impl',
|
'sock_set_default_impl',
|
||||||
|
'framework_set_scheduler',
|
||||||
]
|
]
|
||||||
|
|
||||||
data = json.loads(sys.stdin.read())
|
data = json.loads(sys.stdin.read())
|
||||||
|
Loading…
Reference in New Issue
Block a user