@@ -298,6 +298,7 @@ static void ksmodel_set_bin_counts(struct kshark_trace_histo *histo)
{
int i = 0, prev_not_empty;
+ histo->tot_count = 0;
memset(&histo->bin_count[0], 0,
(histo->n_bins) * sizeof(histo->bin_count[0]));
/*
@@ -329,6 +330,10 @@ static void ksmodel_set_bin_counts(struct kshark_trace_histo *histo)
histo->bin_count[prev_not_empty] =
histo->map[i] - histo->map[prev_not_empty];
+ if (prev_not_empty != LOB(histo))
+ histo->tot_count +=
+ histo->bin_count[prev_not_empty];
+
prev_not_empty = i;
}
}
@@ -350,6 +355,8 @@ static void ksmodel_set_bin_counts(struct kshark_trace_histo *histo)
histo->bin_count[prev_not_empty] = histo->map[UOB(histo)] -
histo->map[prev_not_empty];
}
+
+ histo->tot_count += histo->bin_count[prev_not_empty];
}
/**
@@ -51,6 +51,9 @@ struct kshark_trace_histo {
/** Number of entries in each bin. */
size_t *bin_count;
+ /** Total number of entries in all bin except the overflow bins. */
+ int tot_count;
+
/**
* Lower edge of the time-window to be visualized. Only entries having
* timestamp >= min will be visualized.
The tot_count field of the Visualization model descriptor provides fast access to the total number of entries being currently visualized. The total count can be useful in various cases. For example the sched event plugin can use it for knowing when to plot wakeup latency. Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark-qt/src/libkshark-model.c | 7 +++++++ kernel-shark-qt/src/libkshark-model.h | 3 +++ 2 files changed, 10 insertions(+)