@@ -549,6 +549,24 @@ static void show_plugins(void)
tep_free(pevent);
}
+static void show_compression(void)
+{
+ char **versions, **names;
+ int c, i;
+
+ c = tracecmd_compress_protos_get(&names, &versions);
+ if (c <= 0) {
+ printf("No compression algorithms are supported\n");
+ return;
+ }
+ printf("Supported compression algorithms:\n");
+ for (i = 0; i < c; i++)
+ printf("\t%s, %s\n", names[i], versions[i]);
+
+ free(names);
+ free(versions);
+}
+
void trace_list(int argc, char **argv)
{
int events = 0;
@@ -562,6 +580,7 @@ void trace_list(int argc, char **argv)
int flags = 0;
int systems = 0;
int show_all = 1;
+ int compression = 0;
int i;
const char *arg;
const char *funcre = NULL;
@@ -626,6 +645,10 @@ void trace_list(int argc, char **argv)
systems = 1;
show_all = 0;
break;
+ case 'c':
+ compression = 1;
+ show_all = 0;
+ break;
case '-':
if (strcmp(argv[i], "--debug") == 0) {
tracecmd_set_debug(true);
@@ -670,6 +693,8 @@ void trace_list(int argc, char **argv)
show_clocks();
if (systems)
show_systems();
+ if (compression)
+ show_compression();
if (show_all) {
printf("event systems:\n");
show_systems();
@@ -679,6 +704,7 @@ void trace_list(int argc, char **argv)
show_tracers();
printf("\noptions:\n");
show_options();
+ show_compression();
}
return;
@@ -330,6 +330,7 @@ static struct usage_help usage_help[] = {
" -O list plugin options\n"
" -B list defined buffer instances\n"
" -C list the defined clocks (and active one)\n"
+ " -c list the supported trace file compression algorithms\n"
},
{
"restore",
Add new parameter "trace-cmd list -c" to show supported compression algorithms. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- tracecmd/trace-list.c | 26 ++++++++++++++++++++++++++ tracecmd/trace-usage.c | 1 + 2 files changed, 27 insertions(+)