@@ -71,6 +71,9 @@ OPTIONS
List defined clocks that can be used with trace-cmd record -C.
The one in brackets ([]) is the active clock.
+*-c*::
+ List the available trace file compression algorithms.
+
SEE ALSO
--------
trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1),
@@ -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;
@@ -348,6 +348,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> --- Documentation/trace-cmd/trace-cmd-list.1.txt | 3 +++ tracecmd/trace-list.c | 26 ++++++++++++++++++++ tracecmd/trace-usage.c | 1 + 3 files changed, 30 insertions(+)