@@ -217,6 +217,29 @@ static void dump_initial_format(int fd)
do_print(SUMMARY, "\t\t%d\t[Page size, bytes]\n", val4);
}
+static void dump_compress(int fd)
+{
+ char zname[DUMP_SIZE];
+ char zver[DUMP_SIZE];
+
+ if (file_version < FILE_VERSION_COMPRESSION)
+ return;
+
+ /* get compression header */
+ if (read_file_string(fd, zname, DUMP_SIZE))
+ die("no compression header");
+ if (read_file_string(fd, zver, DUMP_SIZE))
+ die("no compression version");
+ do_print((SUMMARY), "\t\t%s\t[Compression algorithm]\n", zname);
+ do_print((SUMMARY), "\t\t%s\t[Compression version]\n", zver);
+
+ if (strcmp(zname, "none")) {
+ compress = tracecmd_compress_alloc(zname, zver, fd, tep, NULL);
+ if (!compress)
+ die("cannot uncompress the file");
+ }
+}
+
static void dump_header_page(int fd)
{
unsigned long long size;
@@ -760,6 +783,7 @@ static void dump_file(const char *file)
do_print(SUMMARY, "\n Tracing meta data in file %s:\n", file);
dump_initial_format(fd);
+ dump_compress(fd);
dump_header_page(fd);
dump_header_event(fd);
dump_ftrace_events_format(fd);
Dump the compression header of trace file version 7 Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- tracecmd/trace-dump.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)