From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 18/20] trace-cmd list: Show supported compression algorithms
Date: Mon, 13 Sep 2021 15:42:01 +0300 [thread overview]
Message-ID: <20210913124203.3677760-19-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210913124203.3677760-1-tz.stoyanov@gmail.com>
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(+)
diff --git a/Documentation/trace-cmd/trace-cmd-list.1.txt b/Documentation/trace-cmd/trace-cmd-list.1.txt
index a5c6b16c..b77e3460 100644
--- a/Documentation/trace-cmd/trace-cmd-list.1.txt
+++ b/Documentation/trace-cmd/trace-cmd-list.1.txt
@@ -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),
diff --git a/tracecmd/trace-list.c b/tracecmd/trace-list.c
index d060c810..900da73b 100644
--- a/tracecmd/trace-list.c
+++ b/tracecmd/trace-list.c
@@ -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;
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index ac12b066..34c6cc35 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -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",
--
2.31.1
next prev parent reply other threads:[~2021-09-13 12:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 12:41 [PATCH 00/20] Trace file version 7 - compression Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 01/20] trace-cmd library: Add support for compression algorithms Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 02/20] trace-cmd library: Internal helpers for compressing data Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 03/20] trace-cmd library: Internal helpers for uncompressing data Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 04/20] trace-cmd library: Inherit compression algorithm from input file Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 05/20] trace-cmd library: New API to configure compression on an output handler Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 06/20] trace-cmd library: Write compression header in the trace file Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 07/20] trace-cmd library: Compress part of " Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 08/20] trace-cmd library: Add local helper function for data compression Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 09/20] trace-cmd library: Compress the trace data Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 10/20] trace-cmd library: Decompress the options section, if it is compressed Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 11/20] trace-cmd library: Read compression header Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 12/20] trace-cmd library: Extend the input handler with trace data decompression context Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 13/20] trace-cmd library: Initialize CPU data decompression logic Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 14/20] trace-cmd library: Add logic for in-memory decompression Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 15/20] trace-cmd library: Read compressed latency data Tzvetomir Stoyanov (VMware)
2021-09-13 12:41 ` [PATCH 16/20] trace-cmd library: Decompress file sections on reading Tzvetomir Stoyanov (VMware)
2021-09-13 12:42 ` [PATCH 17/20] trace-cmd library: Add zlib compression algorithm Tzvetomir Stoyanov (VMware)
2021-09-13 12:42 ` Tzvetomir Stoyanov (VMware) [this message]
2021-09-13 12:42 ` [PATCH 19/20] trace-cmd record: Add compression to the trace context Tzvetomir Stoyanov (VMware)
2021-09-13 12:42 ` [PATCH 20/20] trace-cmd report: Add new parameter for trace file compression Tzvetomir Stoyanov (VMware)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210913124203.3677760-19-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).