linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: "linux-trace-devel@vger.kernel.org" 
	<linux-trace-devel@vger.kernel.org>,
	Yordan Karadzhov <ykaradzhov@vmware.com>,
	Alan Mikhak <alanmikhak@gmail.com>
Subject: [PATCH v2 2/3] kernel-shark: Always use 64 bit variables for timestamps.
Date: Fri, 14 Jun 2019 13:51:20 +0000	[thread overview]
Message-ID: <20190614135045.17223-3-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190614135045.17223-1-ykaradzhov@vmware.com>

All time stamps of the trace records are coded with 64 bits, however
on some systems the size_t type can be 32 bits.

Reported-by: Alan Mikhak <alanmikhak@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/libkshark-model.c | 7 ++++---
 kernel-shark/src/libkshark-model.h | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c
index 0cac924..18f9c69 100644
--- a/kernel-shark/src/libkshark-model.c
+++ b/kernel-shark/src/libkshark-model.c
@@ -260,7 +260,8 @@ static size_t ksmodel_set_upper_edge(struct kshark_trace_histo *histo)
 static void ksmodel_set_next_bin_edge(struct kshark_trace_histo *histo,
 				      size_t bin, size_t last_row)
 {
-	size_t time_min, time_max, next_bin = bin + 1;
+	uint64_t time_min, time_max;
+	size_t next_bin = bin + 1;
 	ssize_t row;
 
 	/* Calculate the beginning and the end of the next bin. */
@@ -601,9 +602,9 @@ void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n)
  * @param histo: Input location for the model descriptor.
  * @param ts: position in time to be visualized.
  */
-void ksmodel_jump_to(struct kshark_trace_histo *histo, size_t ts)
+void ksmodel_jump_to(struct kshark_trace_histo *histo, uint64_t ts)
 {
-	size_t min, max, range_min;
+	uint64_t min, max, range_min;
 
 	if (ts > histo->min && ts < histo->max) {
 		/*
diff --git a/kernel-shark/src/libkshark-model.h b/kernel-shark/src/libkshark-model.h
index 95c30b6..47793b1 100644
--- a/kernel-shark/src/libkshark-model.h
+++ b/kernel-shark/src/libkshark-model.h
@@ -89,7 +89,7 @@ void ksmodel_shift_forward(struct kshark_trace_histo *histo, size_t n);
 
 void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n);
 
-void ksmodel_jump_to(struct kshark_trace_histo *histo, size_t ts);
+void ksmodel_jump_to(struct kshark_trace_histo *histo, uint64_t ts);
 
 void ksmodel_zoom_out(struct kshark_trace_histo *histo,
 		      double r, int mark);
-- 
2.20.1


  parent reply	other threads:[~2019-06-14 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 13:51 [PATCH v2 0/3] Fixes needed befor KS 1.0 Yordan Karadzhov
2019-06-14 13:51 ` [PATCH v2 1/3] kernel-shark: Fix a bug when plotting the last trace record Yordan Karadzhov
2019-06-14 13:51 ` Yordan Karadzhov [this message]
2019-06-14 13:51 ` [PATCH v2 3/3] kernel-shark: Fix all warnings when building on 32 bit systems Yordan Karadzhov
2019-06-15 10:26   ` Alan Mikhak

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=20190614135045.17223-3-ykaradzhov@vmware.com \
    --to=ykaradzhov@vmware.com \
    --cc=alanmikhak@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).