From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v7 03/11] trace-cmd dump: Add helpers for processing trace file sections
Date: Wed, 19 Jan 2022 10:30:11 +0200 [thread overview]
Message-ID: <20220119083019.246153-4-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20220119083019.246153-1-tz.stoyanov@gmail.com>
Added a new local database for storing sections, found in trace file
version 7.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
tracecmd/trace-dump.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
index 1503e2bf..113eee8e 100644
--- a/tracecmd/trace-dump.c
+++ b/tracecmd/trace-dump.c
@@ -43,8 +43,18 @@ enum dump_items {
OPTIONS = (1 << 9),
FLYRECORD = (1 << 10),
CLOCK = (1 << 11),
+ SECTIONS = (1 << 12),
};
+struct file_section {
+ int id;
+ unsigned long long offset;
+ struct file_section *next;
+ enum dump_items verbosity;
+};
+
+static struct file_section *sections;
+
enum dump_items verbosity;
#define DUMP_CHECK(X) ((X) & verbosity)
@@ -768,6 +778,17 @@ static void dump_therest(int fd)
}
}
+static void free_sections(void)
+{
+ struct file_section *del;
+
+ while (sections) {
+ del = sections;
+ sections = sections->next;
+ free(del);
+ }
+}
+
static void dump_file(const char *file)
{
int fd;
@@ -793,7 +814,7 @@ static void dump_file(const char *file)
dump_cmdlines(fd);
dump_cpus_count(fd);
dump_therest(fd);
-
+ free_sections();
tep_free(tep);
tep = NULL;
close(fd);
--
2.34.1
next prev parent reply other threads:[~2022-01-19 8:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 8:30 [PATCH v7 00/11] trace-cmd dump - v7 update Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 01/11] trace-cmd dump: Add helpers for processing trace file version 7 Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 02/11] trace-cmd dump: Print compression header Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` Tzvetomir Stoyanov (VMware) [this message]
2022-01-19 8:30 ` [PATCH v7 04/11] trace-cmd dump: Read recursively all options sections Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 05/11] trace-cmd dump: Read extended BUFFER option Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 06/11] trace-cmd dump: Dump sections Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 07/11] trace-cmd dump: Dump trace file version 7 Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 08/11] trace-cmd dump: Read strings sections from v7 trace files Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 09/11] trace-cmd dump: Dump sections content Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 10/11] trace-cmd dump: Add new argument --sections Tzvetomir Stoyanov (VMware)
2022-01-19 8:30 ` [PATCH v7 11/11] trace-cmd dump: Align better the output of flyrecord dump 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=20220119083019.246153-4-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).