@@ -125,6 +125,7 @@ enum {
TRACECMD_OPTION_TRACEID,
TRACECMD_OPTION_TIME_SHIFT,
TRACECMD_OPTION_GUEST,
+ TRACECMD_OPTION_TSC2NSEC,
};
enum {
@@ -481,6 +481,21 @@ out:
free(buf);
}
+void dump_option_tsc2nsec(int fd, int size)
+{
+ int mult, shift, offset;
+
+ do_print(OPTIONS, "\n\t\t[Option TSC2NSEC, %d bytes]\n", size);
+
+ if (read_file_number(fd, &mult, 4))
+ die("cannot read tsc2nsec multiplier");
+ if (read_file_number(fd, &shift, 4))
+ die("cannot read tsc2nsec shift");
+ if (read_file_number(fd, &offset, 4))
+ die("cannot read tsc2nsec offset");
+ do_print(OPTIONS, "%d %d %d [multiplier, shift, offset]\n", mult, shift, offset);
+}
+
static void dump_options(int fd)
{
unsigned short option;
@@ -540,6 +555,9 @@ static void dump_options(int fd)
case TRACECMD_OPTION_GUEST:
dump_option_guest(fd, size);
break;
+ case TRACECMD_OPTION_TSC2NSEC:
+ dump_option_tsc2nsec(fd, size);
+ break;
default:
do_print(OPTIONS, " %d %d\t[Unknown option, size - skipping]\n",
option, size);
A new option is added in the trace.dat file for holding the multiplier and shift, used for converting TSC trace clock to nanoseconds. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- .../include/private/trace-cmd-private.h | 1 + tracecmd/trace-dump.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+)