Linux-Trace-Devel Archive on lore.kernel.org
 help / Atom feed
* [PATCH] kernel-shark-qt: Handle the case when the range of the model is too small
@ 2019-01-15 10:18 Yordan Karadzhov
  2019-01-15 15:05 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov @ 2019-01-15 10:18 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov

The size of the bin must be equal or greater than 1, hence the range
must be equal or greater than the number of bins. When this condition
is not satisfied, the range has to be extended, instead of just leaving
the model unset.

Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/libkshark-model.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel-shark-qt/src/libkshark-model.c b/kernel-shark-qt/src/libkshark-model.c
index 76e2940..2094795 100644
--- a/kernel-shark-qt/src/libkshark-model.c
+++ b/kernel-shark-qt/src/libkshark-model.c
@@ -102,8 +102,10 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo,
 	struct kshark_entry *last;
 
 	/* The size of the bin must be >= 1, hence the range must be >= n. */
-	if (n == 0 || range < n)
-		return;
+	if (n == 0 || range < n) {
+		range = n;
+		max = min + n;
+	}
 
 	/*
 	 * If the number of bins changes, allocate memory for the descriptor of
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernel-shark-qt: Handle the case when the range of the model is too small
  2019-01-15 10:18 [PATCH] kernel-shark-qt: Handle the case when the range of the model is too small Yordan Karadzhov
@ 2019-01-15 15:05 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-01-15 15:05 UTC (permalink / raw)
  To: Yordan Karadzhov; +Cc: linux-trace-devel

On Tue, 15 Jan 2019 12:18:57 +0200
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> The size of the bin must be equal or greater than 1, hence the range
> must be equal or greater than the number of bins. When this condition
> is not satisfied, the range has to be extended, instead of just leaving
> the model unset.
> 
> Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

You forgot to add:

Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model used by the Qt-based KS")

;-)

-- Steve

> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark-qt/src/libkshark-model.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel-shark-qt/src/libkshark-model.c b/kernel-shark-qt/src/libkshark-model.c
> index 76e2940..2094795 100644
> --- a/kernel-shark-qt/src/libkshark-model.c
> +++ b/kernel-shark-qt/src/libkshark-model.c
> @@ -102,8 +102,10 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo,
>  	struct kshark_entry *last;
>  
>  	/* The size of the bin must be >= 1, hence the range must be >= n. */
> -	if (n == 0 || range < n)
> -		return;
> +	if (n == 0 || range < n) {
> +		range = n;
> +		max = min + n;
> +	}
>  
>  	/*
>  	 * If the number of bins changes, allocate memory for the descriptor of


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 10:18 [PATCH] kernel-shark-qt: Handle the case when the range of the model is too small Yordan Karadzhov
2019-01-15 15:05 ` Steven Rostedt

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox