aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYordan Karadzhov <ykaradzhov@vmware.com>2019-06-14 13:51:20 +0000
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-08 08:30:17 -0400
commit7f779353b4a8efc4ce26b9b76fdac543c81da280 (patch)
treed2ae596bb16f19e19dbb8faf465161a6fb56cf58
parentbd1953f512d698c2ab17b57414e21861953a1f87 (diff)
downloadtrace-cmd-7f779353b4a8efc4ce26b9b76fdac543c81da280.tar.gz
kernel-shark: Always use 64 bit variables for timestamps.
All time stamps of the trace records are coded with 64 bits, however on some systems the size_t type can be 32 bits. Link: http://lore.kernel.org/linux-trace-devel/20190614135045.17223-3-ykaradzhov@vmware.com Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203869 Reported-by: Alan Mikhak <alanmikhak@gmail.com> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel-shark/src/libkshark-model.c7
-rw-r--r--kernel-shark/src/libkshark-model.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c
index 0cac9246..18f9c691 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 95c30b64..47793b11 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);