linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	Yordan Karadzhov <ykaradzhov@vmware.com>
Subject: [PATCH 3/3] kernel-shark: Fix a bug in ksmodel_set_next_bin_edge()
Date: Thu, 21 Feb 2019 14:42:05 +0200	[thread overview]
Message-ID: <20190221124205.21115-4-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190221124205.21115-1-ykaradzhov@vmware.com>

The modification of the last bin of the model makes no sense (this is
my mistake). The comment above the code that is doing this modification
is partially correct, however it speaks about increasing the size of
the last bin, while the code below the comment changes the lower edge
of this bin. The actual increase of the size of the last bin is done in
ksmodel_set_upper_edge() where the lower edge of the Upper Overflow bin
gets shifted (max + 1). This effectively increases the size of the last bin.

Reported-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/libkshark-model.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c
index b6d3612..4bd1e2c 100644
--- a/kernel-shark/src/libkshark-model.c
+++ b/kernel-shark/src/libkshark-model.c
@@ -266,15 +266,6 @@ static void ksmodel_set_next_bin_edge(struct kshark_trace_histo *histo,
 	/* Calculate the beginning of the next bin. */
 	time = histo->min + next_bin * histo->bin_size;
 
-	/*
-	 * The timestamp of the very last entry of the dataset can be exactly
-	 * equal to the value of the upper edge of the range. This is very
-	 * likely to happen when we use ksmodel_set_in_range_bining(). In this
-	 * case we have to increase the size of the very last bin in order to
-	 * make sure that the last entry of the dataset will fall into it.
-	 */
-	if (next_bin == histo->n_bins - 1)
-		++time;
 	/*
 	 * Find the index of the first entry inside
 	 * the next bin (timestamp > time).
-- 
2.17.1


  parent reply	other threads:[~2019-02-21 12:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 12:42 [PATCH 0/3] KernelShark visualization model fixes Yordan Karadzhov
2019-02-21 12:42 ` [PATCH 1/3] kernel-shark: Fix a bug in ksmodel_shift_backward() Yordan Karadzhov
2019-02-21 12:42 ` [PATCH 2/3] kernel-shark: Fix a bug in shift_XXX methods of the visualization model Yordan Karadzhov
2019-02-21 12:42 ` Yordan Karadzhov [this message]
2019-02-21 16:15   ` [PATCH 3/3] kernel-shark: Fix a bug in ksmodel_set_next_bin_edge() Slavomir Kaslev
2019-02-21 16:38     ` Yordan Karadzhov
2019-02-22 19:32       ` Steven Rostedt
2019-02-22 19:33     ` Steven Rostedt
2019-02-22 20:22       ` Slavomir Kaslev

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=20190221124205.21115-4-ykaradzhov@vmware.com \
    --to=ykaradzhov@vmware.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).