@@ -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)
@@ -773,6 +783,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;
@@ -798,7 +819,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);
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(-)