public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org
Subject: hwmon: trace event support?
Date: Wed, 3 Oct 2018 16:46:58 -0700	[thread overview]
Message-ID: <20181003234657.GA32550@Asurada-Nvidia.nvidia.com> (raw)

Hello Guenter,

I am thinking about a possibility of adding a trace event support
in hwmon subsystem. Ftrace is pretty useful and widely applied to
different subsystems already while hwmon doesn't seem to have one
yet. I know some power/perf folks who rely on the trace events to
analyse relationships among cpufreq <-> thermal <-> power: usually
what they do is enabling trace events, then letting the system run
for a while, and finally collecting all data from Ftrace outputs.

Both cpufreq and thermal have trace events; but for power data, it
seems that they have to go through sysfs nodes, which is difficult
for them to get data at the same timestamps corresponding to those
Ftrace data. Similar to tz->poll_queue in thermal_core, hwmon core
could also have a work queue polling the registered sensor inputs
(by default disabled; enabled only if users configure poll_delay)
so that the power data can be generated to Ftrace outputs as well.

To add this, the hwmon core needs an interface that can get sensor
inputs as drivers like ina3221 don't report any values back to the
core but directly expose them via sysfs ABI nodes.

I noticed the hwmon_device_register_with_info() could be actually
a good API to use since it has defined different sensor types and
more importantly the ops->read() interface, but the ina3221 driver
is very compact that there would be very little gain from this API
at this moment. However, maybe having trace event support would be
a good reason to apply this API.

What do you think about it? Any concern or better solution?

Thank you
Nicolin

             reply	other threads:[~2018-10-03 23:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 23:46 Nicolin Chen [this message]
2018-10-04  0:42 ` hwmon: trace event support? Guenter Roeck
2018-10-04  5:08   ` Nicolin Chen
2018-10-04 16:48     ` Guenter Roeck
2018-10-04 18:58       ` Nicolin Chen
2018-10-04 20:02         ` Guenter Roeck

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=20181003234657.GA32550@Asurada-Nvidia.nvidia.com \
    --to=nicoleotsuka@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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