From: Steven Rostedt <rostedt@goodmis.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: linux-pm@vger.kernel.org, javi.merino@kernel.org,
rui.zhang@intel.com, edubezval@gmail.com,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 2/2] trace: power allocator: add trace for divvyup algorithm
Date: Mon, 8 May 2017 09:44:32 -0400 [thread overview]
Message-ID: <20170508094432.1010ee75@gandalf.local.home> (raw)
In-Reply-To: <1494250802-6663-3-git-send-email-lukasz.luba@arm.com>
On Mon, 8 May 2017 14:40:02 +0100
Lukasz Luba <lukasz.luba@arm.com> wrote:
> This trace function helps to figure out the divvyup algorithm
> on some platforms.
>
> CC: Steven Rostedt <rostedt@goodmis.org>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: Zhang Rui <rui.zhang@intel.com>
> CC: Eduardo Valentin <edubezval@gmail.com>
> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
> ---
> drivers/thermal/power_allocator.c | 4 +++
> include/trace/events/thermal_power_allocator.h | 40 ++++++++++++++++++++++++++
> 2 files changed, 44 insertions(+)
>
> diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c
> index db74e05..b71125a 100644
> --- a/drivers/thermal/power_allocator.c
> +++ b/drivers/thermal/power_allocator.c
> @@ -331,6 +331,10 @@ static void siblings_grants(struct thermal_zone_device *tz,
> total_avail_room += avail_room[i];
> }
>
> + trace_thermal_power_allocator_divvyup(tz, granted_power, avail_room,
> + spare_power, max_power,
> + num_actors);
I'm curious, how big can "num_actors" be?
-- Steve
> +
> /* Share the extra power inside the same family. */
> for (i = 0; i < num_actors; i++) {
> u32 power;
> diff --git a/include/trace/events/thermal_power_allocator.h b/include/trace/events/thermal_power_allocator.h
> index 5afae8f..03f224b 100644
> --- a/include/trace/events/thermal_power_allocator.h
> +++ b/include/trace/events/thermal_power_allocator.h
> @@ -54,6 +54,46 @@
> __entry->delta_temp)
> );
>
> +TRACE_EVENT(thermal_power_allocator_divvyup,
> + TP_PROTO(struct thermal_zone_device *tz, u32 *granted_power,
> + u32 *avail_room, u32 *spare_power, u32 *max_power,
> + size_t num_actors),
> + TP_ARGS(tz, granted_power, avail_room, spare_power, max_power,
> + num_actors),
> + TP_STRUCT__entry(
> + __field(int, tz_id)
> + __dynamic_array(u32, granted_power, num_actors)
> + __dynamic_array(u32, avail_room, num_actors)
> + __dynamic_array(u32, spare_power, num_actors)
> + __dynamic_array(u32, max_power, num_actors)
> + __field(size_t, num_actors)
> + ),
> + TP_fast_assign(
> + __entry->tz_id = tz->id;
> + memcpy(__get_dynamic_array(granted_power), granted_power,
> + num_actors * sizeof(*granted_power));
> + memcpy(__get_dynamic_array(avail_room), avail_room,
> + num_actors * sizeof(*avail_room));
> + memcpy(__get_dynamic_array(spare_power), spare_power,
> + num_actors * sizeof(*spare_power));
> + memcpy(__get_dynamic_array(max_power), max_power,
> + num_actors * sizeof(*max_power));
> + __entry->num_actors = num_actors;
> + ),
> +
> + TP_printk("thermal_zone_id=%d granted_power={%s} avail_room={%s} spare_power={%s} max_power={%s}",
> + __entry->tz_id,
> + __print_array(__get_dynamic_array(granted_power),
> + __entry->num_actors, 4),
> + __print_array(__get_dynamic_array(avail_room),
> + __entry->num_actors, 4),
> + __print_array(__get_dynamic_array(spare_power),
> + __entry->num_actors, 4),
> + __print_array(__get_dynamic_array(max_power),
> + __entry->num_actors, 4)
> + )
> +);
> +
> TRACE_EVENT(thermal_power_allocator_pid,
> TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
> s64 p, s64 i, s64 d, s32 output),
next prev parent reply other threads:[~2017-05-08 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 13:40 [PATCH 0/2] thermal: power allocator: add new divvy-up algorithm Lukasz Luba
2017-05-08 13:40 ` [PATCH 1/2] thermal: IPA: " Lukasz Luba
2017-05-09 9:43 ` kbuild test robot
2017-05-09 14:10 ` kbuild test robot
2017-05-08 13:40 ` [PATCH 2/2] trace: power allocator: add trace for divvyup algorithm Lukasz Luba
2017-05-08 13:44 ` Steven Rostedt [this message]
2017-05-08 14:21 ` Lukasz Luba
2017-05-08 14:37 ` Steven Rostedt
2017-05-08 14:58 ` Lukasz Luba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170508094432.1010ee75@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=mingo@redhat.com \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).