diff options
author | Yordan Karadzhov <ykaradzhov@vmware.com> | 2019-02-21 14:42:03 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-02-22 14:34:21 -0500 |
commit | fb23b1c236479a15e5534bf0120396118b5ddb6e (patch) | |
tree | 54cc001284e337d1c741e9c5409ad8499a9de90e | |
parent | 23e1e7c168298f1724e01e41fd712a518c2207cd (diff) | |
download | trace-cmd-fb23b1c236479a15e5534bf0120396118b5ddb6e.tar.gz |
kernel-shark: Fix a bug in ksmodel_shift_backward()
Bin 0 of the new model has to be set after copying the overlaping bins
from the old model. Otherwise the new content of Bin 0 will be copied
into Bin "n". This bug has no effect because ksmodel_shift_backward()
has a second bug in the loop over the non-overlapping bins. The second
bug will be fixed in the following patch.
Link: http://lore.kernel.org/linux-trace-devel/20190221124205.21115-2-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..")
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c index b71a9b85..a185d6ba 100644 --- a/kernel-shark/src/libkshark-model.c +++ b/kernel-shark/src/libkshark-model.c @@ -557,17 +557,18 @@ void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n) ksmodel_fill(histo, histo->data, histo->data_size); return; } - /* Set the new Lower Overflow bin. */ - ksmodel_set_lower_edge(histo); /* - * Copy the the mapping indexes of all overlaping bins starting from + * Copy the mapping indexes of all overlaping bins starting from * bin "0" of the old histo. Note that the number of overlaping bins * is histo->n_bins - n. */ memmove(&histo->map[n], &histo->map[0], sizeof(histo->map[0]) * (histo->n_bins - n)); + /* Set the new Lower Overflow bin. */ + ksmodel_set_lower_edge(histo); + /* Calculate only the content of the new (non-overlapping) bins. */ for (bin = 0; bin < n; ++bin) { ksmodel_set_next_bin_edge(histo, bin, last_row); |