summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/perfmon/cli.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/perfmon/cli.c b/src/plugins/perfmon/cli.c
index 1535570de7e..ce191eac35b 100644
--- a/src/plugins/perfmon/cli.c
+++ b/src/plugins/perfmon/cli.c
@@ -91,6 +91,15 @@ format_perfmon_bundle (u8 *s, va_list *args)
return s;
}
+static int
+bundle_name_sort_cmp (void *a1, void *a2)
+{
+ perfmon_bundle_t **n1 = a1;
+ perfmon_bundle_t **n2 = a2;
+
+ return clib_strcmp ((char *) (*n1)->name, (char *) (*n2)->name);
+}
+
static clib_error_t *
show_perfmon_bundle_command_fn (vlib_main_t *vm, unformat_input_t *input,
vlib_cli_command_t *cmd)
@@ -127,6 +136,8 @@ show_perfmon_bundle_command_fn (vlib_main_t *vm, unformat_input_t *input,
if (verbose == 0)
vlib_cli_output (vm, "%U\n", format_perfmon_bundle, 0, 0);
+ vec_sort_with_function (vb, bundle_name_sort_cmp);
+
for (int i = 0; i < vec_len (vb); i++)
/* bundle type will be unknown if no cpu_supports matched */
if (vb[i]->type != PERFMON_BUNDLE_TYPE_UNKNOWN)