Skip to contentSkip to conversation

overlay/intel-gpu-overlay Fix power consumption not being displayed

PATCH In review Marius Vlad 2 participants 4 messages Nov 18, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 overlay/intel-gpu-overlay Fix power consumption not being displayed

The power metter was not showing up due to a check over I915_PERF_ENERGY. ENOENT is returned when I915_PERF_ENERGY is not available, and we use that for relaying on debugfs i915_energy_uJ.

---
 overlay/power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
overlay/power.c +2 -2
index 6c5c374..6873e7f 100644
@@ -60,7 +60,7 @@ int power_init(struct power *power)
 	memset(power, 0, sizeof(*power));
 
 	power->fd = perf_open();
-	if (power->fd != -1)
+	if (power->fd != -ENOENT)
 		return 0;
 
 	sprintf(buf, "%s/i915_energy_uJ", debugfs_dri_path);
@@ -121,7 +121,7 @@ int power_update(struct power *power)
 	if (power->error)
 		return power->error;
 
-	if (power->fd != -1) {
+	if (power->fd != -ENOENT) {
 		uint64_t data[2];
 		int len;
 
Signature · 6 lines
2.6.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 14 lines · Marius Vlad

The power metter was not showing up due to a check over I915_PERF_ENERGY. ENOENT is returned when I915_PERF_ENERGY is not available, and we use that for relaying on debugfs i915_energy_uJ.

---
 overlay/power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
overlay/power.c +0 -0
index 6c5c374..6873e7f 100644

overlay/power.c int power_init(struct power *power) · line 63

Quoted 5 lines
overlay/power.c +1 -1
@@ -60,7 +60,7 @@ int power_init(struct power *power)
 	memset(power, 0, sizeof(*power));
 
 	power->fd = perf_open();
-	if (power->fd != -1)
+	if (power->fd != -ENOENT)

Nope. The bug is

overlay/power.c +1 -1
index 6c5c374..2f1521b 100644
@@ -45,7 +45,7 @@ static int perf_open(void)
 
        attr.type = i915_type_id();
        if (attr.type == 0)
-               return -ENOENT;
+               return -1;
        attr.config = I915_PERF_ENERGY;
 
        attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED;

and the more pressing concern is that we still don't have support for the more accurate tracking from the kernel.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Just trying to figure out what we have currently. I can redo with with -1, if that's OK with you.

Out of curiosity noticed that I915_PERF_ENERGY is not available on my machine, is that related to i915_oa? (Haswell).

-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, November 18, 2015 2:45 PM
To: Vlad, Marius C <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [Intel-gfx] [PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed

Quoted 14 lines · Marius Vlad

The power metter was not showing up due to a check over I915_PERF_ENERGY. ENOENT is returned when I915_PERF_ENERGY is not available, and we use that for relaying on debugfs i915_energy_uJ.

---
 overlay/power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
overlay/power.c index 6c5c374..6873e7f renamed from overlay/power.c +0 -0

100644

overlay/power.c int power_init(struct power *power) · line 63

Quoted 5 lines
overlay/power.c +1 -1
@@ -60,7 +60,7 @@ int power_init(struct power *power)
 	memset(power, 0, sizeof(*power));
 
 	power->fd = perf_open();
-	if (power->fd != -1)
+	if (power->fd != -ENOENT)

Nope. The bug is

overlay/power.c +1 -1
@@ -45,7 +45,7 @@ static int perf_open(void)
 
        attr.type = i915_type_id();
        if (attr.type == 0)
-               return -ENOENT;
+               return -1;
        attr.config = I915_PERF_ENERGY;
 
        attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED;

and the more pressing concern is that we still don't have support for the more accurate tracking from the kernel. -Chris

--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 2 lines · Marius C

Just trying to figure out what we have currently. I can redo with with -1, if that's OK with you.

Already pushed.

Quoted 2 lines

Out of curiosity noticed that I915_PERF_ENERGY is not available on my machine, is that related to i915_oa? (Haswell).

Kind off (except that i915_oa itself doesn't try to implement the generic load/client tracking).
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx