diff mbox series

[v3,19/23] trace-cmd: Print times in TimeShift options as unsigned in trace-cmd dump

Message ID 20210324130418.436206-20-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series TSC trace clock to nanosecond conversion | expand

Commit Message

Tzvetomir Stoyanov (VMware) March 24, 2021, 1:04 p.m. UTC
Fixed "trace-cmd dump" subcommand to print unsigned times from
Time Shift option in a trace.dat file.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 tracecmd/trace-dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Rostedt March 24, 2021, 3:33 p.m. UTC | #1
On Wed, 24 Mar 2021 15:04:14 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> Fixed "trace-cmd dump" subcommand to print unsigned times from
> Time Shift option in a trace.dat file.
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
> ---
>  tracecmd/trace-dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
> index 31b9d201..f5b864f7 100644
> --- a/tracecmd/trace-dump.c
> +++ b/tracecmd/trace-dump.c
> @@ -373,7 +373,7 @@ static void dump_option_timeshift(int fd, int size)
>  {
>  	long long *scalings = NULL;
>  	long long *offsets = NULL;
> -	long long *times = NULL;
> +	unsigned long long *times = NULL;
>  	long long trace_id;
>  	unsigned int count;
>  	unsigned int flags;

You also want to make the following change:

	for (i = 0; i < count; i++)
-		do_print(OPTIONS, "\t%lld * %lld %lld [offset * scaling @ time]\n",
+		do_print(OPTIONS, "\t%lld * %lld %llu [offset * scaling @ time]\n",
			 offsets[i], scalings[1], times[i]);

Which actually is the more important one.

-- Steve
diff mbox series

Patch

diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
index 31b9d201..f5b864f7 100644
--- a/tracecmd/trace-dump.c
+++ b/tracecmd/trace-dump.c
@@ -373,7 +373,7 @@  static void dump_option_timeshift(int fd, int size)
 {
 	long long *scalings = NULL;
 	long long *offsets = NULL;
-	long long *times = NULL;
+	unsigned long long *times = NULL;
 	long long trace_id;
 	unsigned int count;
 	unsigned int flags;