From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 00/10] Refactor APIs for creating output handler
Date: Fri, 8 Oct 2021 07:13:11 +0300 [thread overview]
Message-ID: <20211008041321.973755-1-tz.stoyanov@gmail.com> (raw)
In the trace-cmd library there are various APIs for allocating and
initializing output handler to a trace file. The existing APIs are use
case oriented, with a lot of parameters. Extending them for new use
cases, adding more input parameters, will make the library more complex
and not easy to use.
Almost all use case oriented APIs for output handler creation are
removed and replaced with new flow, which is easier to be extended with
new parameters.
Removed APIs:
tracecmd_create_init_fd_msg()
tracecmd_create_init_file_glob()
tracecmd_create_init_fd_glob()
tracecmd_create_init_file_override()
New APIs:
tracecmd_output_allocate()
tracecmd_output_set_msg()
tracecmd_output_set_trace_dir()
tracecmd_output_set_kallsyms()
tracecmd_output_set_from_input()
tracecmd_output_write_init()
tracecmd_output_write_headers()
The new tracecmd_output_allocate() API allocates memory and performs
minimal initialization of an output handler to a trace file. No data
is written in the file.
The tracecmd_output_set_...() APIs can be used to set various
parameters to the newly allocated output handler, that affect the way
the data is written into the file.
When the output handler is configured for the desired use case, the
tracecmd_output_write_init() is used to start writing to the file, it
writes initial magic bytes.
The tracecmd_output_write_headers() API is used to write the initial
headers into the file.
This patch-set depends on "[PATCH v4 0/6] trace-cmd fixes and clean-ups",
should be applied on top of it:
https://lore.kernel.org/linux-trace-devel/20211008041124.972956-1-tz.stoyanov@gmail.com/
Tzvetomir Stoyanov (VMware) (10):
trace-cmd library: New API for allocating an output handler
trace-cmd library: New API for setting a message context to an output
handler
trace-cmd library: New API for setting a custom trace directory to an
output handler
trace-cmd library: New API for setting a custom kallsyms to an output
handler
trace-cmd library: New API to inherit parameters from an existing
trace file
trace-cmd library: New API tracecmd_output_write_init
trace-cmd library: New API to write headers of a trace file
trace-cmd library: Use the new flow when creating output handler
trace-cmd: Use the new flow when creating output handler
trace-cmd library: Remove deprecated APIs for creating an output
handler
.../include/private/trace-cmd-private.h | 25 +-
lib/trace-cmd/trace-output.c | 397 +++++++++++-------
tracecmd/trace-record.c | 55 ++-
tracecmd/trace-restore.c | 32 +-
4 files changed, 347 insertions(+), 162 deletions(-)
--
2.31.1
next reply other threads:[~2021-10-08 4:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 4:13 Tzvetomir Stoyanov (VMware) [this message]
2021-10-08 4:13 ` [PATCH 01/10] trace-cmd library: New API for allocating an output handler Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 02/10] trace-cmd library: New API for setting a message context to " Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 03/10] trace-cmd library: New API for setting a custom trace directory " Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 04/10] trace-cmd library: New API for setting a custom kallsyms " Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 05/10] trace-cmd library: New API to inherit parameters from an existing trace file Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 06/10] trace-cmd library: New API tracecmd_output_write_init Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 07/10] trace-cmd library: New API to write headers of a trace file Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 08/10] trace-cmd library: Use the new flow when creating output handler Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 09/10] trace-cmd: " Tzvetomir Stoyanov (VMware)
2021-10-08 4:13 ` [PATCH 10/10] trace-cmd library: Remove deprecated APIs for creating an " 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=20211008041321.973755-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.