From 60e573d0d373f5f4f277221932e4a09bc55e776a Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Mon, 19 Mar 2018 09:42:28 +0900 Subject: [PATCH] [COMMON] thermal: cpu_cooling: Supplement trace_event Change-Id: Ib63da66156be68c830e8a7a7d17f40c3808d9d1c Signed-off-by: Hyeonseong Gil --- drivers/thermal/cpu_cooling.c | 4 ++-- include/trace/events/thermal.h | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 715bf0b934ec..ed3eac58651d 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -700,7 +700,7 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev, } if (load_cpu) { - trace_thermal_power_cpu_get_power(policy->related_cpus, freq, + trace_thermal_power_cpu_get_power(tz->id, policy->related_cpus, freq, load_cpu, i, dynamic_power, static_power); @@ -808,7 +808,7 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev, } *state = get_level(cpufreq_cdev, target_freq); - trace_thermal_power_cpu_limit(policy->related_cpus, target_freq, *state, + trace_thermal_power_cpu_limit(tz->id, policy->related_cpus, target_freq, *state, power); return 0; } diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h index 8e1102d43cdc..c7be5867d72f 100644 --- a/include/trace/events/thermal.h +++ b/include/trace/events/thermal.h @@ -92,12 +92,13 @@ TRACE_EVENT(thermal_zone_trip, ); TRACE_EVENT(thermal_power_cpu_get_power, - TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load, + TP_PROTO(int tzid, const struct cpumask *cpus, unsigned long freq, u32 *load, size_t load_len, u32 dynamic_power, u32 static_power), - TP_ARGS(cpus, freq, load, load_len, dynamic_power, static_power), + TP_ARGS(tzid, cpus, freq, load, load_len, dynamic_power, static_power), TP_STRUCT__entry( + __field(int, tzid) __bitmask(cpumask, num_possible_cpus()) __field(unsigned long, freq ) __dynamic_array(u32, load, load_len) @@ -107,6 +108,7 @@ TRACE_EVENT(thermal_power_cpu_get_power, ), TP_fast_assign( + __entry->tzid = tzid; __assign_bitmask(cpumask, cpumask_bits(cpus), num_possible_cpus()); __entry->freq = freq; @@ -117,19 +119,20 @@ TRACE_EVENT(thermal_power_cpu_get_power, __entry->static_power = static_power; ), - TP_printk("cpus=%s freq=%lu load={%s} dynamic_power=%d static_power=%d", - __get_bitmask(cpumask), __entry->freq, + TP_printk("thermal_zone_id=%d cpus=%s freq=%lu load={%s} dynamic_power=%d static_power=%d", + __entry->tzid, __get_bitmask(cpumask), __entry->freq, __print_array(__get_dynamic_array(load), __entry->load_len, 4), __entry->dynamic_power, __entry->static_power) ); TRACE_EVENT(thermal_power_cpu_limit, - TP_PROTO(const struct cpumask *cpus, unsigned int freq, + TP_PROTO(int tzid, const struct cpumask *cpus, unsigned int freq, unsigned long cdev_state, u32 power), - TP_ARGS(cpus, freq, cdev_state, power), + TP_ARGS(tzid, cpus, freq, cdev_state, power), TP_STRUCT__entry( + __field(int, tzid) __bitmask(cpumask, num_possible_cpus()) __field(unsigned int, freq ) __field(unsigned long, cdev_state) @@ -137,6 +140,7 @@ TRACE_EVENT(thermal_power_cpu_limit, ), TP_fast_assign( + __entry->tzid = tzid; __assign_bitmask(cpumask, cpumask_bits(cpus), num_possible_cpus()); __entry->freq = freq; @@ -144,8 +148,8 @@ TRACE_EVENT(thermal_power_cpu_limit, __entry->power = power; ), - TP_printk("cpus=%s freq=%u cdev_state=%lu power=%u", - __get_bitmask(cpumask), __entry->freq, __entry->cdev_state, + TP_printk("thermal_zone_id=%d cpus=%s freq=%u cdev_state=%lu power=%u", + __entry->tzid, __get_bitmask(cpumask), __entry->freq, __entry->cdev_state, __entry->power) ); -- 2.20.1