Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7868f12 authored by Saravana Kannan's avatar Saravana Kannan Committed by Gerrit - the friendly Code Review server
Browse files

PM / devfreq: bw_hwmon: Add bw_hwmon_meas and bw_hwmon_update trace points



Add trace points to log the measurements and the final decision made by the
bw_hwmon governor.

Change-Id: I834bec340f81f02fcccbd6d7568a301dc74dded5
Signed-off-by: default avatarSaravana Kannan <skannan@codeaurora.org>
parent d35f2ab6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -28,6 +28,7 @@
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/devfreq.h>
#include <trace/events/power.h>
#include "governor.h"
#include "governor_bw_hwmon.h"

@@ -118,6 +119,10 @@ static unsigned long measure_bw_and_set_irq(struct hwmon_node *node)
	preempt_enable();

	dev_dbg(hw->df->dev.parent, "BW MBps = %6lu, period = %u\n", mbps, us);
	trace_bw_hwmon_meas(dev_name(hw->df->dev.parent),
				mbps,
				us,
				0);

	return mbps;
}
@@ -141,6 +146,11 @@ static void compute_bw(struct hwmon_node *node, int mbps,
	if (ab)
		*ab = roundup(new_bw, node->bw_step);
	*freq = (new_bw * 100) / node->io_percent;
	trace_bw_hwmon_update(dev_name(node->hw->df->dev.parent),
				new_bw,
				*freq,
				0,
				0);
}

static struct hwmon_node *find_hwmon_node(struct devfreq *df)