[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1550010238-24002-8-git-send-email-l.luba@partner.samsung.com>
Date: Tue, 12 Feb 2019 23:23:58 +0100
From: Lukasz Luba <l.luba@...tner.samsung.com>
To: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Cc: b.zolnierkie@...sung.com, myungjoo.ham@...sung.com,
cw00.choi@...sung.com, kyungmin.park@...sung.com,
m.szyprowski@...sung.com, s.nawrocki@...sung.com, tkjos@...gle.com,
joel@...lfernandes.org, chris.diamand@....com, mka@...omium.org,
rostedt@...dmis.org, mingo@...hat.com,
Lukasz Luba <l.luba@...tner.samsung.com>
Subject: [PATCH v3 7/7] drivers: devfreq: add tracing for scheduling work
This patch add basic tracing of the devfreq workqueue and delayed work.
It aims to capture changes of the polling intervals and device state.
Signed-off-by: Lukasz Luba <l.luba@...tner.samsung.com>
---
drivers/devfreq/devfreq.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 29e99ce..c1d0d8c 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -29,6 +29,9 @@
#include <linux/of.h>
#include "governor.h"
+#define CREATE_TRACE_POINTS
+#include <trace/events/devfreq.h>
+
/* The ~30% load threshold used for load calculation (due to fixed point
* arithmetic) */
#define LOAD_THRESHOLD_IN_DEVICE_USAGE (300)
@@ -418,6 +421,7 @@ static void devfreq_monitor(struct work_struct *work)
struct devfreq *devfreq = container_of(work,
struct devfreq, work.work);
unsigned int polling_ms;
+ const char *df_name = dev_name(&devfreq->dev);
mutex_lock(&devfreq->lock);
polling_ms = devfreq_get_polling_delay(devfreq);
@@ -429,6 +433,10 @@ static void devfreq_monitor(struct work_struct *work)
schedule_delayed_work(&devfreq->work,
msecs_to_jiffies(polling_ms));
mutex_unlock(&devfreq->lock);
+
+ trace_devfreq_monitor(df_name, devfreq->previous_freq, polling_ms,
+ devfreq->last_status.busy_time,
+ devfreq->last_status.total_time);
}
/**
--
2.7.4
Powered by blists - more mailing lists