Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ want_nvme = get_option('nvme').disabled() == false
want_libnvme = get_option('libnvme').disabled() == false
want_fabrics = get_option('fabrics').disabled() == false and host_system != 'windows'
want_mi = get_option('mi').disabled() == false and host_system != 'windows'
want_top = get_option('top').disabled() == false and host_system != 'windows'
want_json_c = get_option('json-c').disabled() == false
want_libkmod = get_option('libkmod').disabled() == false and host_system != 'windows'
want_tests = get_option('tests') and host_system != 'windows'
Expand Down Expand Up @@ -145,6 +146,7 @@ conf.set('RUNDIR', '"@0@"'.format(rundir))

conf.set('CONFIG_FABRICS', want_fabrics, description: 'Is fabrics enabled')
conf.set('CONFIG_MI', want_mi, description: 'Is MI enabled')
conf.set('CONFIG_TOP', want_top, description: 'Is nvme top enabled')

if host_system == 'windows'
kernel32_dep = cc.find_library('kernel32', required: true)
Expand Down Expand Up @@ -550,7 +552,6 @@ if want_nvme
'nvme-rpmb.c',
'nvme.c',
'plugin.c',
'nvme-print-stdout-top.c',
]

if json_c_dep.found()
Expand All @@ -564,6 +565,10 @@ if want_nvme
sources += 'fabrics.c'
endif

if want_top
sources += 'nvme-print-stdout-top.c'
endif

sources += plugin_sources
sources += util_sources

Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ option(
value: 'enabled',
description : 'MI support'
)
option(
'top',
type : 'feature',
value: 'enabled',
description : 'nvme top support'
)
option(
'python',
type : 'feature',
Expand Down
2 changes: 2 additions & 0 deletions nvme-builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ COMMAND_LIST(
ENTRY("show-regs", "Shows the controller registers or properties. Requires character device", show_registers)
ENTRY("set-reg", "Set a register and show the resulting value", set_register)
ENTRY("get-reg", "Get a register and show the resulting value", get_register)
#ifdef CONFIG_TOP
ENTRY("top", "nvme top", top)
#endif
#ifdef CONFIG_FABRICS
ENTRY("discover", "Discover NVMeoF subsystems", discover_cmd)
ENTRY("connect-all", "Discover and Connect to NVMeoF subsystems", connect_all_cmd)
Expand Down
5 changes: 5 additions & 0 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -7097,7 +7097,12 @@ static struct print_ops stdout_print_ops = {
.topology_tabular = stdout_topology_tabular,

/* nvme top */
#ifdef CONFIG_TOP
.top = stdout_top,
#else
.top = NULL,
#endif

/* status and error messages */
.connect_msg = stdout_connect_msg,
.show_message = stdout_message,
Expand Down
2 changes: 2 additions & 0 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3597,6 +3597,7 @@ static int list_subsys(int argc, char **argv, struct command *acmd,
return 0;
}

#ifdef CONFIG_TOP
static int top(int argc, char **argv, struct command *acmd,
struct plugin *plugin)
{
Expand Down Expand Up @@ -3641,6 +3642,7 @@ static int top(int argc, char **argv, struct command *acmd,

return err;
}
#endif

static int list(int argc, char **argv, struct command *acmd, struct plugin *plugin)
{
Expand Down
Loading