[Bug,105712] intel-gpu-overlay is showing insane power consumption amounts
diff mbox

Message ID bug-105712-502-e950BspeMt@http.bugs.freedesktop.org/
State New
Headers show

Commit Message

bugzilla-daemon@freedesktop.org March 23, 2018, 9:18 p.m. UTC
https://bugs.freedesktop.org/show_bug.cgi?id=105712

--- Comment #5 from Chris Wilson <chris@chris-wilson.co.uk> ---
Add a couple of printfs,

                        power->rapl_scale *= 1e3; /* from nano to micro */

and run with -f (so that it doesn't detach and we can see the output).

Patch
diff mbox

diff --git a/overlay/power.c b/overlay/power.c
index 9ac90fde..e6ac728a 100644
--- a/overlay/power.c
+++ b/overlay/power.c
@@ -117,8 +117,12 @@  int power_init(struct power *power)
        memset(power, 0, sizeof(*power));

        power->fd = igt_perf_open(rapl_type_id(), rapl_gpu_power());
+       fprintf(stderr, "rapl_type_id()=%"PRIx64",
rapl_gpu_power()=%"PRIx64"\n",
+               rapl_type_id(), rapl_gpu_power());
        if (power->fd >= 0) {
                power->rapl_scale = rapl_gpu_power_scale();
+               fprintf(stderr, "rapl_gpu_power_scale()=%f\n",
+                       rapl_gpu_power_scale());

                if (power->rapl_scale != NAN) {