linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 05/10] trace-cmd library: Add new API to get compression of input handler
Date: Thu, 22 Apr 2021 10:38:57 +0300	[thread overview]
Message-ID: <20210422073902.484953-6-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210422073902.484953-1-tz.stoyanov@gmail.com>

The new API returns a handler to compression algorithm, used to compress
the trace file asociated with given input file handler:
 tracecmd_get_file_comperssion()

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/include/private/trace-cmd-private.h |  2 ++
 lib/trace-cmd/trace-input.c                       | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/trace-cmd/include/private/trace-cmd-private.h b/lib/trace-cmd/include/private/trace-cmd-private.h
index c562fc5d..4d2116ab 100644
--- a/lib/trace-cmd/include/private/trace-cmd-private.h
+++ b/lib/trace-cmd/include/private/trace-cmd-private.h
@@ -236,6 +236,8 @@ unsigned long long
 tracecmd_get_cursor(struct tracecmd_input *handle, int cpu);
 
 unsigned long tracecmd_get_file_version(struct tracecmd_input *handle);
+struct tracecmd_compress_proto *
+tracecmd_get_file_comperssion(struct tracecmd_input *handle);
 
 int tracecmd_ftrace_overrides(struct tracecmd_input *handle, struct tracecmd_ftrace *finfo);
 bool tracecmd_get_use_trace_clock(struct tracecmd_input *handle);
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index b96b0192..ad5af5fa 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -4192,6 +4192,17 @@ unsigned long tracecmd_get_file_version(struct tracecmd_input *handle)
 	return handle->file_version;
 }
 
+/**
+ * tracecmd_get_file_comperssion - return a handler to compression protocol,
+ *				   used to compress the trace file
+ * @handle: input handle for the trace.dat file
+ */
+struct tracecmd_compress_proto *
+tracecmd_get_file_comperssion(struct tracecmd_input *handle)
+{
+	return handle->z_proto;
+}
+
 /**
  * tracecmd_get_use_trace_clock - return use_trace_clock
  * @handle: input handle for the trace.dat file
-- 
2.30.2


  parent reply	other threads:[~2021-04-22  7:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  7:38 [POC PATCH 00/10] Add trace file compression Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` [PATCH 01/10] trace-cmd: Add APIs for library initialization and free Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` [PATCH 02/10] trace-cmd library: Add support for compression algorithms Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` [PATCH 03/10] trace-cmd library: Compress part of the trace file Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` [PATCH 04/10] trace-cmd library: Read compressed " Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` Tzvetomir Stoyanov (VMware) [this message]
2021-04-22  7:38 ` [PATCH 06/10] trace-cmd library: Inherit compression algorithm from input file Tzvetomir Stoyanov (VMware)
2021-04-22  7:38 ` [PATCH 07/10] trace-cmd library: Extend the create file APIs to support different compression Tzvetomir Stoyanov (VMware)
2021-04-22  7:39 ` [PATCH 08/10] trace-cmd record: Add new parameter --compression Tzvetomir Stoyanov (VMware)
2021-04-22  7:39 ` [PATCH 09/10] trace-cmd dump: Add support for trace files version 7 Tzvetomir Stoyanov (VMware)
2021-04-22  7:39 ` [PATCH 10/10] trace-cmd library: Add support for zlib compression library Tzvetomir Stoyanov (VMware)
2021-04-29  1:35 ` [POC PATCH 00/10] Add trace file compression Steven Rostedt
2021-04-29  3:51   ` Tzvetomir Stoyanov
2021-04-29 13:20     ` Steven Rostedt

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=20210422073902.484953-6-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).