hwmon: (core) Add trace events to _attr_show/store functions
authorNicolin Chen <nicoleotsuka@gmail.com>
Tue, 9 Oct 2018 21:42:19 +0000 (14:42 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 12 Oct 2018 03:07:35 +0000 (20:07 -0700)
commit61b8ab2c5481dc48e8df9a13c297636c1d369554
tree4d7f55698a4e0f458101a3e683719969c4af4f65
parentd4b0166d28a8966ab6938d8bb7360c383b519256
hwmon: (core) Add trace events to _attr_show/store functions

Trace events are useful for people who collect data from the
Ftrace outputs. There're people who analyse the relationship
of cpufreq, thermal and hwmon (power/voltage/current) using
the convenient and timestamped Ftrace outputs, while unlike
cpufreq and thermal subsystems the hwmon does not have trace
events supported yet.

So this patch adds initial trace events for the hwmon core.
To call hwmon_attr_base() for aligned attr index numbers, it
also moves the function upward.

Ftrace outputs:
 ...: hwmon_attr_show_string: index=2, attr_name=in2_label, val=VDD_5V
 ...: hwmon_attr_show: index=2, attr_name=in2_input, val=5112
 ...: hwmon_attr_show: index=2, attr_name=curr2_input, val=440

Note that the _attr_show and _attr_store functions are tied
to the _with_info API. So a hwmon driver requiring the trace
events feature should use _with_info API to register a hwmon
device.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
MAINTAINERS
drivers/hwmon/hwmon.c
include/trace/events/hwmon.h [new file with mode: 0644]