All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] tools lib traceevent: bitmask handling and plugin updates
@ 2014-06-03  3:20 Steven Rostedt
  2014-06-03  3:20 ` [PATCH v2 1/4] tools lib traceevent: Add flag to not load event plugins Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 48+ messages in thread
From: Steven Rostedt @ 2014-06-03  3:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Ingo Molnar, Andrew Morton

This is v2 of the patch series that added __get_bitmask() as well as
added some plugin code. This version addresses what Namhyung suggested.
The diff from v1 is posted below.

Steven Rostedt (Red Hat) (4):
      tools lib traceevent: Add flag to not load event plugins
      tools lib traceevent: Add options to plugins
      tools lib traceevent: Add options to function plugin
      tools lib traceevent: Added support for __get_bitmask() macro

----
 tools/lib/traceevent/event-parse.c                 | 113 ++++++++++++
 tools/lib/traceevent/event-parse.h                 |  25 ++-
 tools/lib/traceevent/event-plugin.c                | 204 ++++++++++++++++++++-
 tools/lib/traceevent/plugin_function.c             |  43 ++++-
 .../perf/util/scripting-engines/trace-event-perl.c |   1 +
 .../util/scripting-engines/trace-event-python.c    |   1 +
 6 files changed, 377 insertions(+), 10 deletions(-)


diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 2d6aa92..93825a1 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3794,7 +3794,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			f = pevent_find_any_field(event, arg->bitmask.bitmask);
 			arg->bitmask.offset = f->offset;
 		}
-		bitmask_offset = data2host4(pevent, data + arg->string.offset);
+		bitmask_offset = data2host4(pevent, data + arg->bitmask.offset);
 		bitmask_size = bitmask_offset >> 16;
 		bitmask_offset &= 0xffff;
 		print_bitmask_to_seq(pevent, s, format, len_arg,
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 025627f..7a3873f 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -362,7 +362,7 @@ enum pevent_func_arg_type {
 enum pevent_flag {
 	PEVENT_NSEC_OUTPUT		= 1,	/* output in NSECS */
 	PEVENT_DISABLE_SYS_PLUGINS	= 1 << 1,
-	PEVENT_DISABLE_PLUGINS		= 1 << 2
+	PEVENT_DISABLE_PLUGINS		= 1 << 2,
 };
 
 #define PEVENT_ERRORS 							      \
@@ -419,6 +419,8 @@ enum pevent_errno {
 
 struct plugin_list;
 
+#define INVALID_PLUGIN_LIST_OPTION	((char **)((unsigned long)-1))
+
 struct plugin_list *traceevent_load_plugins(struct pevent *pevent);
 void traceevent_unload_plugins(struct plugin_list *plugin_list,
 			       struct pevent *pevent);
diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c
index a244794..648ef84 100644
--- a/tools/lib/traceevent/event-plugin.c
+++ b/tools/lib/traceevent/event-plugin.c
@@ -57,7 +57,7 @@ struct plugin_list {
  * used by toggling the option.
  *
  * Returns NULL if there's no options registered. On error it returns
- * an (char **)-1 (must check for that)
+ * INVALID_PLUGIN_LIST_OPTION
  *
  * Must be freed with traceevent_plugin_free_options_list().
  */
@@ -72,6 +72,7 @@ char **traceevent_plugin_list_options(void)
 	for (reg = registered_options; reg; reg = reg->next) {
 		for (op = reg->options; op->name; op++) {
 			char *alias = op->plugin_alias ? op->plugin_alias : op->file;
+			char **temp = list;
 
 			name = malloc(strlen(op->name) + strlen(alias) + 2);
 			if (!name)
@@ -80,6 +81,7 @@ char **traceevent_plugin_list_options(void)
 			sprintf(name, "%s:%s", alias, op->name);
 			list = realloc(list, count + 2);
 			if (!list) {
+				list = temp;
 				free(name);
 				goto err;
 			}
@@ -87,16 +89,14 @@ char **traceevent_plugin_list_options(void)
 			list[count] = NULL;
 		}
 	}
-	if (!count)
-		return NULL;
 	return list;
 
  err:
-	while (--count > 0)
+	while (--count >= 0)
 		free(list[count]);
 	free(list);
 
-	return (char **)((unsigned long)-1);
+	return INVALID_PLUGIN_LIST_OPTION;
 }
 
 void traceevent_plugin_free_options_list(char **list)

^ permalink raw reply related	[flat|nested] 48+ messages in thread
* [RFC PATCH 0/5] The power allocator thermal governor
@ 2014-05-06 12:06 Javi Merino
  2014-05-06 12:06 ` [RFC PATCH 1/5] thermal: let governors have private data for each thermal zone Javi Merino
                   ` (5 more replies)
  0 siblings, 6 replies; 48+ messages in thread
From: Javi Merino @ 2014-05-06 12:06 UTC (permalink / raw)
  To: linux-pm; +Cc: Punit.Agrawal, Javi Merino

Hi,

This RFC is our first stab at implementing the ideas we proposed in
[1].  The power allocator governor allocates device power to control
temperature.  This requires transforming performance requests into
requested power, which we do with the aid of power models.  Patch 3
(thermal: add a basic cpu power actor) implements a simple power model
for cpus.  The division of power between the actors ensures that power
is allocated where it is needed the most, based on the current
workload.

[1] http://article.gmane.org/gmane.linux.power-management.general/43243

Patches 1 and 2 were previously sent as separate patches: [2] and
[3]. There was a similar patch to "thermal: provide a way for the
governors to have private data for each thermal zone" posted by Wei Ni
but we can't use it as it is because it doesn't allow the governor's
bind() function (start() in Wei's patch) to modify the governor_data.
Other than that, this patch incorporates Rui's suggestion of keeping
the original governor if the new governor fails to bind.

[2] http://article.gmane.org/gmane.linux.power-management.general/43624
[3] https://patchwork.kernel.org/patch/3859721/

It's an RFC because we still need to tune it to achieve the
temperature stability that we are aiming for.  This RFC is just meant
to remove major road blocks as early as possible (if any).

We'll provide integration instructions soon so that people can test it
in their platforms.

Cheers,
Javi & Punit

Javi Merino (5):
  thermal: let governors have private data for each thermal zone
  thermal: let cooling devices operate on other units other than state
  thermal: add a basic cpu power actor
  thermal: introduce the Power Allocator governor
  thermal: add trace events to the power allocator governor

 drivers/acpi/fan.c                      |   22 +-
 drivers/acpi/processor_thermal.c        |   23 +-
 drivers/acpi/video.c                    |   22 +-
 drivers/platform/x86/acerhdf.c          |   24 +-
 drivers/platform/x86/intel_menlow.c     |   26 +-
 drivers/power/power_supply_core.c       |   24 +-
 drivers/thermal/Kconfig                 |   14 +
 drivers/thermal/Makefile                |    1 +
 drivers/thermal/cpu_cooling.c           |  427 +++++++++++++++++++++++++++++--
 drivers/thermal/db8500_thermal.c        |    2 +-
 drivers/thermal/fair_share.c            |    2 +-
 drivers/thermal/intel_powerclamp.c      |   24 +-
 drivers/thermal/power_allocator.c       |  413 ++++++++++++++++++++++++++++++
 drivers/thermal/step_wise.c             |    2 +-
 drivers/thermal/thermal_core.c          |   91 +++++--
 drivers/thermal/thermal_core.h          |    8 +
 include/linux/cpu_cooling.h             |   28 ++
 include/linux/thermal.h                 |   25 +-
 include/trace/events/thermal.h          |   34 +++
 include/trace/events/thermal_governor.h |   35 +++
 20 files changed, 1153 insertions(+), 94 deletions(-)
 create mode 100644 drivers/thermal/power_allocator.c
 create mode 100644 include/trace/events/thermal.h
 create mode 100644 include/trace/events/thermal_governor.h

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2014-06-12 12:06 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-03  3:20 [PATCH v2 0/4] tools lib traceevent: bitmask handling and plugin updates Steven Rostedt
2014-06-03  3:20 ` [PATCH v2 1/4] tools lib traceevent: Add flag to not load event plugins Steven Rostedt
2014-06-12 12:00   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2014-06-03  3:20 ` [PATCH v2 2/4] tools lib traceevent: Add options to plugins Steven Rostedt
2014-06-03  6:51   ` Namhyung Kim
2014-06-03 22:41     ` [PATCH v3 " Steven Rostedt
2014-06-03 22:43       ` Steven Rostedt
2014-06-04  9:33         ` Jiri Olsa
2014-06-12 12:00       ` [tip:perf/core] " tip-bot for Steven Rostedt
2014-06-04 11:42     ` [PATCH v2 2/4] " Jiri Olsa
2014-06-04 14:00       ` Namhyung Kim
2014-06-03  3:20 ` [PATCH v2 3/4] tools lib traceevent: Add options to function plugin Steven Rostedt
2014-06-12 12:00   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2014-06-03  3:20 ` [PATCH v2 4/4] tools lib traceevent: Added support for __get_bitmask() macro Steven Rostedt
2014-06-12 12:01   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
  -- strict thread matches above, loose matches on Subject: below --
