Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: igt-dev@lists.freedesktop.org, badal.nilawar@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v2 3/8] lib/igt_power: Add hwmon interface to igt_power
Date: Tue, 20 Sep 2022 12:57:29 -0700	[thread overview]
Message-ID: <87pmfpddjq.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20220919144408.251981-4-riana.tauro@intel.com>

On Mon, 19 Sep 2022 07:44:03 -0700, Riana Tauro wrote:
>
> Modify igt_power to expose functions to read energy, power
> using hwmon and rapl interface

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> +/**
> + * igt_power_get_mJ:
> + * @igt_power : power struct
> + * @power_sample: sample of energy and time
> + *
> + * Calculates energy difference between two power samples

Maybe quickly mention the units of energy here too, for hwmon it is micro
joules and rapl it's joules.

> + *
> + * Returns
> + * energy in mJ from hwmon/rapl
> + */
> +double igt_power_get_mJ(const struct igt_power *power,
> +			const struct power_sample *p0, const struct power_sample *p1)
> +{
> +	if (power->hwmon_fd >= 0)
> +		return (p1->energy - p0->energy) * 1e-3;
> +	else if (power->rapl.fd >= 0)
> +		return ((p1->energy - p0->energy) *  power->rapl.scale) * 1e3;
> +
> +	return 0;
> +}

  reply	other threads:[~2022-09-20 19:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 14:44 [igt-dev] [PATCH i-g-t v2 0/8] Add hwmon energy support for dgfx Riana Tauro
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 1/8] lib/igt_hwmon: Introduce library igt_hwmon Riana Tauro
2022-09-20 19:47   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 2/8] lib/igt_power: Rename lib igt_rapl with igt_power Riana Tauro
2022-09-20 19:48   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 3/8] lib/igt_power: Add hwmon interface to igt_power Riana Tauro
2022-09-20 19:57   ` Dixit, Ashutosh [this message]
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 4/8] i915/i915_pm_rc6_residency: Add energy support for dgfx Riana Tauro
2022-09-20 20:07   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 5/8] i915/gem_exec_schedule: " Riana Tauro
2022-09-20 20:16   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 6/8] i915/gem_exec_whisper: " Riana Tauro
2022-09-20 20:18   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 7/8] lib/igt_power: clean-up igt_power library Riana Tauro
2022-09-20 20:20   ` Dixit, Ashutosh
2022-09-19 14:44 ` [igt-dev] [PATCH i-g-t v2 8/8] HAX: run i915_pm_rc6_residency tests in BAT Riana Tauro
2022-09-19 17:44 ` [igt-dev] ✓ Fi.CI.BAT: success for Add hwmon energy support for dgfx (rev3) Patchwork
2022-09-19 22:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-27  5:54   ` Tauro, Riana
2022-09-27 15:51     ` Vudum, Lakshminarayana
2022-09-27 14:54 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

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=87pmfpddjq.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=riana.tauro@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