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. Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..") Signed-off-by: Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> --- kernel-shark/src/libkshark-model.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c index b71a9b8..a185d6b 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); -- 2.17.1
![]() |