summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorTimo Alho <talho@nvidia.com>2013-10-25 23:49:49 +0300
committerJuha Tukkinen <jtukkinen@nvidia.com>2013-10-28 07:46:53 -0700
commit7f54fbd16212785b346ad959364c674f26deaece (patch)
tree7f681602d3d59e62193172b34ae175cf18587128 /include/trace
parent2f86343c877ef70ffa0a58e3fd90e3f0b8add83c (diff)
EDP: introduce revised system-EDP framework
This patch introduces a revised system-EDP software framework. Framework consist of following components: * sysedp - central component handling of the book keeping of consumer power consumptions * sysedp_batmon - periodically monitors the state of battery and updates the available budget (in mW) to sysedp framework * sysedp_dynamic_capping - limits the CPU, GPU, and EMC frequencies to ensure that system will operate in the given budget. * sysedp_consumer - A device in the platform that has noticeable peak power consumption is called sysedp consumer. Consumers register themselves to the sysedp framework and inform sysedp when there is a change in their power state Change-Id: I343d8f09082216744da41abe5e749b15cb20417a Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: http://git-master/r/304006 GVS: Gerrit_Virtual_Submit Reviewed-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/sysedp.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/trace/events/sysedp.h b/include/trace/events/sysedp.h
new file mode 100644
index 000000000000..511eea50ed02
--- /dev/null
+++ b/include/trace/events/sysedp.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM sysedp
+
+#if !defined(_TRACE_SYSEDP_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SYSEDP_H
+
+#include <linux/string.h>
+#include <linux/sysedp.h>
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(sysedp_change_state,
+
+ TP_PROTO(const char *name, unsigned int old, unsigned int new),
+
+ TP_ARGS(name, old, new),
+
+ TP_STRUCT__entry(
+ __array(char, name, SYSEDP_NAME_LEN)
+ __field(unsigned int, old)
+ __field(unsigned int, new)
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->name, name, SYSEDP_NAME_LEN);
+ __entry->old = old;
+ __entry->new = new;
+ ),
+
+ TP_printk("%s: %u -> %u", __entry->name,
+ __entry->old, __entry->new)
+ );
+
+TRACE_EVENT(sysedp_set_avail_budget,
+
+ TP_PROTO(unsigned int old, unsigned int new),
+
+ TP_ARGS(old, new),
+
+ TP_STRUCT__entry(
+ __field(unsigned int, old)
+ __field(unsigned int, new)
+ ),
+
+ TP_fast_assign(
+ __entry->old = old;
+ __entry->new = new;
+ ),
+
+ TP_printk("%umW -> %umW", __entry->old, __entry->new)
+ );
+
+#endif /* _TRACE_SYSEDP_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>