summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/devfreq/governor_cache_hwmon.c11
-rw-r--r--include/trace/events/power.h43
2 files changed, 48 insertions, 6 deletions
diff --git a/drivers/devfreq/governor_cache_hwmon.c b/drivers/devfreq/governor_cache_hwmon.c
index 9973aeac4679..a2167e011a3d 100644
--- a/drivers/devfreq/governor_cache_hwmon.c
+++ b/drivers/devfreq/governor_cache_hwmon.c
@@ -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_cache_hwmon.h"
@@ -134,12 +135,9 @@ static unsigned long measure_mrps_and_set_irq(struct cache_hwmon_node *node,
preempt_enable();
- dev_dbg(hw->df->dev.parent,
- "stat H=%3lu, M=%3lu, L=%3lu, T=%3lu, b=%3u, f=%4lu, us=%d\n",
- stat->mrps[HIGH], stat->mrps[MED], stat->mrps[LOW],
- stat->mrps[HIGH] + stat->mrps[MED] + stat->mrps[LOW],
- stat->busy_percent, hw->df->previous_freq / 1000, us);
-
+ trace_cache_hwmon_meas(dev_name(hw->df->dev.parent), stat->mrps[HIGH],
+ stat->mrps[MED], stat->mrps[LOW],
+ stat->busy_percent, us);
return 0;
}
@@ -168,6 +166,7 @@ static void compute_cache_freq(struct cache_hwmon_node *node,
new_mhz += node->guard_band_mhz;
*freq = new_mhz * 1000;
+ trace_cache_hwmon_update(dev_name(node->hw->df->dev.parent), *freq);
}
#define TOO_SOON_US (1 * USEC_PER_MSEC)
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index d6d8f5390647..5610ba0c892c 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -654,6 +654,49 @@ TRACE_EVENT(bw_hwmon_update,
__entry->down_thres)
);
+TRACE_EVENT(cache_hwmon_meas,
+ TP_PROTO(const char *name, unsigned long high_mrps,
+ unsigned long med_mrps, unsigned long low_mrps,
+ unsigned int busy_percent, unsigned int us),
+ TP_ARGS(name, high_mrps, med_mrps, low_mrps, busy_percent, us),
+ TP_STRUCT__entry(
+ __string(name, name)
+ __field(unsigned long, high_mrps)
+ __field(unsigned long, med_mrps)
+ __field(unsigned long, low_mrps)
+ __field(unsigned long, total_mrps)
+ __field(unsigned int, busy_percent)
+ __field(unsigned int, us)
+ ),
+ TP_fast_assign(
+ __assign_str(name, name);
+ __entry->high_mrps = high_mrps;
+ __entry->med_mrps = med_mrps;
+ __entry->low_mrps = low_mrps;
+ __entry->total_mrps = high_mrps + med_mrps + low_mrps;
+ __entry->busy_percent = busy_percent;
+ __entry->us = us;
+ ),
+ TP_printk("dev=%s H=%lu M=%lu L=%lu T=%lu busy_pct=%u period=%u",
+ __get_str(name), __entry->high_mrps, __entry->med_mrps,
+ __entry->low_mrps, __entry->total_mrps,
+ __entry->busy_percent, __entry->us)
+);
+
+TRACE_EVENT(cache_hwmon_update,
+ TP_PROTO(const char *name, unsigned long freq_mhz),
+ TP_ARGS(name, freq_mhz),
+ TP_STRUCT__entry(
+ __string(name, name)
+ __field(unsigned long, freq)
+ ),
+ TP_fast_assign(
+ __assign_str(name, name);
+ __entry->freq = freq_mhz;
+ ),
+ TP_printk("dev=%s freq=%lu", __get_str(name), __entry->freq)
+);
+
#endif /* _TRACE_POWER_H */
/* This part must be outside protection */