msm: idle_stats: Overwrite samples if it surpasses maximum number
With this change, idle_stats will ensure that no samples and events are ignored when they reach their maximum. Change-Id: Ibaa7dff45672e587838e0062f5c75d47dc9a0658 Signed-off-by: Nilesh Shah <nsshah@codeaurora.org>
This commit is contained in:
@@ -103,9 +103,10 @@ static void msm_idle_stats_add_sample(struct msm_idle_stats_device *device,
|
||||
{
|
||||
hrtimer_cancel(&device->busy_timer);
|
||||
hrtimer_set_expires(&device->busy_timer, us_to_ktime(0));
|
||||
if (device->stats->nr_collected >= device->max_samples)
|
||||
return;
|
||||
|
||||
if (device->stats->nr_collected >= MSM_IDLE_STATS_NR_MAX_INTERVALS) {
|
||||
pr_warning("idle_stats_device: Overwriting samples\n");
|
||||
device->stats->nr_collected = 0;
|
||||
}
|
||||
device->stats->pulse_chain[device->stats->nr_collected] = *pulse;
|
||||
device->stats->nr_collected++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user