From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v4 2/5] trace-cmd: Update long size in the tep handler right after it is read from the trace file
Date: Fri, 26 Feb 2021 14:13:03 +0200 [thread overview]
Message-ID: <20210226121306.216757-3-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210226121306.216757-1-tz.stoyanov@gmail.com>
The tracecmd_read_headers() API reads available headers from a trace
file. When a header is successfully read, the information gathered from it
should be applied in the internal structures, before continuing with the
next header. This will hek not to loose the information, in case not all
of the headers are in the file. This is useful for reading partial trace
file, used in trace-cmd listener and agent logic.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
lib/trace-cmd/trace-input.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 76bcb215..2004114d 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -782,6 +782,7 @@ int tracecmd_read_headers(struct tracecmd_input *handle)
ret = read_header_files(handle);
if (ret < 0)
return -1;
+ tep_set_long_size(handle->pevent, handle->long_size);
ret = read_ftrace_files(handle, NULL);
if (ret < 0)
@@ -808,8 +809,6 @@ int tracecmd_read_headers(struct tracecmd_input *handle)
if (read_options_type(handle) < 0)
return -1;
- tep_set_long_size(handle->pevent, handle->long_size);
-
return 0;
}
--
2.29.2
next prev parent reply other threads:[~2021-02-26 12:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 12:13 [PATCH v4 0/5] Fix listener and add trace file validation Tzvetomir Stoyanov (VMware)
2021-02-26 12:13 ` [PATCH v4 1/5] trace-cmd Add API to save command lines in trace file Tzvetomir Stoyanov (VMware)
2021-02-26 12:13 ` Tzvetomir Stoyanov (VMware) [this message]
2021-02-26 12:13 ` [PATCH v4 3/5] trace-cmd: Do not use trace plugins when reading partial trace files Tzvetomir Stoyanov (VMware)
2021-02-26 12:13 ` [PATCH v4 4/5] trace-cmd: Add validation for reading and writing trace.dat files Tzvetomir Stoyanov (VMware)
2021-02-26 19:43 ` Steven Rostedt
2021-02-26 12:13 ` [PATCH v4 5/5] trace-cmd: Fix broken listener and add error checks 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=20210226121306.216757-3-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).