From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v5 14/25] trace-cmd library: Introduce sections in trace file reading logic
Date: Wed, 24 Nov 2021 14:36:41 -0500 [thread overview]
Message-ID: <20211124143641.059939a4@gandalf.local.home> (raw)
In-Reply-To: <20211111151112.86751-5-tz.stoyanov@gmail.com>
On Thu, 11 Nov 2021 17:11:07 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
> Trace file version 7 is based on sections. Added an internal sections
> database and new helper functions to add, read, open and close file
> sections.
>
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
> ---
> lib/trace-cmd/trace-input.c | 69 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 69 insertions(+)
>
> diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
> index 0375afba..cc292236 100644
> --- a/lib/trace-cmd/trace-input.c
> +++ b/lib/trace-cmd/trace-input.c
> @@ -115,6 +115,14 @@ struct tsc2nsec {
> unsigned long long offset;
> };
>
> +struct file_section {
> + int id;
There's a 4 byte hole between id and section_offset. Might as well move
that down to flags.
> + unsigned long long section_offset;
> + unsigned long long data_offset;
> + enum tracecmd_section_flags flags;
Again, unless "flags" holds a single enum, it cannot be of type enum.
Just because flags are an enum, does not mean the use of them have to be an
enum. In many cases, enums to define flags have no name. They should be
anonymous enums.
-- Steve
> + struct file_section *next;
> +};
> +
> struct tracecmd_input {
> struct tep_handle *pevent;
> unsigned long file_state;
> @@ -154,6 +162,7 @@ struct tracecmd_input {
> struct hook_list *hooks;
> struct pid_addr_maps *pid_maps;
> /* file information */
> + struct file_section *sections;
> size_t header_files_start;
> size_t ftrace_files_start;
> size_t event_files_start;
next prev parent reply other threads:[~2021-11-24 19:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 15:11 [PATCH v5 10/25] trace-cmd library: Add section header before flyrecord trace data Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 11/25] trace-cmd library: Fit CPU latency trace data in the new trace file version 7 format Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 12/25] trace-cmd library: Do not write CPUs with empty trace data Tzvetomir Stoyanov (VMware)
2021-11-24 19:30 ` Steven Rostedt
2021-11-24 19:32 ` Steven Rostedt
2021-11-11 15:11 ` [PATCH v5 13/25] trace-cmd library: Add macro to check file state on reading Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 14/25] trace-cmd library: Introduce sections in trace file reading logic Tzvetomir Stoyanov (VMware)
2021-11-24 19:36 ` Steven Rostedt [this message]
2021-11-11 15:11 ` [PATCH v5 15/25] trace-cmd library: Initialize internal sections database on file read Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 16/25] trace-cmd library: Use sections database when reading parts of the trace file Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 17/25] trace-cmd library: Read headers from trace file version 7 Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 18/25] trace-cmd library: Read extended BUFFER option Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 19/25] trace-cmd library: Handle the extended DONE option 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=20211124143641.059939a4@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.com \
/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).