2014-05-06 12:06 [RFC PATCH 0/5] The power allocator thermal governor Javi Merino
2014-05-06 12:06 ` [RFC PATCH 1/5] thermal: let governors have private data for each thermal zone Javi Merino
2014-05-13 14:31   ` edubezval
2014-05-15 14:30     ` Javi Merino
2014-05-15 15:10       ` Eduardo Valentin
2014-05-06 12:06 ` [RFC PATCH 2/5] thermal: let cooling devices operate on other units other than state Javi Merino
2014-05-13 15:22   ` edubezval
2014-05-06 12:06 ` [RFC PATCH 3/5] thermal: add a basic cpu power actor Javi Merino
2014-05-13 22:57   ` Eduardo Valentin
2014-05-15 17:02     ` Javi Merino
2014-05-06 12:06 ` [RFC PATCH 4/5] thermal: introduce the Power Allocator governor Javi Merino
2014-05-13 23:20   ` Eduardo Valentin
2014-05-15 18:24     ` Javi Merino
2014-05-22 14:26       ` Eduardo Valentin
2014-05-06 12:06 ` [RFC PATCH 5/5] thermal: add trace events to the power allocator governor Javi Merino
2014-05-06 12:28   ` Steven Rostedt
2014-05-06 17:22   ` [RFC][PATCH] tracing: Add __cpumask() macro to trace events to record cpumasks Steven Rostedt
2014-05-06 19:16     ` Mathieu Desnoyers
2014-05-06 19:30       ` Steven Rostedt
2014-05-07  3:12       ` [RFC][PATCH v2] tracing: Add __bitmask() macro to trace events to cpumasks and other bitmasks Steven Rostedt
2014-05-07 11:40         ` Mathieu Desnoyers
2014-05-07 15:45           ` Steven Rostedt
2014-05-14 14:23         ` Javi Merino
2014-05-14 15:36           ` Steven Rostedt
2014-05-14 15:50             ` Javi Merino
2014-05-14 16:07               ` Steven Rostedt
2014-05-14 18:25               ` [RFC][PATCH v3] " Steven Rostedt
2014-05-14 19:42                 ` Javi Merino
2014-05-14 20:00                   ` Steven Rostedt
2014-05-15 11:34                   ` Steven Rostedt
2014-05-15 11:36                     ` Steven Rostedt
2014-05-15 15:20                       ` Javi Merino
2014-05-14 10:05 ` [RFC PATCH 0/5] The power allocator thermal governor James King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.