All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power
@ 2020-11-24 23:27 ` Chris Wilson
  0 siblings, 0 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-24 23:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

With integrated graphics the TDP is shared between the gpu and the cpu,
knowing the total energy consumed by the package is relevant to
understanding throttling.

v2: Tidy integration by eliminating struct rapl and improve output
formatting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 218 +++++++++++++++++++++++++-----------------
 1 file changed, 130 insertions(+), 88 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 86de09aa9..0a49cfecc 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -50,10 +50,12 @@ struct pmu_pair {
 };
 
 struct pmu_counter {
-	bool present;
+	uint64_t type;
 	uint64_t config;
 	unsigned int idx;
 	struct pmu_pair val;
+	double scale;
+	bool present;
 };
 
 struct engine {
@@ -79,8 +81,8 @@ struct engines {
 	struct pmu_pair ts;
 
 	int rapl_fd;
-	double rapl_scale;
-	const char *rapl_unit;
+	struct pmu_counter r_gpu, r_pkg;
+	unsigned int num_rapl;
 
 	int imc_fd;
 	double imc_reads_scale;
@@ -92,7 +94,6 @@ struct engines {
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter rapl;
 	struct pmu_counter imc_reads;
 	struct pmu_counter imc_writes;
 
@@ -108,6 +109,109 @@ struct engines {
 
 };
 
+__attribute__((format(scanf,3,4)))
+static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
+{
+	FILE *file;
+	int fd;
+	int ret = -1;
+
+	fd = openat(dir, attr, O_RDONLY);
+	if (fd < 0)
+		return -1;
+
+	file = fdopen(fd, "r");
+	if (file) {
+		va_list ap;
+
+		va_start(ap, fmt);
+		ret = vfscanf(file, fmt, ap);
+		va_end(ap);
+
+		fclose(file);
+	} else {
+		close(fd);
+	}
+
+	return ret;
+}
+
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	locale_t locale, oldlocale;
+	bool result = true;
+	char buf[128] = {};
+	int dir;
+
+	dir = open("/sys/devices/power", O_RDONLY);
+	if (dir < 0)
+		return -errno;
+
+	/* Replace user environment with plain C to match kernel format */
+	locale = newlocale(LC_ALL, "C", 0);
+	oldlocale = uselocale(locale);
+
+	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str);
+	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str);
+	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
+	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
+	    strcmp(buf, "Joules"))
+		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
+			str, buf);
+
+	uselocale(oldlocale);
+	freelocale(locale);
+
+	close(dir);
+
+	if (!result)
+		return -EINVAL;
+
+	if (isnan(pmu->scale) || !pmu->scale)
+		return -ERANGE;
+
+	return 0;
+}
+
+static void
+rapl_open(struct pmu_counter *pmu,
+	  const char *domain,
+	  struct engines *engines)
+{
+	int fd;
+
+	if (rapl_parse(pmu, domain) < 0)
+		return;
+
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->rapl_fd);
+	if (fd < 0)
+		return;
+
+	if (engines->rapl_fd == -1)
+		engines->rapl_fd = fd;
+
+	pmu->idx = engines->num_rapl++;
+	pmu->present = true;
+}
+
+static void gpu_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "gpu", engines);
+}
+
+static void pkg_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "pkg", engines);
+}
+
 static uint64_t
 get_pmu_config(int dirfd, const char *name, const char *counter)
 {
@@ -357,38 +461,6 @@ static double filename_to_double(const char *filename)
 	return v;
 }
 
-#define RAPL_ROOT "/sys/devices/power/"
-#define RAPL_EVENT "/sys/devices/power/events/"
-
-static uint64_t rapl_type_id(void)
-{
-	return filename_to_u64(RAPL_ROOT "type", 10);
-}
-
-static uint64_t rapl_gpu_power(void)
-{
-	return filename_to_u64(RAPL_EVENT "energy-gpu", 0);
-}
-
-static double rapl_gpu_power_scale(void)
-{
-	return filename_to_double(RAPL_EVENT "energy-gpu.scale");
-}
-
-static const char *rapl_gpu_power_unit(void)
-{
-	char buf[32];
-
-	if (filename_to_buf(RAPL_EVENT "energy-gpu.unit",
-			    buf, sizeof(buf)) == 0)
-		if (!strcmp(buf, "Joules"))
-			return strdup("Watts");
-		else
-			return strdup(buf);
-	else
-		return NULL;
-}
-
 #define IMC_ROOT "/sys/devices/uncore_imc/"
 #define IMC_EVENT "/sys/devices/uncore_imc/events/"
 
@@ -517,22 +589,9 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->rapl_fd = -1;
-	if (!engines->discrete && rapl_type_id()) {
-		engines->rapl_scale = rapl_gpu_power_scale();
-		engines->rapl_unit = rapl_gpu_power_unit();
-		if (!engines->rapl_unit)
-			return -1;
-
-		engines->rapl.config = rapl_gpu_power();
-		if (!engines->rapl.config)
-			return -1;
-
-		engines->rapl_fd = igt_perf_open(rapl_type_id(),
-						 engines->rapl.config);
-		if (engines->rapl_fd < 0)
-			return -1;
-
-		engines->rapl.present = true;
+	if (!engines->discrete) {
+		gpu_power_open(&engines->r_gpu, engines);
+		pkg_power_open(&engines->r_pkg, engines);
 	}
 
 	engines->imc_fd = -1;
@@ -614,25 +673,6 @@ static void fill_str(char *buf, unsigned int bufsz, char c, unsigned int num)
 	*buf = 0;
 }
 
-static uint64_t __pmu_read_single(int fd, uint64_t *ts)
-{
-	uint64_t data[2] = { };
-	ssize_t len;
-
-	len = read(fd, data, sizeof(data));
-	assert(len == sizeof(data));
-
-	if (ts)
-		*ts = data[1];
-
-	return data[0];
-}
-
-static uint64_t pmu_read_single(int fd)
-{
-	return __pmu_read_single(fd, NULL);
-}
-
 static void __update_sample(struct pmu_counter *counter, uint64_t val)
 {
 	counter->val.prev = counter->val.cur;
@@ -653,10 +693,6 @@ static void pmu_sample(struct engines *engines)
 
 	engines->ts.prev = engines->ts.cur;
 
-	if (engines->rapl_fd >= 0)
-		__update_sample(&engines->rapl,
-				pmu_read_single(engines->rapl_fd));
-
 	if (engines->imc_fd >= 0) {
 		pmu_read_multi(engines->imc_fd, 2, val);
 		update_sample(&engines->imc_reads, val);
@@ -677,6 +713,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engine->sema, val);
 		update_sample(&engine->wait, val);
 	}
+
+	if (engines->num_rapl) {
+		pmu_read_multi(engines->rapl_fd, engines->num_rapl, val);
+		update_sample(&engines->r_gpu, val);
+		update_sample(&engines->r_pkg, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1076,14 +1118,14 @@ print_header(const struct igt_device_card *card,
 		.items = rc6_items,
 	};
 	struct cnt_item power_items[] = {
-		{ &engines->rapl, 4, 2, 1.0, t, engines->rapl_scale, "value",
-		  "W" },
+		{ &engines->r_gpu, 4, 2, 1.0, t, engines->r_gpu.scale, "GPU", "gpu" },
+		{ &engines->r_pkg, 4, 2, 1.0, t, engines->r_pkg.scale, "Package", "pkg" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit", "W" },
 		{ },
 	};
 	struct cnt_group power_group = {
 		.name = "power",
-		.display_name = "Power",
+		.display_name = "Power W",
 		.items = power_items,
 	};
 	struct cnt_group *groups[] = {
@@ -1108,17 +1150,17 @@ print_header(const struct igt_device_card *card,
 
 		if (lines++ < con_h) {
 			printf("intel-gpu-top: %s - ", card->card);
-			if (!engines->discrete)
-				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, power_items[0].buf,
-					engines->rapl_unit,
-					irq_items[0].buf);
-			else
-				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, irq_items[0].buf);
+			printf("%s/%s MHz;  %s%% RC6; ",
+			       freq_items[1].buf, freq_items[0].buf,
+			       rc6_items[0].buf);
+			if (engines->r_gpu.present) {
+				printf("%s/%s W; ",
+				       power_items[0].buf,
+				       power_items[1].buf);
+			}
+			printf("%s irqs/s\n", irq_items[0].buf);
 		}
+
 		if (lines++ < con_h)
 			printf("\n");
 	}
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power
@ 2020-11-24 23:27 ` Chris Wilson
  0 siblings, 0 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-24 23:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin, Chris Wilson

With integrated graphics the TDP is shared between the gpu and the cpu,
knowing the total energy consumed by the package is relevant to
understanding throttling.

v2: Tidy integration by eliminating struct rapl and improve output
formatting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 218 +++++++++++++++++++++++++-----------------
 1 file changed, 130 insertions(+), 88 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 86de09aa9..0a49cfecc 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -50,10 +50,12 @@ struct pmu_pair {
 };
 
 struct pmu_counter {
-	bool present;
+	uint64_t type;
 	uint64_t config;
 	unsigned int idx;
 	struct pmu_pair val;
+	double scale;
+	bool present;
 };
 
 struct engine {
@@ -79,8 +81,8 @@ struct engines {
 	struct pmu_pair ts;
 
 	int rapl_fd;
-	double rapl_scale;
-	const char *rapl_unit;
+	struct pmu_counter r_gpu, r_pkg;
+	unsigned int num_rapl;
 
 	int imc_fd;
 	double imc_reads_scale;
@@ -92,7 +94,6 @@ struct engines {
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter rapl;
 	struct pmu_counter imc_reads;
 	struct pmu_counter imc_writes;
 
@@ -108,6 +109,109 @@ struct engines {
 
 };
 
+__attribute__((format(scanf,3,4)))
+static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
+{
+	FILE *file;
+	int fd;
+	int ret = -1;
+
+	fd = openat(dir, attr, O_RDONLY);
+	if (fd < 0)
+		return -1;
+
+	file = fdopen(fd, "r");
+	if (file) {
+		va_list ap;
+
+		va_start(ap, fmt);
+		ret = vfscanf(file, fmt, ap);
+		va_end(ap);
+
+		fclose(file);
+	} else {
+		close(fd);
+	}
+
+	return ret;
+}
+
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	locale_t locale, oldlocale;
+	bool result = true;
+	char buf[128] = {};
+	int dir;
+
+	dir = open("/sys/devices/power", O_RDONLY);
+	if (dir < 0)
+		return -errno;
+
+	/* Replace user environment with plain C to match kernel format */
+	locale = newlocale(LC_ALL, "C", 0);
+	oldlocale = uselocale(locale);
+
+	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str);
+	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str);
+	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
+	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
+	    strcmp(buf, "Joules"))
+		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
+			str, buf);
+
+	uselocale(oldlocale);
+	freelocale(locale);
+
+	close(dir);
+
+	if (!result)
+		return -EINVAL;
+
+	if (isnan(pmu->scale) || !pmu->scale)
+		return -ERANGE;
+
+	return 0;
+}
+
+static void
+rapl_open(struct pmu_counter *pmu,
+	  const char *domain,
+	  struct engines *engines)
+{
+	int fd;
+
+	if (rapl_parse(pmu, domain) < 0)
+		return;
+
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->rapl_fd);
+	if (fd < 0)
+		return;
+
+	if (engines->rapl_fd == -1)
+		engines->rapl_fd = fd;
+
+	pmu->idx = engines->num_rapl++;
+	pmu->present = true;
+}
+
+static void gpu_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "gpu", engines);
+}
+
+static void pkg_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "pkg", engines);
+}
+
 static uint64_t
 get_pmu_config(int dirfd, const char *name, const char *counter)
 {
@@ -357,38 +461,6 @@ static double filename_to_double(const char *filename)
 	return v;
 }
 
-#define RAPL_ROOT "/sys/devices/power/"
-#define RAPL_EVENT "/sys/devices/power/events/"
-
-static uint64_t rapl_type_id(void)
-{
-	return filename_to_u64(RAPL_ROOT "type", 10);
-}
-
-static uint64_t rapl_gpu_power(void)
-{
-	return filename_to_u64(RAPL_EVENT "energy-gpu", 0);
-}
-
-static double rapl_gpu_power_scale(void)
-{
-	return filename_to_double(RAPL_EVENT "energy-gpu.scale");
-}
-
-static const char *rapl_gpu_power_unit(void)
-{
-	char buf[32];
-
-	if (filename_to_buf(RAPL_EVENT "energy-gpu.unit",
-			    buf, sizeof(buf)) == 0)
-		if (!strcmp(buf, "Joules"))
-			return strdup("Watts");
-		else
-			return strdup(buf);
-	else
-		return NULL;
-}
-
 #define IMC_ROOT "/sys/devices/uncore_imc/"
 #define IMC_EVENT "/sys/devices/uncore_imc/events/"
 
@@ -517,22 +589,9 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->rapl_fd = -1;
-	if (!engines->discrete && rapl_type_id()) {
-		engines->rapl_scale = rapl_gpu_power_scale();
-		engines->rapl_unit = rapl_gpu_power_unit();
-		if (!engines->rapl_unit)
-			return -1;
-
-		engines->rapl.config = rapl_gpu_power();
-		if (!engines->rapl.config)
-			return -1;
-
-		engines->rapl_fd = igt_perf_open(rapl_type_id(),
-						 engines->rapl.config);
-		if (engines->rapl_fd < 0)
-			return -1;
-
-		engines->rapl.present = true;
+	if (!engines->discrete) {
+		gpu_power_open(&engines->r_gpu, engines);
+		pkg_power_open(&engines->r_pkg, engines);
 	}
 
 	engines->imc_fd = -1;
@@ -614,25 +673,6 @@ static void fill_str(char *buf, unsigned int bufsz, char c, unsigned int num)
 	*buf = 0;
 }
 
-static uint64_t __pmu_read_single(int fd, uint64_t *ts)
-{
-	uint64_t data[2] = { };
-	ssize_t len;
-
-	len = read(fd, data, sizeof(data));
-	assert(len == sizeof(data));
-
-	if (ts)
-		*ts = data[1];
-
-	return data[0];
-}
-
-static uint64_t pmu_read_single(int fd)
-{
-	return __pmu_read_single(fd, NULL);
-}
-
 static void __update_sample(struct pmu_counter *counter, uint64_t val)
 {
 	counter->val.prev = counter->val.cur;
@@ -653,10 +693,6 @@ static void pmu_sample(struct engines *engines)
 
 	engines->ts.prev = engines->ts.cur;
 
-	if (engines->rapl_fd >= 0)
-		__update_sample(&engines->rapl,
-				pmu_read_single(engines->rapl_fd));
-
 	if (engines->imc_fd >= 0) {
 		pmu_read_multi(engines->imc_fd, 2, val);
 		update_sample(&engines->imc_reads, val);
@@ -677,6 +713,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engine->sema, val);
 		update_sample(&engine->wait, val);
 	}
+
+	if (engines->num_rapl) {
+		pmu_read_multi(engines->rapl_fd, engines->num_rapl, val);
+		update_sample(&engines->r_gpu, val);
+		update_sample(&engines->r_pkg, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1076,14 +1118,14 @@ print_header(const struct igt_device_card *card,
 		.items = rc6_items,
 	};
 	struct cnt_item power_items[] = {
-		{ &engines->rapl, 4, 2, 1.0, t, engines->rapl_scale, "value",
-		  "W" },
+		{ &engines->r_gpu, 4, 2, 1.0, t, engines->r_gpu.scale, "GPU", "gpu" },
+		{ &engines->r_pkg, 4, 2, 1.0, t, engines->r_pkg.scale, "Package", "pkg" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit", "W" },
 		{ },
 	};
 	struct cnt_group power_group = {
 		.name = "power",
-		.display_name = "Power",
+		.display_name = "Power W",
 		.items = power_items,
 	};
 	struct cnt_group *groups[] = {
@@ -1108,17 +1150,17 @@ print_header(const struct igt_device_card *card,
 
 		if (lines++ < con_h) {
 			printf("intel-gpu-top: %s - ", card->card);
-			if (!engines->discrete)
-				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, power_items[0].buf,
-					engines->rapl_unit,
-					irq_items[0].buf);
-			else
-				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, irq_items[0].buf);
+			printf("%s/%s MHz;  %s%% RC6; ",
+			       freq_items[1].buf, freq_items[0].buf,
+			       rc6_items[0].buf);
+			if (engines->r_gpu.present) {
+				printf("%s/%s W; ",
+				       power_items[0].buf,
+				       power_items[1].buf);
+			}
+			printf("%s irqs/s\n", irq_items[0].buf);
 		}
+
 		if (lines++ < con_h)
 			printf("\n");
 	}
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
  (?)
@ 2020-11-24 23:27 ` Chris Wilson
  2020-11-25  8:58   ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
                     ` (2 more replies)
  -1 siblings, 3 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-24 23:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Follow the same pattern as rapl for imc, and consolidate everything to
work on struct pmu_counter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 249 ++++++++++++++----------------------------
 1 file changed, 82 insertions(+), 167 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 0a49cfecc..9af1c29b6 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -55,6 +55,7 @@ struct pmu_counter {
 	unsigned int idx;
 	struct pmu_pair val;
 	double scale;
+	const char *units;
 	bool present;
 };
 
@@ -85,17 +86,14 @@ struct engines {
 	unsigned int num_rapl;
 
 	int imc_fd;
-	double imc_reads_scale;
-	const char *imc_reads_unit;
-	double imc_writes_scale;
-	const char *imc_writes_unit;
+	struct pmu_counter imc_reads;
+	struct pmu_counter imc_writes;
+	unsigned int num_imc;
 
 	struct pmu_counter freq_req;
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter imc_reads;
-	struct pmu_counter imc_writes;
 
 	bool discrete;
 	char *device;
@@ -400,146 +398,93 @@ static struct engines *discover_engines(char *device)
 	return engines;
 }
 
-static int
-filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
-{
-	int fd, err;
-	ssize_t ret;
-
-	fd = open(filename, O_RDONLY);
-	if (fd < 0)
-		return -1;
-
-	ret = read(fd, buf, bufsize - 1);
-	err = errno;
-	close(fd);
-	if (ret < 1) {
-		errno = ret < 0 ? err : ENOMSG;
-
-		return -1;
-	}
+#define _open_pmu(type, cnt, pmu, fd) \
+({ \
+	int fd__; \
+\
+	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
+	if (fd__ >= 0) { \
+		if ((fd) == -1) \
+			(fd) = fd__; \
+		(pmu)->present = true; \
+		(pmu)->idx = (cnt)++; \
+	} \
+\
+	fd__; \
+})
 
-	if (ret > 1 && buf[ret - 1] == '\n')
-		buf[ret - 1] = '\0';
-	else
-		buf[ret] = '\0';
+static int imc_parse(struct pmu_counter *pmu, const char *str)
+{
+	locale_t locale, oldlocale;
+	bool result = true;
+	char buf[128] = {};
+	int dir;
 
-	return 0;
-}
+	dir = open("/sys/devices/uncore_imc", O_RDONLY);
+	if (dir < 0)
+		return -errno;
 
-static uint64_t filename_to_u64(const char *filename, int base)
-{
-	char buf[64], *b;
+	/* Replace user environment with plain C to match kernel format */
+	locale = newlocale(LC_ALL, "C", 0);
+	oldlocale = uselocale(locale);
 
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
+	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
 
-	/*
-	 * Handle both single integer and key=value formats by skipping
-	 * leading non-digits.
-	 */
-	b = buf;
-	while (*b && !isdigit(*b))
-		b++;
+	snprintf(buf, sizeof(buf) - 1, "events/%s", str);
+	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
 
-	return strtoull(b, NULL, base);
-}
+	snprintf(buf, sizeof(buf) - 1, "events/%s.scale", str);
+	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
 
-static double filename_to_double(const char *filename)
-{
-	char *oldlocale;
-	char buf[80];
-	double v;
+	snprintf(buf, sizeof(buf) - 1, "events/%s.unit", str);
+	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
+	pmu->units = strdup(buf);
 
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
+	uselocale(oldlocale);
+	freelocale(locale);
 
-	oldlocale = setlocale(LC_ALL, "C");
-	v = strtod(buf, NULL);
-	setlocale(LC_ALL, oldlocale);
+	close(dir);
 
-	return v;
-}
+	if (!result)
+		return -EINVAL;
 
-#define IMC_ROOT "/sys/devices/uncore_imc/"
-#define IMC_EVENT "/sys/devices/uncore_imc/events/"
+	if (isnan(pmu->scale) || !pmu->scale)
+		return -ERANGE;
 
-static uint64_t imc_type_id(void)
-{
-	return filename_to_u64(IMC_ROOT "type", 10);
+	return 0;
 }
 
-static uint64_t imc_data_reads(void)
+static void
+imc_open(struct pmu_counter *pmu,
+	 const char *domain,
+	 struct engines *engines)
 {
-	return filename_to_u64(IMC_EVENT "data_reads", 0);
-}
+	int fd;
 
-static double imc_data_reads_scale(void)
-{
-	return filename_to_double(IMC_EVENT "data_reads.scale");
-}
+	if (imc_parse(pmu, domain) < 0)
+		return;
 
-static const char *imc_data_reads_unit(void)
-{
-	char buf[32];
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
+	if (fd < 0)
+		return;
 
-	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
-}
+	if (engines->imc_fd == -1)
+		engines->imc_fd = fd;
 
-static uint64_t imc_data_writes(void)
-{
-	return filename_to_u64(IMC_EVENT "data_writes", 0);
+	pmu->idx = engines->num_imc++;
+	pmu->present = true;
 }
 
-static double imc_data_writes_scale(void)
+static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	return filename_to_double(IMC_EVENT "data_writes.scale");
+	imc_open(pmu, "data_writes", engines);
 }
 
-static const char *imc_data_writes_unit(void)
+static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	char buf[32];
-
-	if (filename_to_buf(IMC_EVENT "data_writes.unit",
-			    buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
+	imc_open(pmu, "data_reads", engines);
 }
 
-#define _open_pmu(type, cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
-#define _open_imc(cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
 static int pmu_init(struct engines *engines)
 {
 	unsigned int i;
@@ -595,38 +540,8 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->imc_fd = -1;
-	if (imc_type_id()) {
-		unsigned int num = 0;
-
-		engines->imc_reads_scale = imc_data_reads_scale();
-		engines->imc_writes_scale = imc_data_writes_scale();
-
-		engines->imc_reads_unit = imc_data_reads_unit();
-		if (!engines->imc_reads_unit)
-			return -1;
-
-		engines->imc_writes_unit = imc_data_writes_unit();
-		if (!engines->imc_writes_unit)
-			return -1;
-
-		engines->imc_reads.config = imc_data_reads();
-		if (!engines->imc_reads.config)
-			return -1;
-
-		engines->imc_writes.config = imc_data_writes();
-		if (!engines->imc_writes.config)
-			return -1;
-
-		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-
-		engines->imc_reads.present = true;
-		engines->imc_writes.present = true;
-	}
+	imc_reads_open(&engines->imc_reads, engines);
+	imc_writes_open(&engines->imc_writes, engines);
 
 	return 0;
 }
@@ -692,13 +607,6 @@ static void pmu_sample(struct engines *engines)
 	unsigned int i;
 
 	engines->ts.prev = engines->ts.cur;
-
-	if (engines->imc_fd >= 0) {
-		pmu_read_multi(engines->imc_fd, 2, val);
-		update_sample(&engines->imc_reads, val);
-		update_sample(&engines->imc_writes, val);
-	}
-
 	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
 
 	update_sample(&engines->freq_req, val);
@@ -719,6 +627,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engines->r_gpu, val);
 		update_sample(&engines->r_pkg, val);
 	}
+
+	if (engines->num_imc) {
+		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
+		update_sample(&engines->imc_reads, val);
+		update_sample(&engines->imc_writes, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1172,9 +1086,9 @@ static int
 print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 {
 	struct cnt_item imc_items[] = {
-		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
+		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
 		  "reads", "rd" },
-		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
+		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
 		  "writes", "wr" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
 		{ },
@@ -1189,12 +1103,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	};
 	int ret;
 
+	if (!engines->num_imc)
+		return lines;
+
 	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	print_groups(groups);
@@ -1205,11 +1122,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	if (output_mode == INTERACTIVE) {
 		if (lines++ < con_h)
 			printf("      IMC reads:   %s %s/s\n",
-			       imc_items[0].buf, engines->imc_reads_unit);
+			       imc_items[0].buf, engines->imc_reads.units);
 
 		if (lines++ < con_h)
 			printf("     IMC writes:   %s %s/s\n",
-			       imc_items[1].buf, engines->imc_writes_unit);
+			       imc_items[1].buf, engines->imc_writes.units);
 
 		if (lines++ < con_h)
 			printf("\n");
@@ -1509,9 +1426,7 @@ int main(int argc, char **argv)
 					     t, lines, con_w, con_h,
 					     &consumed);
 
-			if (engines->imc_fd)
-				lines = print_imc(engines, t, lines, con_w,
-						  con_h);
+			lines = print_imc(engines, t, lines, con_w, con_h);
 
 			lines = print_engines_header(engines, t, lines, con_w,
 						     con_h);
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
  (?)
  (?)
@ 2020-11-25  0:02 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25  0:02 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 5570 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power
URL   : https://patchwork.freedesktop.org/series/84235/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9385 -> IGTPW_5221
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html

Known issues
------------

  Here are the changes found in IGTPW_5221 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_create@basic:
    - fi-tgl-y:           [PASS][1] -> [DMESG-WARN][2] ([i915#402]) +2 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-tgl-y/igt@gem_exec_create@basic.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-tgl-y/igt@gem_exec_create@basic.html

  * igt@kms_busy@basic@flip:
    - fi-tgl-y:           [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-tgl-y/igt@kms_busy@basic@flip.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-tgl-y/igt@kms_busy@basic@flip.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-kbl-7500u:       [PASS][5] -> [DMESG-WARN][6] ([i915#1982] / [i915#262])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-kbl-7500u/igt@kms_chamelium@dp-crc-fast.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-kbl-7500u/igt@kms_chamelium@dp-crc-fast.html
    - fi-cml-u2:          [PASS][7] -> [DMESG-WARN][8] ([i915#1982])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-byt-j1900:       [PASS][9] -> [DMESG-WARN][10] ([i915#1982]) +1 similar issue
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - fi-icl-u2:          [PASS][11] -> [DMESG-WARN][12] ([i915#1982]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-cfl-8109u:       [DMESG-WARN][13] ([i915#262]) -> [PASS][14] +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-cfl-8109u/igt@gem_exec_suspend@basic-s0.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-cfl-8109u/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-bsw-kefka:       [DMESG-WARN][15] ([i915#1982]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@module-reload:
    - fi-byt-j1900:       [DMESG-WARN][17] ([i915#1982]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-byt-j1900/igt@i915_pm_rpm@module-reload.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-byt-j1900/igt@i915_pm_rpm@module-reload.html

  * igt@prime_vgem@basic-read:
    - fi-tgl-y:           [DMESG-WARN][19] ([i915#402]) -> [PASS][20] +1 similar issue
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-tgl-y/igt@prime_vgem@basic-read.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-tgl-y/igt@prime_vgem@basic-read.html

  
#### Warnings ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-tgl-y:           [DMESG-WARN][21] ([i915#2411]) -> [DMESG-WARN][22] ([i915#1982] / [i915#2411])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/fi-tgl-y/igt@i915_pm_rpm@basic-pci-d3-state.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/fi-tgl-y/igt@i915_pm_rpm@basic-pci-d3-state.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2524]: https://gitlab.freedesktop.org/drm/intel/issues/2524
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402


Participating hosts (43 -> 37)
------------------------------

  Missing    (6): fi-kbl-soraka fi-ilk-m540 fi-bdw-5557u fi-hsw-4200u fi-bsw-cyan fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5221

  CI-20190529: 20190529
  CI_DRM_9385: 3d37e624f60f40cea80e784617686ae2917e9b01 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5221: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html

[-- Attachment #1.2: Type: text/html, Size: 7037 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
                   ` (2 preceding siblings ...)
  (?)
@ 2020-11-25  4:42 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25  4:42 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 24763 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power
URL   : https://patchwork.freedesktop.org/series/84235/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9385_full -> IGTPW_5221_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_5221_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_5221_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_5221_full:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_lpsp@screens-disabled:
    - shard-hsw:          [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw4/igt@i915_pm_lpsp@screens-disabled.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw5/igt@i915_pm_lpsp@screens-disabled.html

  
Known issues
------------

  Here are the changes found in IGTPW_5221_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_eio@kms:
    - shard-glk:          [PASS][3] -> [INCOMPLETE][4] ([i915#2244])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk9/igt@gem_eio@kms.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk8/igt@gem_eio@kms.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-iclb:         [PASS][5] -> [DMESG-WARN][6] ([i915#1982])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb7/igt@gem_tiled_swapping@non-threaded.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb2/igt@gem_tiled_swapping@non-threaded.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [PASS][7] -> [DMESG-WARN][8] ([i915#1436] / [i915#716])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk5/igt@gen9_exec_parse@allowed-all.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk3/igt@gen9_exec_parse@allowed-all.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-apl:          [PASS][9] -> [DMESG-WARN][10] ([i915#1436] / [i915#1635] / [i915#716])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl4/igt@gen9_exec_parse@allowed-single.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl4/igt@gen9_exec_parse@allowed-single.html

  * igt@i915_pm_rpm@system-suspend-modeset:
    - shard-glk:          [PASS][11] -> [SKIP][12] ([fdo#109271]) +4 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk8/igt@i915_pm_rpm@system-suspend-modeset.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk6/igt@i915_pm_rpm@system-suspend-modeset.html
    - shard-iclb:         [PASS][13] -> [SKIP][14] ([i915#579]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb1/igt@i915_pm_rpm@system-suspend-modeset.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb3/igt@i915_pm_rpm@system-suspend-modeset.html

  * igt@kms_cursor_edge_walk@pipe-c-256x256-right-edge:
    - shard-apl:          [PASS][15] -> [DMESG-WARN][16] ([i915#1635] / [i915#1982])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl8/igt@kms_cursor_edge_walk@pipe-c-256x256-right-edge.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl1/igt@kms_cursor_edge_walk@pipe-c-256x256-right-edge.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          [PASS][17] -> [FAIL][18] ([i915#96])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw8/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw1/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html

  * igt@kms_flip@flip-vs-expired-vblank@a-edp1:
    - shard-tglb:         [PASS][19] -> [FAIL][20] ([i915#2598])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb7/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb8/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-onoff:
    - shard-glk:          [PASS][21] -> [DMESG-WARN][22] ([i915#1982]) +4 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk5/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-onoff.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk7/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-onoff.html

  * igt@kms_frontbuffer_tracking@fbc-badstride:
    - shard-tglb:         [PASS][23] -> [DMESG-WARN][24] ([i915#1982])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb3/igt@kms_frontbuffer_tracking@fbc-badstride.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb6/igt@kms_frontbuffer_tracking@fbc-badstride.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-b:
    - shard-hsw:          [PASS][25] -> [DMESG-WARN][26] ([i915#1982]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw7/igt@kms_pipe_crc_basic@read-crc-pipe-b.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw6/igt@kms_pipe_crc_basic@read-crc-pipe-b.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [PASS][27] -> [SKIP][28] ([fdo#109441]) +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb8/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
    - shard-apl:          [PASS][29] -> [SKIP][30] ([fdo#109271] / [i915#1635]) +4 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl2/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl3/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
    - shard-iclb:         [PASS][31] -> [SKIP][32] ([fdo#109278]) +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb5/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb2/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
    - shard-kbl:          [PASS][33] -> [SKIP][34] ([fdo#109271]) +4 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-kbl7/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-kbl1/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
    - shard-hsw:          [PASS][35] -> [SKIP][36] ([fdo#109271]) +4 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw6/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw5/igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm.html

  
#### Possible fixes ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-glk:          [INCOMPLETE][37] ([i915#2283] / [i915#2405]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk5/igt@device_reset@unbind-reset-rebind.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk7/igt@device_reset@unbind-reset-rebind.html
    - shard-apl:          [INCOMPLETE][39] ([i915#1635] / [i915#2283] / [i915#2405]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl1/igt@device_reset@unbind-reset-rebind.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl7/igt@device_reset@unbind-reset-rebind.html
    - shard-kbl:          [INCOMPLETE][41] ([i915#2283] / [i915#2405]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-kbl7/igt@device_reset@unbind-reset-rebind.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-kbl1/igt@device_reset@unbind-reset-rebind.html
    - shard-tglb:         [INCOMPLETE][43] ([i915#1602] / [i915#750]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb8/igt@device_reset@unbind-reset-rebind.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb6/igt@device_reset@unbind-reset-rebind.html
    - shard-iclb:         [INCOMPLETE][45] ([i915#2283] / [i915#2405]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb8/igt@device_reset@unbind-reset-rebind.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb5/igt@device_reset@unbind-reset-rebind.html

  * {igt@gem_exec_capture@pi@bcs0}:
    - shard-iclb:         [INCOMPLETE][47] ([i915#2369] / [i915#2502]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb5/igt@gem_exec_capture@pi@bcs0.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb8/igt@gem_exec_capture@pi@bcs0.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-glk:          [DMESG-WARN][49] ([i915#118] / [i915#95]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk6/igt@gem_exec_whisper@basic-fds-forked.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk7/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-iclb:         [DMESG-WARN][51] -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb6/igt@i915_pm_backlight@fade_with_suspend.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb6/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][53] ([i915#454]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb8/igt@i915_pm_dc@dc6-psr.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb7/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-hsw:          [WARN][55] ([i915#1519]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw7/igt@i915_pm_rc6_residency@rc6-fence.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw7/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rpm@gem-execbuf-stress:
    - shard-glk:          [SKIP][57] ([fdo#109271]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk2/igt@i915_pm_rpm@gem-execbuf-stress.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk5/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-apl:          [SKIP][59] ([fdo#109271] / [i915#1635]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl3/igt@i915_pm_rpm@gem-execbuf-stress.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl3/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-kbl:          [SKIP][61] ([fdo#109271]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-kbl3/igt@i915_pm_rpm@gem-execbuf-stress.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-kbl6/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-hsw:          [SKIP][63] ([fdo#109271]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw5/igt@i915_pm_rpm@gem-execbuf-stress.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw4/igt@i915_pm_rpm@gem-execbuf-stress.html

  * {igt@kms_async_flips@alternate-sync-async-flip}:
    - shard-tglb:         [FAIL][65] ([i915#2521]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb8/igt@kms_async_flips@alternate-sync-async-flip.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb3/igt@kms_async_flips@alternate-sync-async-flip.html

  * igt@kms_color@pipe-a-gamma:
    - shard-tglb:         [FAIL][67] ([i915#1149]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb7/igt@kms_color@pipe-a-gamma.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb2/igt@kms_color@pipe-a-gamma.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          [FAIL][69] ([i915#96]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw6/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw4/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
    - shard-apl:          [DMESG-WARN][71] ([i915#1635] / [i915#1982]) -> [PASS][72] +6 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl8/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl3/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
    - shard-glk:          [DMESG-WARN][73] ([i915#1982]) -> [PASS][74] +5 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-glk8/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-glk3/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html

  * igt@kms_flip@2x-dpms-vs-vblank-race@ab-vga1-hdmi-a1:
    - shard-hsw:          [DMESG-WARN][75] ([i915#1982]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw6/igt@kms_flip@2x-dpms-vs-vblank-race@ab-vga1-hdmi-a1.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw4/igt@kms_flip@2x-dpms-vs-vblank-race@ab-vga1-hdmi-a1.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1:
    - shard-tglb:         [FAIL][77] ([i915#2598]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb3/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb1/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1.html

  * igt@kms_flip@plain-flip-ts-check@a-dp1:
    - shard-kbl:          [DMESG-WARN][79] ([i915#1982]) -> [PASS][80] +4 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-kbl4/igt@kms_flip@plain-flip-ts-check@a-dp1.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-kbl4/igt@kms_flip@plain-flip-ts-check@a-dp1.html

  * igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary:
    - shard-kbl:          [FAIL][81] ([i915#49]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
    - shard-apl:          [FAIL][83] ([i915#1635] / [i915#49]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl3/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl6/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html

  * igt@kms_frontbuffer_tracking@fbc-stridechange:
    - shard-tglb:         [DMESG-WARN][85] ([i915#1982]) -> [PASS][86] +3 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb1/igt@kms_frontbuffer_tracking@fbc-stridechange.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb3/igt@kms_frontbuffer_tracking@fbc-stridechange.html

  * igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-b:
    - shard-snb:          [SKIP][87] ([fdo#109271]) -> [PASS][88] +2 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-snb2/igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-b.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-snb6/igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-b.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][89] ([fdo#109441]) -> [PASS][90] +1 similar issue
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb7/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  
#### Warnings ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-hsw:          [INCOMPLETE][91] ([i915#2283] / [i915#2405]) -> [WARN][92] ([i915#2283])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-hsw1/igt@device_reset@unbind-reset-rebind.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-hsw5/igt@device_reset@unbind-reset-rebind.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-tglb:         [INCOMPLETE][93] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2369] / [i915#2411] / [i915#456]) -> [DMESG-WARN][94] ([i915#2411])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb7/igt@i915_pm_backlight@fade_with_suspend.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb7/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_rpm@cursor-dpms:
    - shard-tglb:         [DMESG-WARN][95] ([i915#2411]) -> [SKIP][96] ([i915#579]) +1 similar issue
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb6/igt@i915_pm_rpm@cursor-dpms.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb8/igt@i915_pm_rpm@cursor-dpms.html

  * igt@i915_pm_rpm@modeset-non-lpsp:
    - shard-iclb:         [SKIP][97] ([fdo#110892]) -> [SKIP][98] ([i915#579])
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb3/igt@i915_pm_rpm@modeset-non-lpsp.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb3/igt@i915_pm_rpm@modeset-non-lpsp.html
    - shard-tglb:         [SKIP][99] ([fdo#111644] / [i915#1397] / [i915#2411]) -> [SKIP][100] ([i915#579])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb6/igt@i915_pm_rpm@modeset-non-lpsp.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb8/igt@i915_pm_rpm@modeset-non-lpsp.html

  * igt@i915_pm_rpm@pc8-residency:
    - shard-iclb:         [SKIP][101] ([fdo#109293] / [fdo#109506]) -> [SKIP][102] ([i915#579])
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb3/igt@i915_pm_rpm@pc8-residency.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb2/igt@i915_pm_rpm@pc8-residency.html
    - shard-tglb:         [SKIP][103] ([fdo#109506] / [i915#2411]) -> [SKIP][104] ([i915#579])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb7/igt@i915_pm_rpm@pc8-residency.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb2/igt@i915_pm_rpm@pc8-residency.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [DMESG-WARN][105] ([i915#1226]) -> [SKIP][106] ([fdo#109349])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb5/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@kms_vblank@pipe-a-ts-continuation-modeset-rpm:
    - shard-tglb:         [DMESG-WARN][107] ([i915#2411]) -> [SKIP][108] ([i915#2648]) +1 similar issue
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-tglb2/igt@kms_vblank@pipe-a-ts-continuation-modeset-rpm.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-tglb8/igt@kms_vblank@pipe-a-ts-continuation-modeset-rpm.html

  * igt@runner@aborted:
    - shard-iclb:         ([FAIL][109], [FAIL][110], [FAIL][111]) ([i915#1814] / [i915#2283] / [i915#2295] / [i915#483]) -> [FAIL][112] ([i915#2295])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb4/igt@runner@aborted.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb6/igt@runner@aborted.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-iclb8/igt@runner@aborted.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-iclb2/igt@runner@aborted.html
    - shard-apl:          ([FAIL][113], [FAIL][114]) ([i915#1635] / [i915#2295]) -> ([FAIL][115], [FAIL][116]) ([fdo#109271] / [i915#1635] / [i915#2295] / [i915#716])
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl8/igt@runner@aborted.html
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9385/shard-apl1/igt@runner@aborted.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl4/igt@runner@aborted.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/shard-apl1/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109293]: https://bugs.freedesktop.org/show_bug.cgi?id=109293
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#110892]: https://bugs.freedesktop.org/show_bug.cgi?id=110892
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [i915#1149]: https://gitlab.freedesktop.org/drm/intel/issues/1149
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1226]: https://gitlab.freedesktop.org/drm/intel/issues/1226
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1519]: https://gitlab.freedesktop.org/drm/intel/issues/1519
  [i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#1887]: https://gitlab.freedesktop.org/drm/intel/issues/1887
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2244]: https://gitlab.freedesktop.org/drm/intel/issues/2244
  [i915#2283]: https://gitlab.freedesktop.org/drm/intel/issues/2283
  [i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
  [i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
  [i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2502]: https://gitlab.freedesktop.org/drm/intel/issues/2502
  [i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
  [i915#2598]: https://gitlab.freedesktop.org/drm/intel/issues/2598
  [i915#2648]: https://gitlab.freedesktop.org/drm/intel/issues/2648
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#483]: https://gitlab.freedesktop.org/drm/intel/issues/483
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#579]: https://gitlab.freedesktop.org/drm/intel/issues/579
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
  [i915#96]: https://gitlab.freedesktop.org/drm/intel/issues/96


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5221
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_9385: 3d37e624f60f40cea80e784617686ae2917e9b01 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5221: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5221/index.html

[-- Attachment #1.2: Type: text/html, Size: 30536 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
@ 2020-11-25  8:56   ` Tvrtko Ursulin
  -1 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25  8:56 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 24/11/2020 23:27, Chris Wilson wrote:
> With integrated graphics the TDP is shared between the gpu and the cpu,
> knowing the total energy consumed by the package is relevant to
> understanding throttling.
> 
> v2: Tidy integration by eliminating struct rapl and improve output
> formatting.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 218 +++++++++++++++++++++++++-----------------
>   1 file changed, 130 insertions(+), 88 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 86de09aa9..0a49cfecc 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -50,10 +50,12 @@ struct pmu_pair {
>   };
>   
>   struct pmu_counter {
> -	bool present;
> +	uint64_t type;
>   	uint64_t config;
>   	unsigned int idx;
>   	struct pmu_pair val;
> +	double scale;
> +	bool present;
>   };
>   
>   struct engine {
> @@ -79,8 +81,8 @@ struct engines {
>   	struct pmu_pair ts;
>   
>   	int rapl_fd;
> -	double rapl_scale;
> -	const char *rapl_unit;
> +	struct pmu_counter r_gpu, r_pkg;
> +	unsigned int num_rapl;
>   
>   	int imc_fd;
>   	double imc_reads_scale;
> @@ -92,7 +94,6 @@ struct engines {
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter rapl;
>   	struct pmu_counter imc_reads;
>   	struct pmu_counter imc_writes;
>   
> @@ -108,6 +109,109 @@ struct engines {
>   
>   };
>   
> +__attribute__((format(scanf,3,4)))
> +static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
> +{
> +	FILE *file;
> +	int fd;
> +	int ret = -1;
> +
> +	fd = openat(dir, attr, O_RDONLY);
> +	if (fd < 0)
> +		return -1;
> +
> +	file = fdopen(fd, "r");
> +	if (file) {
> +		va_list ap;
> +
> +		va_start(ap, fmt);
> +		ret = vfscanf(file, fmt, ap);
> +		va_end(ap);
> +
> +		fclose(file);
> +	} else {
> +		close(fd);
> +	}
> +
> +	return ret;
> +}
> +
> +static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	locale_t locale, oldlocale;
> +	bool result = true;
> +	char buf[128] = {};
> +	int dir;
> +
> +	dir = open("/sys/devices/power", O_RDONLY);
> +	if (dir < 0)
> +		return -errno;
> +
> +	/* Replace user environment with plain C to match kernel format */
> +	locale = newlocale(LC_ALL, "C", 0);
> +	oldlocale = uselocale(locale);
> +
> +	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str);
> +	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str);
> +	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
> +	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
> +	    strcmp(buf, "Joules"))
> +		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
> +			str, buf);
> +
> +	uselocale(oldlocale);
> +	freelocale(locale);
> +
> +	close(dir);
> +
> +	if (!result)
> +		return -EINVAL;
> +
> +	if (isnan(pmu->scale) || !pmu->scale)
> +		return -ERANGE;
> +
> +	return 0;
> +}
> +
> +static void
> +rapl_open(struct pmu_counter *pmu,
> +	  const char *domain,
> +	  struct engines *engines)
> +{
> +	int fd;
> +
> +	if (rapl_parse(pmu, domain) < 0)
> +		return;
> +
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->rapl_fd);
> +	if (fd < 0)
> +		return;
> +
> +	if (engines->rapl_fd == -1)
> +		engines->rapl_fd = fd;
> +
> +	pmu->idx = engines->num_rapl++;
> +	pmu->present = true;
> +}
> +
> +static void gpu_power_open(struct pmu_counter *pmu,
> +			   struct engines *engines)
> +{
> +	rapl_open(pmu, "gpu", engines);
> +}
> +
> +static void pkg_power_open(struct pmu_counter *pmu,
> +			   struct engines *engines)
> +{
> +	rapl_open(pmu, "pkg", engines);
> +}
> +
>   static uint64_t
>   get_pmu_config(int dirfd, const char *name, const char *counter)
>   {
> @@ -357,38 +461,6 @@ static double filename_to_double(const char *filename)
>   	return v;
>   }
>   
> -#define RAPL_ROOT "/sys/devices/power/"
> -#define RAPL_EVENT "/sys/devices/power/events/"
> -
> -static uint64_t rapl_type_id(void)
> -{
> -	return filename_to_u64(RAPL_ROOT "type", 10);
> -}
> -
> -static uint64_t rapl_gpu_power(void)
> -{
> -	return filename_to_u64(RAPL_EVENT "energy-gpu", 0);
> -}
> -
> -static double rapl_gpu_power_scale(void)
> -{
> -	return filename_to_double(RAPL_EVENT "energy-gpu.scale");
> -}
> -
> -static const char *rapl_gpu_power_unit(void)
> -{
> -	char buf[32];
> -
> -	if (filename_to_buf(RAPL_EVENT "energy-gpu.unit",
> -			    buf, sizeof(buf)) == 0)
> -		if (!strcmp(buf, "Joules"))
> -			return strdup("Watts");
> -		else
> -			return strdup(buf);
> -	else
> -		return NULL;
> -}
> -
>   #define IMC_ROOT "/sys/devices/uncore_imc/"
>   #define IMC_EVENT "/sys/devices/uncore_imc/events/"
>   
> @@ -517,22 +589,9 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->rapl_fd = -1;
> -	if (!engines->discrete && rapl_type_id()) {
> -		engines->rapl_scale = rapl_gpu_power_scale();
> -		engines->rapl_unit = rapl_gpu_power_unit();
> -		if (!engines->rapl_unit)
> -			return -1;
> -
> -		engines->rapl.config = rapl_gpu_power();
> -		if (!engines->rapl.config)
> -			return -1;
> -
> -		engines->rapl_fd = igt_perf_open(rapl_type_id(),
> -						 engines->rapl.config);
> -		if (engines->rapl_fd < 0)
> -			return -1;
> -
> -		engines->rapl.present = true;
> +	if (!engines->discrete) {
> +		gpu_power_open(&engines->r_gpu, engines);
> +		pkg_power_open(&engines->r_pkg, engines);
>   	}
>   
>   	engines->imc_fd = -1;
> @@ -614,25 +673,6 @@ static void fill_str(char *buf, unsigned int bufsz, char c, unsigned int num)
>   	*buf = 0;
>   }
>   
> -static uint64_t __pmu_read_single(int fd, uint64_t *ts)
> -{
> -	uint64_t data[2] = { };
> -	ssize_t len;
> -
> -	len = read(fd, data, sizeof(data));
> -	assert(len == sizeof(data));
> -
> -	if (ts)
> -		*ts = data[1];
> -
> -	return data[0];
> -}
> -
> -static uint64_t pmu_read_single(int fd)
> -{
> -	return __pmu_read_single(fd, NULL);
> -}
> -
>   static void __update_sample(struct pmu_counter *counter, uint64_t val)
>   {
>   	counter->val.prev = counter->val.cur;
> @@ -653,10 +693,6 @@ static void pmu_sample(struct engines *engines)
>   
>   	engines->ts.prev = engines->ts.cur;
>   
> -	if (engines->rapl_fd >= 0)
> -		__update_sample(&engines->rapl,
> -				pmu_read_single(engines->rapl_fd));
> -
>   	if (engines->imc_fd >= 0) {
>   		pmu_read_multi(engines->imc_fd, 2, val);
>   		update_sample(&engines->imc_reads, val);
> @@ -677,6 +713,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engine->sema, val);
>   		update_sample(&engine->wait, val);
>   	}
> +
> +	if (engines->num_rapl) {
> +		pmu_read_multi(engines->rapl_fd, engines->num_rapl, val);
> +		update_sample(&engines->r_gpu, val);
> +		update_sample(&engines->r_pkg, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1076,14 +1118,14 @@ print_header(const struct igt_device_card *card,
>   		.items = rc6_items,
>   	};
>   	struct cnt_item power_items[] = {
> -		{ &engines->rapl, 4, 2, 1.0, t, engines->rapl_scale, "value",
> -		  "W" },
> +		{ &engines->r_gpu, 4, 2, 1.0, t, engines->r_gpu.scale, "GPU", "gpu" },
> +		{ &engines->r_pkg, 4, 2, 1.0, t, engines->r_pkg.scale, "Package", "pkg" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit", "W" },
>   		{ },
>   	};
>   	struct cnt_group power_group = {
>   		.name = "power",
> -		.display_name = "Power",
> +		.display_name = "Power W",
>   		.items = power_items,
>   	};
>   	struct cnt_group *groups[] = {
> @@ -1108,17 +1150,17 @@ print_header(const struct igt_device_card *card,
>   
>   		if (lines++ < con_h) {
>   			printf("intel-gpu-top: %s - ", card->card);
> -			if (!engines->discrete)
> -				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
> -					freq_items[1].buf, freq_items[0].buf,
> -					rc6_items[0].buf, power_items[0].buf,
> -					engines->rapl_unit,
> -					irq_items[0].buf);
> -			else
> -				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
> -					freq_items[1].buf, freq_items[0].buf,
> -					rc6_items[0].buf, irq_items[0].buf);
> +			printf("%s/%s MHz;  %s%% RC6; ",
> +			       freq_items[1].buf, freq_items[0].buf,
> +			       rc6_items[0].buf);
> +			if (engines->r_gpu.present) {
> +				printf("%s/%s W; ",
> +				       power_items[0].buf,
> +				       power_items[1].buf);
> +			}
> +			printf("%s irqs/s\n", irq_items[0].buf);
>   		}
> +
>   		if (lines++ < con_h)
>   			printf("\n");
>   	}
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power
@ 2020-11-25  8:56   ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25  8:56 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev, Tvrtko Ursulin


On 24/11/2020 23:27, Chris Wilson wrote:
> With integrated graphics the TDP is shared between the gpu and the cpu,
> knowing the total energy consumed by the package is relevant to
> understanding throttling.
> 
> v2: Tidy integration by eliminating struct rapl and improve output
> formatting.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 218 +++++++++++++++++++++++++-----------------
>   1 file changed, 130 insertions(+), 88 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 86de09aa9..0a49cfecc 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -50,10 +50,12 @@ struct pmu_pair {
>   };
>   
>   struct pmu_counter {
> -	bool present;
> +	uint64_t type;
>   	uint64_t config;
>   	unsigned int idx;
>   	struct pmu_pair val;
> +	double scale;
> +	bool present;
>   };
>   
>   struct engine {
> @@ -79,8 +81,8 @@ struct engines {
>   	struct pmu_pair ts;
>   
>   	int rapl_fd;
> -	double rapl_scale;
> -	const char *rapl_unit;
> +	struct pmu_counter r_gpu, r_pkg;
> +	unsigned int num_rapl;
>   
>   	int imc_fd;
>   	double imc_reads_scale;
> @@ -92,7 +94,6 @@ struct engines {
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter rapl;
>   	struct pmu_counter imc_reads;
>   	struct pmu_counter imc_writes;
>   
> @@ -108,6 +109,109 @@ struct engines {
>   
>   };
>   
> +__attribute__((format(scanf,3,4)))
> +static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
> +{
> +	FILE *file;
> +	int fd;
> +	int ret = -1;
> +
> +	fd = openat(dir, attr, O_RDONLY);
> +	if (fd < 0)
> +		return -1;
> +
> +	file = fdopen(fd, "r");
> +	if (file) {
> +		va_list ap;
> +
> +		va_start(ap, fmt);
> +		ret = vfscanf(file, fmt, ap);
> +		va_end(ap);
> +
> +		fclose(file);
> +	} else {
> +		close(fd);
> +	}
> +
> +	return ret;
> +}
> +
> +static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	locale_t locale, oldlocale;
> +	bool result = true;
> +	char buf[128] = {};
> +	int dir;
> +
> +	dir = open("/sys/devices/power", O_RDONLY);
> +	if (dir < 0)
> +		return -errno;
> +
> +	/* Replace user environment with plain C to match kernel format */
> +	locale = newlocale(LC_ALL, "C", 0);
> +	oldlocale = uselocale(locale);
> +
> +	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str);
> +	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str);
> +	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
> +
> +	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
> +	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
> +	    strcmp(buf, "Joules"))
> +		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
> +			str, buf);
> +
> +	uselocale(oldlocale);
> +	freelocale(locale);
> +
> +	close(dir);
> +
> +	if (!result)
> +		return -EINVAL;
> +
> +	if (isnan(pmu->scale) || !pmu->scale)
> +		return -ERANGE;
> +
> +	return 0;
> +}
> +
> +static void
> +rapl_open(struct pmu_counter *pmu,
> +	  const char *domain,
> +	  struct engines *engines)
> +{
> +	int fd;
> +
> +	if (rapl_parse(pmu, domain) < 0)
> +		return;
> +
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->rapl_fd);
> +	if (fd < 0)
> +		return;
> +
> +	if (engines->rapl_fd == -1)
> +		engines->rapl_fd = fd;
> +
> +	pmu->idx = engines->num_rapl++;
> +	pmu->present = true;
> +}
> +
> +static void gpu_power_open(struct pmu_counter *pmu,
> +			   struct engines *engines)
> +{
> +	rapl_open(pmu, "gpu", engines);
> +}
> +
> +static void pkg_power_open(struct pmu_counter *pmu,
> +			   struct engines *engines)
> +{
> +	rapl_open(pmu, "pkg", engines);
> +}
> +
>   static uint64_t
>   get_pmu_config(int dirfd, const char *name, const char *counter)
>   {
> @@ -357,38 +461,6 @@ static double filename_to_double(const char *filename)
>   	return v;
>   }
>   
> -#define RAPL_ROOT "/sys/devices/power/"
> -#define RAPL_EVENT "/sys/devices/power/events/"
> -
> -static uint64_t rapl_type_id(void)
> -{
> -	return filename_to_u64(RAPL_ROOT "type", 10);
> -}
> -
> -static uint64_t rapl_gpu_power(void)
> -{
> -	return filename_to_u64(RAPL_EVENT "energy-gpu", 0);
> -}
> -
> -static double rapl_gpu_power_scale(void)
> -{
> -	return filename_to_double(RAPL_EVENT "energy-gpu.scale");
> -}
> -
> -static const char *rapl_gpu_power_unit(void)
> -{
> -	char buf[32];
> -
> -	if (filename_to_buf(RAPL_EVENT "energy-gpu.unit",
> -			    buf, sizeof(buf)) == 0)
> -		if (!strcmp(buf, "Joules"))
> -			return strdup("Watts");
> -		else
> -			return strdup(buf);
> -	else
> -		return NULL;
> -}
> -
>   #define IMC_ROOT "/sys/devices/uncore_imc/"
>   #define IMC_EVENT "/sys/devices/uncore_imc/events/"
>   
> @@ -517,22 +589,9 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->rapl_fd = -1;
> -	if (!engines->discrete && rapl_type_id()) {
> -		engines->rapl_scale = rapl_gpu_power_scale();
> -		engines->rapl_unit = rapl_gpu_power_unit();
> -		if (!engines->rapl_unit)
> -			return -1;
> -
> -		engines->rapl.config = rapl_gpu_power();
> -		if (!engines->rapl.config)
> -			return -1;
> -
> -		engines->rapl_fd = igt_perf_open(rapl_type_id(),
> -						 engines->rapl.config);
> -		if (engines->rapl_fd < 0)
> -			return -1;
> -
> -		engines->rapl.present = true;
> +	if (!engines->discrete) {
> +		gpu_power_open(&engines->r_gpu, engines);
> +		pkg_power_open(&engines->r_pkg, engines);
>   	}
>   
>   	engines->imc_fd = -1;
> @@ -614,25 +673,6 @@ static void fill_str(char *buf, unsigned int bufsz, char c, unsigned int num)
>   	*buf = 0;
>   }
>   
> -static uint64_t __pmu_read_single(int fd, uint64_t *ts)
> -{
> -	uint64_t data[2] = { };
> -	ssize_t len;
> -
> -	len = read(fd, data, sizeof(data));
> -	assert(len == sizeof(data));
> -
> -	if (ts)
> -		*ts = data[1];
> -
> -	return data[0];
> -}
> -
> -static uint64_t pmu_read_single(int fd)
> -{
> -	return __pmu_read_single(fd, NULL);
> -}
> -
>   static void __update_sample(struct pmu_counter *counter, uint64_t val)
>   {
>   	counter->val.prev = counter->val.cur;
> @@ -653,10 +693,6 @@ static void pmu_sample(struct engines *engines)
>   
>   	engines->ts.prev = engines->ts.cur;
>   
> -	if (engines->rapl_fd >= 0)
> -		__update_sample(&engines->rapl,
> -				pmu_read_single(engines->rapl_fd));
> -
>   	if (engines->imc_fd >= 0) {
>   		pmu_read_multi(engines->imc_fd, 2, val);
>   		update_sample(&engines->imc_reads, val);
> @@ -677,6 +713,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engine->sema, val);
>   		update_sample(&engine->wait, val);
>   	}
> +
> +	if (engines->num_rapl) {
> +		pmu_read_multi(engines->rapl_fd, engines->num_rapl, val);
> +		update_sample(&engines->r_gpu, val);
> +		update_sample(&engines->r_pkg, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1076,14 +1118,14 @@ print_header(const struct igt_device_card *card,
>   		.items = rc6_items,
>   	};
>   	struct cnt_item power_items[] = {
> -		{ &engines->rapl, 4, 2, 1.0, t, engines->rapl_scale, "value",
> -		  "W" },
> +		{ &engines->r_gpu, 4, 2, 1.0, t, engines->r_gpu.scale, "GPU", "gpu" },
> +		{ &engines->r_pkg, 4, 2, 1.0, t, engines->r_pkg.scale, "Package", "pkg" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit", "W" },
>   		{ },
>   	};
>   	struct cnt_group power_group = {
>   		.name = "power",
> -		.display_name = "Power",
> +		.display_name = "Power W",
>   		.items = power_items,
>   	};
>   	struct cnt_group *groups[] = {
> @@ -1108,17 +1150,17 @@ print_header(const struct igt_device_card *card,
>   
>   		if (lines++ < con_h) {
>   			printf("intel-gpu-top: %s - ", card->card);
> -			if (!engines->discrete)
> -				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
> -					freq_items[1].buf, freq_items[0].buf,
> -					rc6_items[0].buf, power_items[0].buf,
> -					engines->rapl_unit,
> -					irq_items[0].buf);
> -			else
> -				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
> -					freq_items[1].buf, freq_items[0].buf,
> -					rc6_items[0].buf, irq_items[0].buf);
> +			printf("%s/%s MHz;  %s%% RC6; ",
> +			       freq_items[1].buf, freq_items[0].buf,
> +			       rc6_items[0].buf);
> +			if (engines->r_gpu.present) {
> +				printf("%s/%s W; ",
> +				       power_items[0].buf,
> +				       power_items[1].buf);
> +			}
> +			printf("%s irqs/s\n", irq_items[0].buf);
>   		}
> +
>   		if (lines++ < con_h)
>   			printf("\n");
>   	}
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-24 23:27 ` [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter Chris Wilson
@ 2020-11-25  8:58   ` Tvrtko Ursulin
  2020-11-25 10:04     ` [igt-dev] " Chris Wilson
  2020-11-25 10:35   ` [Intel-gfx] " Chris Wilson
  2 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25  8:58 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 24/11/2020 23:27, Chris Wilson wrote:
> Follow the same pattern as rapl for imc, and consolidate everything to
> work on struct pmu_counter.

Looks nicer than before. Could you also do a common helper for imc_parse 
and rapl_parse, since only the pmu name string would be different and 
path could easily be constructed in the existing buf?

Regards,

Tvrtko

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 249 ++++++++++++++----------------------------
>   1 file changed, 82 insertions(+), 167 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 0a49cfecc..9af1c29b6 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -55,6 +55,7 @@ struct pmu_counter {
>   	unsigned int idx;
>   	struct pmu_pair val;
>   	double scale;
> +	const char *units;
>   	bool present;
>   };
>   
> @@ -85,17 +86,14 @@ struct engines {
>   	unsigned int num_rapl;
>   
>   	int imc_fd;
> -	double imc_reads_scale;
> -	const char *imc_reads_unit;
> -	double imc_writes_scale;
> -	const char *imc_writes_unit;
> +	struct pmu_counter imc_reads;
> +	struct pmu_counter imc_writes;
> +	unsigned int num_imc;
>   
>   	struct pmu_counter freq_req;
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter imc_reads;
> -	struct pmu_counter imc_writes;
>   
>   	bool discrete;
>   	char *device;
> @@ -400,146 +398,93 @@ static struct engines *discover_engines(char *device)
>   	return engines;
>   }
>   
> -static int
> -filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
> -{
> -	int fd, err;
> -	ssize_t ret;
> -
> -	fd = open(filename, O_RDONLY);
> -	if (fd < 0)
> -		return -1;
> -
> -	ret = read(fd, buf, bufsize - 1);
> -	err = errno;
> -	close(fd);
> -	if (ret < 1) {
> -		errno = ret < 0 ? err : ENOMSG;
> -
> -		return -1;
> -	}
> +#define _open_pmu(type, cnt, pmu, fd) \
> +({ \
> +	int fd__; \
> +\
> +	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> +	if (fd__ >= 0) { \
> +		if ((fd) == -1) \
> +			(fd) = fd__; \
> +		(pmu)->present = true; \
> +		(pmu)->idx = (cnt)++; \
> +	} \
> +\
> +	fd__; \
> +})
>   
> -	if (ret > 1 && buf[ret - 1] == '\n')
> -		buf[ret - 1] = '\0';
> -	else
> -		buf[ret] = '\0';
> +static int imc_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	locale_t locale, oldlocale;
> +	bool result = true;
> +	char buf[128] = {};
> +	int dir;
>   
> -	return 0;
> -}
> +	dir = open("/sys/devices/uncore_imc", O_RDONLY);
> +	if (dir < 0)
> +		return -errno;
>   
> -static uint64_t filename_to_u64(const char *filename, int base)
> -{
> -	char buf[64], *b;
> +	/* Replace user environment with plain C to match kernel format */
> +	locale = newlocale(LC_ALL, "C", 0);
> +	oldlocale = uselocale(locale);
>   
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> +	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
>   
> -	/*
> -	 * Handle both single integer and key=value formats by skipping
> -	 * leading non-digits.
> -	 */
> -	b = buf;
> -	while (*b && !isdigit(*b))
> -		b++;
> +	snprintf(buf, sizeof(buf) - 1, "events/%s", str);
> +	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
>   
> -	return strtoull(b, NULL, base);
> -}
> +	snprintf(buf, sizeof(buf) - 1, "events/%s.scale", str);
> +	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
>   
> -static double filename_to_double(const char *filename)
> -{
> -	char *oldlocale;
> -	char buf[80];
> -	double v;
> +	snprintf(buf, sizeof(buf) - 1, "events/%s.unit", str);
> +	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
> +	pmu->units = strdup(buf);
>   
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> +	uselocale(oldlocale);
> +	freelocale(locale);
>   
> -	oldlocale = setlocale(LC_ALL, "C");
> -	v = strtod(buf, NULL);
> -	setlocale(LC_ALL, oldlocale);
> +	close(dir);
>   
> -	return v;
> -}
> +	if (!result)
> +		return -EINVAL;
>   
> -#define IMC_ROOT "/sys/devices/uncore_imc/"
> -#define IMC_EVENT "/sys/devices/uncore_imc/events/"
> +	if (isnan(pmu->scale) || !pmu->scale)
> +		return -ERANGE;
>   
> -static uint64_t imc_type_id(void)
> -{
> -	return filename_to_u64(IMC_ROOT "type", 10);
> +	return 0;
>   }
>   
> -static uint64_t imc_data_reads(void)
> +static void
> +imc_open(struct pmu_counter *pmu,
> +	 const char *domain,
> +	 struct engines *engines)
>   {
> -	return filename_to_u64(IMC_EVENT "data_reads", 0);
> -}
> +	int fd;
>   
> -static double imc_data_reads_scale(void)
> -{
> -	return filename_to_double(IMC_EVENT "data_reads.scale");
> -}
> +	if (imc_parse(pmu, domain) < 0)
> +		return;
>   
> -static const char *imc_data_reads_unit(void)
> -{
> -	char buf[32];
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
> +	if (fd < 0)
> +		return;
>   
> -	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> -}
> +	if (engines->imc_fd == -1)
> +		engines->imc_fd = fd;
>   
> -static uint64_t imc_data_writes(void)
> -{
> -	return filename_to_u64(IMC_EVENT "data_writes", 0);
> +	pmu->idx = engines->num_imc++;
> +	pmu->present = true;
>   }
>   
> -static double imc_data_writes_scale(void)
> +static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	return filename_to_double(IMC_EVENT "data_writes.scale");
> +	imc_open(pmu, "data_writes", engines);
>   }
>   
> -static const char *imc_data_writes_unit(void)
> +static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	char buf[32];
> -
> -	if (filename_to_buf(IMC_EVENT "data_writes.unit",
> -			    buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> +	imc_open(pmu, "data_reads", engines);
>   }
>   
> -#define _open_pmu(type, cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
> -#define _open_imc(cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
>   static int pmu_init(struct engines *engines)
>   {
>   	unsigned int i;
> @@ -595,38 +540,8 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->imc_fd = -1;
> -	if (imc_type_id()) {
> -		unsigned int num = 0;
> -
> -		engines->imc_reads_scale = imc_data_reads_scale();
> -		engines->imc_writes_scale = imc_data_writes_scale();
> -
> -		engines->imc_reads_unit = imc_data_reads_unit();
> -		if (!engines->imc_reads_unit)
> -			return -1;
> -
> -		engines->imc_writes_unit = imc_data_writes_unit();
> -		if (!engines->imc_writes_unit)
> -			return -1;
> -
> -		engines->imc_reads.config = imc_data_reads();
> -		if (!engines->imc_reads.config)
> -			return -1;
> -
> -		engines->imc_writes.config = imc_data_writes();
> -		if (!engines->imc_writes.config)
> -			return -1;
> -
> -		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -
> -		engines->imc_reads.present = true;
> -		engines->imc_writes.present = true;
> -	}
> +	imc_reads_open(&engines->imc_reads, engines);
> +	imc_writes_open(&engines->imc_writes, engines);
>   
>   	return 0;
>   }
> @@ -692,13 +607,6 @@ static void pmu_sample(struct engines *engines)
>   	unsigned int i;
>   
>   	engines->ts.prev = engines->ts.cur;
> -
> -	if (engines->imc_fd >= 0) {
> -		pmu_read_multi(engines->imc_fd, 2, val);
> -		update_sample(&engines->imc_reads, val);
> -		update_sample(&engines->imc_writes, val);
> -	}
> -
>   	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
>   
>   	update_sample(&engines->freq_req, val);
> @@ -719,6 +627,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engines->r_gpu, val);
>   		update_sample(&engines->r_pkg, val);
>   	}
> +
> +	if (engines->num_imc) {
> +		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
> +		update_sample(&engines->imc_reads, val);
> +		update_sample(&engines->imc_writes, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1172,9 +1086,9 @@ static int
>   print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   {
>   	struct cnt_item imc_items[] = {
> -		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
> +		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
>   		  "reads", "rd" },
> -		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
> +		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
>   		  "writes", "wr" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
>   		{ },
> @@ -1189,12 +1103,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	};
>   	int ret;
>   
> +	if (!engines->num_imc)
> +		return lines;
> +
>   	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	print_groups(groups);
> @@ -1205,11 +1122,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	if (output_mode == INTERACTIVE) {
>   		if (lines++ < con_h)
>   			printf("      IMC reads:   %s %s/s\n",
> -			       imc_items[0].buf, engines->imc_reads_unit);
> +			       imc_items[0].buf, engines->imc_reads.units);
>   
>   		if (lines++ < con_h)
>   			printf("     IMC writes:   %s %s/s\n",
> -			       imc_items[1].buf, engines->imc_writes_unit);
> +			       imc_items[1].buf, engines->imc_writes.units);
>   
>   		if (lines++ < con_h)
>   			printf("\n");
> @@ -1509,9 +1426,7 @@ int main(int argc, char **argv)
>   					     t, lines, con_w, con_h,
>   					     &consumed);
>   
> -			if (engines->imc_fd)
> -				lines = print_imc(engines, t, lines, con_w,
> -						  con_h);
> +			lines = print_imc(engines, t, lines, con_w, con_h);
>   
>   			lines = print_engines_header(engines, t, lines, con_w,
>   						     con_h);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Intel-gfx] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-24 23:27 ` [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter Chris Wilson
@ 2020-11-25 10:04     ` Chris Wilson
  2020-11-25 10:04     ` [igt-dev] " Chris Wilson
  2020-11-25 10:35   ` [Intel-gfx] " Chris Wilson
  2 siblings, 0 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-25 10:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Follow the same pattern as rapl for imc, and consolidate everything to
work on struct pmu_counter.

v2: Combine rapl_parse/imc_parse into pmu_parse

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 248 +++++++++++-------------------------------
 1 file changed, 65 insertions(+), 183 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 0a49cfecc..ffdac280c 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -55,6 +55,7 @@ struct pmu_counter {
 	unsigned int idx;
 	struct pmu_pair val;
 	double scale;
+	const char *units;
 	bool present;
 };
 
@@ -85,17 +86,14 @@ struct engines {
 	unsigned int num_rapl;
 
 	int imc_fd;
-	double imc_reads_scale;
-	const char *imc_reads_unit;
-	double imc_writes_scale;
-	const char *imc_writes_unit;
+	struct pmu_counter imc_reads;
+	struct pmu_counter imc_writes;
+	unsigned int num_imc;
 
 	struct pmu_counter freq_req;
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter imc_reads;
-	struct pmu_counter imc_writes;
 
 	bool discrete;
 	char *device;
@@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
 	return ret;
 }
 
-static int rapl_parse(struct pmu_counter *pmu, const char *str)
+static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
 {
 	locale_t locale, oldlocale;
 	bool result = true;
 	char buf[128] = {};
 	int dir;
 
-	dir = open("/sys/devices/power", O_RDONLY);
+	dir = open(path, O_RDONLY);
 	if (dir < 0)
 		return -errno;
 
@@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
 
 	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
-	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
-	    strcmp(buf, "Joules"))
-		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
-			str, buf);
+	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
+	pmu->units = strdup(buf);
 
 	uselocale(oldlocale);
 	freelocale(locale);
@@ -179,6 +175,11 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	return 0;
 }
 
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	return pmu_parse(pmu, "/sys/devices/power", str);
+}
+
 static void
 rapl_open(struct pmu_counter *pmu,
 	  const char *domain,
@@ -400,146 +401,57 @@ static struct engines *discover_engines(char *device)
 	return engines;
 }
 
-static int
-filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
-{
-	int fd, err;
-	ssize_t ret;
-
-	fd = open(filename, O_RDONLY);
-	if (fd < 0)
-		return -1;
-
-	ret = read(fd, buf, bufsize - 1);
-	err = errno;
-	close(fd);
-	if (ret < 1) {
-		errno = ret < 0 ? err : ENOMSG;
-
-		return -1;
-	}
-
-	if (ret > 1 && buf[ret - 1] == '\n')
-		buf[ret - 1] = '\0';
-	else
-		buf[ret] = '\0';
-
-	return 0;
-}
-
-static uint64_t filename_to_u64(const char *filename, int base)
-{
-	char buf[64], *b;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	/*
-	 * Handle both single integer and key=value formats by skipping
-	 * leading non-digits.
-	 */
-	b = buf;
-	while (*b && !isdigit(*b))
-		b++;
-
-	return strtoull(b, NULL, base);
-}
-
-static double filename_to_double(const char *filename)
-{
-	char *oldlocale;
-	char buf[80];
-	double v;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	oldlocale = setlocale(LC_ALL, "C");
-	v = strtod(buf, NULL);
-	setlocale(LC_ALL, oldlocale);
-
-	return v;
-}
-
-#define IMC_ROOT "/sys/devices/uncore_imc/"
-#define IMC_EVENT "/sys/devices/uncore_imc/events/"
+#define _open_pmu(type, cnt, pmu, fd) \
+({ \
+	int fd__; \
+\
+	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
+	if (fd__ >= 0) { \
+		if ((fd) == -1) \
+			(fd) = fd__; \
+		(pmu)->present = true; \
+		(pmu)->idx = (cnt)++; \
+	} \
+\
+	fd__; \
+})
 
-static uint64_t imc_type_id(void)
+static int imc_parse(struct pmu_counter *pmu, const char *str)
 {
-	return filename_to_u64(IMC_ROOT "type", 10);
+	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
 }
 
-static uint64_t imc_data_reads(void)
+static void
+imc_open(struct pmu_counter *pmu,
+	 const char *domain,
+	 struct engines *engines)
 {
-	return filename_to_u64(IMC_EVENT "data_reads", 0);
-}
+	int fd;
 
-static double imc_data_reads_scale(void)
-{
-	return filename_to_double(IMC_EVENT "data_reads.scale");
-}
+	if (imc_parse(pmu, domain) < 0)
+		return;
 
-static const char *imc_data_reads_unit(void)
-{
-	char buf[32];
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
+	if (fd < 0)
+		return;
 
-	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
-}
+	if (engines->imc_fd == -1)
+		engines->imc_fd = fd;
 
-static uint64_t imc_data_writes(void)
-{
-	return filename_to_u64(IMC_EVENT "data_writes", 0);
+	pmu->idx = engines->num_imc++;
+	pmu->present = true;
 }
 
-static double imc_data_writes_scale(void)
+static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	return filename_to_double(IMC_EVENT "data_writes.scale");
+	imc_open(pmu, "data_writes", engines);
 }
 
-static const char *imc_data_writes_unit(void)
+static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	char buf[32];
-
-	if (filename_to_buf(IMC_EVENT "data_writes.unit",
-			    buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
+	imc_open(pmu, "data_reads", engines);
 }
 
-#define _open_pmu(type, cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
-#define _open_imc(cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
 static int pmu_init(struct engines *engines)
 {
 	unsigned int i;
@@ -595,38 +507,8 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->imc_fd = -1;
-	if (imc_type_id()) {
-		unsigned int num = 0;
-
-		engines->imc_reads_scale = imc_data_reads_scale();
-		engines->imc_writes_scale = imc_data_writes_scale();
-
-		engines->imc_reads_unit = imc_data_reads_unit();
-		if (!engines->imc_reads_unit)
-			return -1;
-
-		engines->imc_writes_unit = imc_data_writes_unit();
-		if (!engines->imc_writes_unit)
-			return -1;
-
-		engines->imc_reads.config = imc_data_reads();
-		if (!engines->imc_reads.config)
-			return -1;
-
-		engines->imc_writes.config = imc_data_writes();
-		if (!engines->imc_writes.config)
-			return -1;
-
-		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-
-		engines->imc_reads.present = true;
-		engines->imc_writes.present = true;
-	}
+	imc_reads_open(&engines->imc_reads, engines);
+	imc_writes_open(&engines->imc_writes, engines);
 
 	return 0;
 }
@@ -692,13 +574,6 @@ static void pmu_sample(struct engines *engines)
 	unsigned int i;
 
 	engines->ts.prev = engines->ts.cur;
-
-	if (engines->imc_fd >= 0) {
-		pmu_read_multi(engines->imc_fd, 2, val);
-		update_sample(&engines->imc_reads, val);
-		update_sample(&engines->imc_writes, val);
-	}
-
 	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
 
 	update_sample(&engines->freq_req, val);
@@ -719,6 +594,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engines->r_gpu, val);
 		update_sample(&engines->r_pkg, val);
 	}
+
+	if (engines->num_imc) {
+		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
+		update_sample(&engines->imc_reads, val);
+		update_sample(&engines->imc_writes, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1172,9 +1053,9 @@ static int
 print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 {
 	struct cnt_item imc_items[] = {
-		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
+		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
 		  "reads", "rd" },
-		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
+		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
 		  "writes", "wr" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
 		{ },
@@ -1189,12 +1070,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	};
 	int ret;
 
+	if (!engines->num_imc)
+		return lines;
+
 	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	print_groups(groups);
@@ -1205,11 +1089,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	if (output_mode == INTERACTIVE) {
 		if (lines++ < con_h)
 			printf("      IMC reads:   %s %s/s\n",
-			       imc_items[0].buf, engines->imc_reads_unit);
+			       imc_items[0].buf, engines->imc_reads.units);
 
 		if (lines++ < con_h)
 			printf("     IMC writes:   %s %s/s\n",
-			       imc_items[1].buf, engines->imc_writes_unit);
+			       imc_items[1].buf, engines->imc_writes.units);
 
 		if (lines++ < con_h)
 			printf("\n");
@@ -1509,9 +1393,7 @@ int main(int argc, char **argv)
 					     t, lines, con_w, con_h,
 					     &consumed);
 
-			if (engines->imc_fd)
-				lines = print_imc(engines, t, lines, con_w,
-						  con_h);
+			lines = print_imc(engines, t, lines, con_w, con_h);
 
 			lines = print_engines_header(engines, t, lines, con_w,
 						     con_h);
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
@ 2020-11-25 10:04     ` Chris Wilson
  0 siblings, 0 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-25 10:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin, Chris Wilson

Follow the same pattern as rapl for imc, and consolidate everything to
work on struct pmu_counter.

v2: Combine rapl_parse/imc_parse into pmu_parse

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 248 +++++++++++-------------------------------
 1 file changed, 65 insertions(+), 183 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 0a49cfecc..ffdac280c 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -55,6 +55,7 @@ struct pmu_counter {
 	unsigned int idx;
 	struct pmu_pair val;
 	double scale;
+	const char *units;
 	bool present;
 };
 
@@ -85,17 +86,14 @@ struct engines {
 	unsigned int num_rapl;
 
 	int imc_fd;
-	double imc_reads_scale;
-	const char *imc_reads_unit;
-	double imc_writes_scale;
-	const char *imc_writes_unit;
+	struct pmu_counter imc_reads;
+	struct pmu_counter imc_writes;
+	unsigned int num_imc;
 
 	struct pmu_counter freq_req;
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter imc_reads;
-	struct pmu_counter imc_writes;
 
 	bool discrete;
 	char *device;
@@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
 	return ret;
 }
 
-static int rapl_parse(struct pmu_counter *pmu, const char *str)
+static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
 {
 	locale_t locale, oldlocale;
 	bool result = true;
 	char buf[128] = {};
 	int dir;
 
-	dir = open("/sys/devices/power", O_RDONLY);
+	dir = open(path, O_RDONLY);
 	if (dir < 0)
 		return -errno;
 
@@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
 
 	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
-	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
-	    strcmp(buf, "Joules"))
-		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
-			str, buf);
+	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
+	pmu->units = strdup(buf);
 
 	uselocale(oldlocale);
 	freelocale(locale);
@@ -179,6 +175,11 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	return 0;
 }
 
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	return pmu_parse(pmu, "/sys/devices/power", str);
+}
+
 static void
 rapl_open(struct pmu_counter *pmu,
 	  const char *domain,
@@ -400,146 +401,57 @@ static struct engines *discover_engines(char *device)
 	return engines;
 }
 
-static int
-filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
-{
-	int fd, err;
-	ssize_t ret;
-
-	fd = open(filename, O_RDONLY);
-	if (fd < 0)
-		return -1;
-
-	ret = read(fd, buf, bufsize - 1);
-	err = errno;
-	close(fd);
-	if (ret < 1) {
-		errno = ret < 0 ? err : ENOMSG;
-
-		return -1;
-	}
-
-	if (ret > 1 && buf[ret - 1] == '\n')
-		buf[ret - 1] = '\0';
-	else
-		buf[ret] = '\0';
-
-	return 0;
-}
-
-static uint64_t filename_to_u64(const char *filename, int base)
-{
-	char buf[64], *b;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	/*
-	 * Handle both single integer and key=value formats by skipping
-	 * leading non-digits.
-	 */
-	b = buf;
-	while (*b && !isdigit(*b))
-		b++;
-
-	return strtoull(b, NULL, base);
-}
-
-static double filename_to_double(const char *filename)
-{
-	char *oldlocale;
-	char buf[80];
-	double v;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	oldlocale = setlocale(LC_ALL, "C");
-	v = strtod(buf, NULL);
-	setlocale(LC_ALL, oldlocale);
-
-	return v;
-}
-
-#define IMC_ROOT "/sys/devices/uncore_imc/"
-#define IMC_EVENT "/sys/devices/uncore_imc/events/"
+#define _open_pmu(type, cnt, pmu, fd) \
+({ \
+	int fd__; \
+\
+	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
+	if (fd__ >= 0) { \
+		if ((fd) == -1) \
+			(fd) = fd__; \
+		(pmu)->present = true; \
+		(pmu)->idx = (cnt)++; \
+	} \
+\
+	fd__; \
+})
 
-static uint64_t imc_type_id(void)
+static int imc_parse(struct pmu_counter *pmu, const char *str)
 {
-	return filename_to_u64(IMC_ROOT "type", 10);
+	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
 }
 
-static uint64_t imc_data_reads(void)
+static void
+imc_open(struct pmu_counter *pmu,
+	 const char *domain,
+	 struct engines *engines)
 {
-	return filename_to_u64(IMC_EVENT "data_reads", 0);
-}
+	int fd;
 
-static double imc_data_reads_scale(void)
-{
-	return filename_to_double(IMC_EVENT "data_reads.scale");
-}
+	if (imc_parse(pmu, domain) < 0)
+		return;
 
-static const char *imc_data_reads_unit(void)
-{
-	char buf[32];
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
+	if (fd < 0)
+		return;
 
-	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
-}
+	if (engines->imc_fd == -1)
+		engines->imc_fd = fd;
 
-static uint64_t imc_data_writes(void)
-{
-	return filename_to_u64(IMC_EVENT "data_writes", 0);
+	pmu->idx = engines->num_imc++;
+	pmu->present = true;
 }
 
-static double imc_data_writes_scale(void)
+static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	return filename_to_double(IMC_EVENT "data_writes.scale");
+	imc_open(pmu, "data_writes", engines);
 }
 
-static const char *imc_data_writes_unit(void)
+static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	char buf[32];
-
-	if (filename_to_buf(IMC_EVENT "data_writes.unit",
-			    buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
+	imc_open(pmu, "data_reads", engines);
 }
 
-#define _open_pmu(type, cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
-#define _open_imc(cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
 static int pmu_init(struct engines *engines)
 {
 	unsigned int i;
@@ -595,38 +507,8 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->imc_fd = -1;
-	if (imc_type_id()) {
-		unsigned int num = 0;
-
-		engines->imc_reads_scale = imc_data_reads_scale();
-		engines->imc_writes_scale = imc_data_writes_scale();
-
-		engines->imc_reads_unit = imc_data_reads_unit();
-		if (!engines->imc_reads_unit)
-			return -1;
-
-		engines->imc_writes_unit = imc_data_writes_unit();
-		if (!engines->imc_writes_unit)
-			return -1;
-
-		engines->imc_reads.config = imc_data_reads();
-		if (!engines->imc_reads.config)
-			return -1;
-
-		engines->imc_writes.config = imc_data_writes();
-		if (!engines->imc_writes.config)
-			return -1;
-
-		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-
-		engines->imc_reads.present = true;
-		engines->imc_writes.present = true;
-	}
+	imc_reads_open(&engines->imc_reads, engines);
+	imc_writes_open(&engines->imc_writes, engines);
 
 	return 0;
 }
@@ -692,13 +574,6 @@ static void pmu_sample(struct engines *engines)
 	unsigned int i;
 
 	engines->ts.prev = engines->ts.cur;
-
-	if (engines->imc_fd >= 0) {
-		pmu_read_multi(engines->imc_fd, 2, val);
-		update_sample(&engines->imc_reads, val);
-		update_sample(&engines->imc_writes, val);
-	}
-
 	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
 
 	update_sample(&engines->freq_req, val);
@@ -719,6 +594,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engines->r_gpu, val);
 		update_sample(&engines->r_pkg, val);
 	}
+
+	if (engines->num_imc) {
+		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
+		update_sample(&engines->imc_reads, val);
+		update_sample(&engines->imc_writes, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1172,9 +1053,9 @@ static int
 print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 {
 	struct cnt_item imc_items[] = {
-		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
+		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
 		  "reads", "rd" },
-		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
+		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
 		  "writes", "wr" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
 		{ },
@@ -1189,12 +1070,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	};
 	int ret;
 
+	if (!engines->num_imc)
+		return lines;
+
 	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	print_groups(groups);
@@ -1205,11 +1089,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	if (output_mode == INTERACTIVE) {
 		if (lines++ < con_h)
 			printf("      IMC reads:   %s %s/s\n",
-			       imc_items[0].buf, engines->imc_reads_unit);
+			       imc_items[0].buf, engines->imc_reads.units);
 
 		if (lines++ < con_h)
 			printf("     IMC writes:   %s %s/s\n",
-			       imc_items[1].buf, engines->imc_writes_unit);
+			       imc_items[1].buf, engines->imc_writes.units);
 
 		if (lines++ < con_h)
 			printf("\n");
@@ -1509,9 +1393,7 @@ int main(int argc, char **argv)
 					     t, lines, con_w, con_h,
 					     &consumed);
 
-			if (engines->imc_fd)
-				lines = print_imc(engines, t, lines, con_w,
-						  con_h);
+			lines = print_imc(engines, t, lines, con_w, con_h);
 
 			lines = print_engines_header(engines, t, lines, con_w,
 						     con_h);
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-25 10:04     ` [igt-dev] " Chris Wilson
@ 2020-11-25 10:17       ` Tvrtko Ursulin
  -1 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25 10:17 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 25/11/2020 10:04, Chris Wilson wrote:
> Follow the same pattern as rapl for imc, and consolidate everything to
> work on struct pmu_counter.
> 
> v2: Combine rapl_parse/imc_parse into pmu_parse
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 248 +++++++++++-------------------------------
>   1 file changed, 65 insertions(+), 183 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 0a49cfecc..ffdac280c 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -55,6 +55,7 @@ struct pmu_counter {
>   	unsigned int idx;
>   	struct pmu_pair val;
>   	double scale;
> +	const char *units;
>   	bool present;
>   };
>   
> @@ -85,17 +86,14 @@ struct engines {
>   	unsigned int num_rapl;
>   
>   	int imc_fd;
> -	double imc_reads_scale;
> -	const char *imc_reads_unit;
> -	double imc_writes_scale;
> -	const char *imc_writes_unit;
> +	struct pmu_counter imc_reads;
> +	struct pmu_counter imc_writes;
> +	unsigned int num_imc;
>   
>   	struct pmu_counter freq_req;
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter imc_reads;
> -	struct pmu_counter imc_writes;
>   
>   	bool discrete;
>   	char *device;
> @@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
>   	return ret;
>   }
>   
> -static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
>   {
>   	locale_t locale, oldlocale;
>   	bool result = true;
>   	char buf[128] = {};
>   	int dir;
>   
> -	dir = open("/sys/devices/power", O_RDONLY);
> +	dir = open(path, O_RDONLY);
>   	if (dir < 0)
>   		return -errno;
>   
> @@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
>   
>   	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
> -	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
> -	    strcmp(buf, "Joules"))
> -		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
> -			str, buf);

Maybe keep the unit check in rapl_parse?

Regards,

Tvrtko

> +	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
> +	pmu->units = strdup(buf);
>   
>   	uselocale(oldlocale);
>   	freelocale(locale);
> @@ -179,6 +175,11 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	return 0;
>   }
>   
> +static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	return pmu_parse(pmu, "/sys/devices/power", str);
> +}
> +
>   static void
>   rapl_open(struct pmu_counter *pmu,
>   	  const char *domain,
> @@ -400,146 +401,57 @@ static struct engines *discover_engines(char *device)
>   	return engines;
>   }
>   
> -static int
> -filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
> -{
> -	int fd, err;
> -	ssize_t ret;
> -
> -	fd = open(filename, O_RDONLY);
> -	if (fd < 0)
> -		return -1;
> -
> -	ret = read(fd, buf, bufsize - 1);
> -	err = errno;
> -	close(fd);
> -	if (ret < 1) {
> -		errno = ret < 0 ? err : ENOMSG;
> -
> -		return -1;
> -	}
> -
> -	if (ret > 1 && buf[ret - 1] == '\n')
> -		buf[ret - 1] = '\0';
> -	else
> -		buf[ret] = '\0';
> -
> -	return 0;
> -}
> -
> -static uint64_t filename_to_u64(const char *filename, int base)
> -{
> -	char buf[64], *b;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	/*
> -	 * Handle both single integer and key=value formats by skipping
> -	 * leading non-digits.
> -	 */
> -	b = buf;
> -	while (*b && !isdigit(*b))
> -		b++;
> -
> -	return strtoull(b, NULL, base);
> -}
> -
> -static double filename_to_double(const char *filename)
> -{
> -	char *oldlocale;
> -	char buf[80];
> -	double v;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	oldlocale = setlocale(LC_ALL, "C");
> -	v = strtod(buf, NULL);
> -	setlocale(LC_ALL, oldlocale);
> -
> -	return v;
> -}
> -
> -#define IMC_ROOT "/sys/devices/uncore_imc/"
> -#define IMC_EVENT "/sys/devices/uncore_imc/events/"
> +#define _open_pmu(type, cnt, pmu, fd) \
> +({ \
> +	int fd__; \
> +\
> +	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> +	if (fd__ >= 0) { \
> +		if ((fd) == -1) \
> +			(fd) = fd__; \
> +		(pmu)->present = true; \
> +		(pmu)->idx = (cnt)++; \
> +	} \
> +\
> +	fd__; \
> +})
>   
> -static uint64_t imc_type_id(void)
> +static int imc_parse(struct pmu_counter *pmu, const char *str)
>   {
> -	return filename_to_u64(IMC_ROOT "type", 10);
> +	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
>   }
>   
> -static uint64_t imc_data_reads(void)
> +static void
> +imc_open(struct pmu_counter *pmu,
> +	 const char *domain,
> +	 struct engines *engines)
>   {
> -	return filename_to_u64(IMC_EVENT "data_reads", 0);
> -}
> +	int fd;
>   
> -static double imc_data_reads_scale(void)
> -{
> -	return filename_to_double(IMC_EVENT "data_reads.scale");
> -}
> +	if (imc_parse(pmu, domain) < 0)
> +		return;
>   
> -static const char *imc_data_reads_unit(void)
> -{
> -	char buf[32];
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
> +	if (fd < 0)
> +		return;
>   
> -	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> -}
> +	if (engines->imc_fd == -1)
> +		engines->imc_fd = fd;
>   
> -static uint64_t imc_data_writes(void)
> -{
> -	return filename_to_u64(IMC_EVENT "data_writes", 0);
> +	pmu->idx = engines->num_imc++;
> +	pmu->present = true;
>   }
>   
> -static double imc_data_writes_scale(void)
> +static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	return filename_to_double(IMC_EVENT "data_writes.scale");
> +	imc_open(pmu, "data_writes", engines);
>   }
>   
> -static const char *imc_data_writes_unit(void)
> +static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	char buf[32];
> -
> -	if (filename_to_buf(IMC_EVENT "data_writes.unit",
> -			    buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> +	imc_open(pmu, "data_reads", engines);
>   }
>   
> -#define _open_pmu(type, cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
> -#define _open_imc(cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
>   static int pmu_init(struct engines *engines)
>   {
>   	unsigned int i;
> @@ -595,38 +507,8 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->imc_fd = -1;
> -	if (imc_type_id()) {
> -		unsigned int num = 0;
> -
> -		engines->imc_reads_scale = imc_data_reads_scale();
> -		engines->imc_writes_scale = imc_data_writes_scale();
> -
> -		engines->imc_reads_unit = imc_data_reads_unit();
> -		if (!engines->imc_reads_unit)
> -			return -1;
> -
> -		engines->imc_writes_unit = imc_data_writes_unit();
> -		if (!engines->imc_writes_unit)
> -			return -1;
> -
> -		engines->imc_reads.config = imc_data_reads();
> -		if (!engines->imc_reads.config)
> -			return -1;
> -
> -		engines->imc_writes.config = imc_data_writes();
> -		if (!engines->imc_writes.config)
> -			return -1;
> -
> -		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -
> -		engines->imc_reads.present = true;
> -		engines->imc_writes.present = true;
> -	}
> +	imc_reads_open(&engines->imc_reads, engines);
> +	imc_writes_open(&engines->imc_writes, engines);
>   
>   	return 0;
>   }
> @@ -692,13 +574,6 @@ static void pmu_sample(struct engines *engines)
>   	unsigned int i;
>   
>   	engines->ts.prev = engines->ts.cur;
> -
> -	if (engines->imc_fd >= 0) {
> -		pmu_read_multi(engines->imc_fd, 2, val);
> -		update_sample(&engines->imc_reads, val);
> -		update_sample(&engines->imc_writes, val);
> -	}
> -
>   	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
>   
>   	update_sample(&engines->freq_req, val);
> @@ -719,6 +594,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engines->r_gpu, val);
>   		update_sample(&engines->r_pkg, val);
>   	}
> +
> +	if (engines->num_imc) {
> +		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
> +		update_sample(&engines->imc_reads, val);
> +		update_sample(&engines->imc_writes, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1172,9 +1053,9 @@ static int
>   print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   {
>   	struct cnt_item imc_items[] = {
> -		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
> +		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
>   		  "reads", "rd" },
> -		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
> +		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
>   		  "writes", "wr" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
>   		{ },
> @@ -1189,12 +1070,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	};
>   	int ret;
>   
> +	if (!engines->num_imc)
> +		return lines;
> +
>   	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	print_groups(groups);
> @@ -1205,11 +1089,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	if (output_mode == INTERACTIVE) {
>   		if (lines++ < con_h)
>   			printf("      IMC reads:   %s %s/s\n",
> -			       imc_items[0].buf, engines->imc_reads_unit);
> +			       imc_items[0].buf, engines->imc_reads.units);
>   
>   		if (lines++ < con_h)
>   			printf("     IMC writes:   %s %s/s\n",
> -			       imc_items[1].buf, engines->imc_writes_unit);
> +			       imc_items[1].buf, engines->imc_writes.units);
>   
>   		if (lines++ < con_h)
>   			printf("\n");
> @@ -1509,9 +1393,7 @@ int main(int argc, char **argv)
>   					     t, lines, con_w, con_h,
>   					     &consumed);
>   
> -			if (engines->imc_fd)
> -				lines = print_imc(engines, t, lines, con_w,
> -						  con_h);
> +			lines = print_imc(engines, t, lines, con_w, con_h);
>   
>   			lines = print_engines_header(engines, t, lines, con_w,
>   						     con_h);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
@ 2020-11-25 10:17       ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25 10:17 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev, Tvrtko Ursulin


On 25/11/2020 10:04, Chris Wilson wrote:
> Follow the same pattern as rapl for imc, and consolidate everything to
> work on struct pmu_counter.
> 
> v2: Combine rapl_parse/imc_parse into pmu_parse
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 248 +++++++++++-------------------------------
>   1 file changed, 65 insertions(+), 183 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 0a49cfecc..ffdac280c 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -55,6 +55,7 @@ struct pmu_counter {
>   	unsigned int idx;
>   	struct pmu_pair val;
>   	double scale;
> +	const char *units;
>   	bool present;
>   };
>   
> @@ -85,17 +86,14 @@ struct engines {
>   	unsigned int num_rapl;
>   
>   	int imc_fd;
> -	double imc_reads_scale;
> -	const char *imc_reads_unit;
> -	double imc_writes_scale;
> -	const char *imc_writes_unit;
> +	struct pmu_counter imc_reads;
> +	struct pmu_counter imc_writes;
> +	unsigned int num_imc;
>   
>   	struct pmu_counter freq_req;
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter imc_reads;
> -	struct pmu_counter imc_writes;
>   
>   	bool discrete;
>   	char *device;
> @@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
>   	return ret;
>   }
>   
> -static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
>   {
>   	locale_t locale, oldlocale;
>   	bool result = true;
>   	char buf[128] = {};
>   	int dir;
>   
> -	dir = open("/sys/devices/power", O_RDONLY);
> +	dir = open(path, O_RDONLY);
>   	if (dir < 0)
>   		return -errno;
>   
> @@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
>   
>   	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
> -	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
> -	    strcmp(buf, "Joules"))
> -		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
> -			str, buf);

Maybe keep the unit check in rapl_parse?

Regards,

Tvrtko

> +	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
> +	pmu->units = strdup(buf);
>   
>   	uselocale(oldlocale);
>   	freelocale(locale);
> @@ -179,6 +175,11 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	return 0;
>   }
>   
> +static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	return pmu_parse(pmu, "/sys/devices/power", str);
> +}
> +
>   static void
>   rapl_open(struct pmu_counter *pmu,
>   	  const char *domain,
> @@ -400,146 +401,57 @@ static struct engines *discover_engines(char *device)
>   	return engines;
>   }
>   
> -static int
> -filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
> -{
> -	int fd, err;
> -	ssize_t ret;
> -
> -	fd = open(filename, O_RDONLY);
> -	if (fd < 0)
> -		return -1;
> -
> -	ret = read(fd, buf, bufsize - 1);
> -	err = errno;
> -	close(fd);
> -	if (ret < 1) {
> -		errno = ret < 0 ? err : ENOMSG;
> -
> -		return -1;
> -	}
> -
> -	if (ret > 1 && buf[ret - 1] == '\n')
> -		buf[ret - 1] = '\0';
> -	else
> -		buf[ret] = '\0';
> -
> -	return 0;
> -}
> -
> -static uint64_t filename_to_u64(const char *filename, int base)
> -{
> -	char buf[64], *b;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	/*
> -	 * Handle both single integer and key=value formats by skipping
> -	 * leading non-digits.
> -	 */
> -	b = buf;
> -	while (*b && !isdigit(*b))
> -		b++;
> -
> -	return strtoull(b, NULL, base);
> -}
> -
> -static double filename_to_double(const char *filename)
> -{
> -	char *oldlocale;
> -	char buf[80];
> -	double v;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	oldlocale = setlocale(LC_ALL, "C");
> -	v = strtod(buf, NULL);
> -	setlocale(LC_ALL, oldlocale);
> -
> -	return v;
> -}
> -
> -#define IMC_ROOT "/sys/devices/uncore_imc/"
> -#define IMC_EVENT "/sys/devices/uncore_imc/events/"
> +#define _open_pmu(type, cnt, pmu, fd) \
> +({ \
> +	int fd__; \
> +\
> +	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> +	if (fd__ >= 0) { \
> +		if ((fd) == -1) \
> +			(fd) = fd__; \
> +		(pmu)->present = true; \
> +		(pmu)->idx = (cnt)++; \
> +	} \
> +\
> +	fd__; \
> +})
>   
> -static uint64_t imc_type_id(void)
> +static int imc_parse(struct pmu_counter *pmu, const char *str)
>   {
> -	return filename_to_u64(IMC_ROOT "type", 10);
> +	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
>   }
>   
> -static uint64_t imc_data_reads(void)
> +static void
> +imc_open(struct pmu_counter *pmu,
> +	 const char *domain,
> +	 struct engines *engines)
>   {
> -	return filename_to_u64(IMC_EVENT "data_reads", 0);
> -}
> +	int fd;
>   
> -static double imc_data_reads_scale(void)
> -{
> -	return filename_to_double(IMC_EVENT "data_reads.scale");
> -}
> +	if (imc_parse(pmu, domain) < 0)
> +		return;
>   
> -static const char *imc_data_reads_unit(void)
> -{
> -	char buf[32];
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
> +	if (fd < 0)
> +		return;
>   
> -	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> -}
> +	if (engines->imc_fd == -1)
> +		engines->imc_fd = fd;
>   
> -static uint64_t imc_data_writes(void)
> -{
> -	return filename_to_u64(IMC_EVENT "data_writes", 0);
> +	pmu->idx = engines->num_imc++;
> +	pmu->present = true;
>   }
>   
> -static double imc_data_writes_scale(void)
> +static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	return filename_to_double(IMC_EVENT "data_writes.scale");
> +	imc_open(pmu, "data_writes", engines);
>   }
>   
> -static const char *imc_data_writes_unit(void)
> +static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	char buf[32];
> -
> -	if (filename_to_buf(IMC_EVENT "data_writes.unit",
> -			    buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> +	imc_open(pmu, "data_reads", engines);
>   }
>   
> -#define _open_pmu(type, cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
> -#define _open_imc(cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
>   static int pmu_init(struct engines *engines)
>   {
>   	unsigned int i;
> @@ -595,38 +507,8 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->imc_fd = -1;
> -	if (imc_type_id()) {
> -		unsigned int num = 0;
> -
> -		engines->imc_reads_scale = imc_data_reads_scale();
> -		engines->imc_writes_scale = imc_data_writes_scale();
> -
> -		engines->imc_reads_unit = imc_data_reads_unit();
> -		if (!engines->imc_reads_unit)
> -			return -1;
> -
> -		engines->imc_writes_unit = imc_data_writes_unit();
> -		if (!engines->imc_writes_unit)
> -			return -1;
> -
> -		engines->imc_reads.config = imc_data_reads();
> -		if (!engines->imc_reads.config)
> -			return -1;
> -
> -		engines->imc_writes.config = imc_data_writes();
> -		if (!engines->imc_writes.config)
> -			return -1;
> -
> -		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -
> -		engines->imc_reads.present = true;
> -		engines->imc_writes.present = true;
> -	}
> +	imc_reads_open(&engines->imc_reads, engines);
> +	imc_writes_open(&engines->imc_writes, engines);
>   
>   	return 0;
>   }
> @@ -692,13 +574,6 @@ static void pmu_sample(struct engines *engines)
>   	unsigned int i;
>   
>   	engines->ts.prev = engines->ts.cur;
> -
> -	if (engines->imc_fd >= 0) {
> -		pmu_read_multi(engines->imc_fd, 2, val);
> -		update_sample(&engines->imc_reads, val);
> -		update_sample(&engines->imc_writes, val);
> -	}
> -
>   	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
>   
>   	update_sample(&engines->freq_req, val);
> @@ -719,6 +594,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engines->r_gpu, val);
>   		update_sample(&engines->r_pkg, val);
>   	}
> +
> +	if (engines->num_imc) {
> +		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
> +		update_sample(&engines->imc_reads, val);
> +		update_sample(&engines->imc_writes, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1172,9 +1053,9 @@ static int
>   print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   {
>   	struct cnt_item imc_items[] = {
> -		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
> +		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
>   		  "reads", "rd" },
> -		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
> +		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
>   		  "writes", "wr" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
>   		{ },
> @@ -1189,12 +1070,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	};
>   	int ret;
>   
> +	if (!engines->num_imc)
> +		return lines;
> +
>   	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	print_groups(groups);
> @@ -1205,11 +1089,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	if (output_mode == INTERACTIVE) {
>   		if (lines++ < con_h)
>   			printf("      IMC reads:   %s %s/s\n",
> -			       imc_items[0].buf, engines->imc_reads_unit);
> +			       imc_items[0].buf, engines->imc_reads.units);
>   
>   		if (lines++ < con_h)
>   			printf("     IMC writes:   %s %s/s\n",
> -			       imc_items[1].buf, engines->imc_writes_unit);
> +			       imc_items[1].buf, engines->imc_writes.units);
>   
>   		if (lines++ < con_h)
>   			printf("\n");
> @@ -1509,9 +1393,7 @@ int main(int argc, char **argv)
>   					     t, lines, con_w, con_h,
>   					     &consumed);
>   
> -			if (engines->imc_fd)
> -				lines = print_imc(engines, t, lines, con_w,
> -						  con_h);
> +			lines = print_imc(engines, t, lines, con_w, con_h);
>   
>   			lines = print_engines_header(engines, t, lines, con_w,
>   						     con_h);
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Intel-gfx] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-24 23:27 ` [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter Chris Wilson
  2020-11-25  8:58   ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
  2020-11-25 10:04     ` [igt-dev] " Chris Wilson
@ 2020-11-25 10:35   ` Chris Wilson
  2020-11-25 10:47     ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
  2 siblings, 1 reply; 19+ messages in thread
From: Chris Wilson @ 2020-11-25 10:35 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Follow the same pattern as rapl for imc, and consolidate everything to
work on struct pmu_counter.

v2: Combine rapl_parse/imc_parse into pmu_parse
v3: Keep the error message for RAPL not reporting Joules

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 261 +++++++++++++-----------------------------
 1 file changed, 78 insertions(+), 183 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 0a49cfecc..5d42a2fad 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -55,6 +55,7 @@ struct pmu_counter {
 	unsigned int idx;
 	struct pmu_pair val;
 	double scale;
+	const char *units;
 	bool present;
 };
 
@@ -85,17 +86,14 @@ struct engines {
 	unsigned int num_rapl;
 
 	int imc_fd;
-	double imc_reads_scale;
-	const char *imc_reads_unit;
-	double imc_writes_scale;
-	const char *imc_writes_unit;
+	struct pmu_counter imc_reads;
+	struct pmu_counter imc_writes;
+	unsigned int num_imc;
 
 	struct pmu_counter freq_req;
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter imc_reads;
-	struct pmu_counter imc_writes;
 
 	bool discrete;
 	char *device;
@@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
 	return ret;
 }
 
-static int rapl_parse(struct pmu_counter *pmu, const char *str)
+static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
 {
 	locale_t locale, oldlocale;
 	bool result = true;
 	char buf[128] = {};
 	int dir;
 
-	dir = open("/sys/devices/power", O_RDONLY);
+	dir = open(path, O_RDONLY);
 	if (dir < 0)
 		return -errno;
 
@@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
 
 	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
-	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
-	    strcmp(buf, "Joules"))
-		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
-			str, buf);
+	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
+	pmu->units = strdup(buf);
 
 	uselocale(oldlocale);
 	freelocale(locale);
@@ -179,6 +175,24 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
 	return 0;
 }
 
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	const char *expected_units = "Joules";
+	int err;
+
+	err = pmu_parse(pmu, "/sys/devices/power", str);
+	if (err < 0)
+		return err;
+
+	if (!pmu->units || strcmp(pmu->units, expected_units)) {
+		fprintf(stderr,
+			"Unexpected units for RAPL %s: found '%s', expected '%s'\n",
+			str, pmu->units, expected_units);
+	}
+
+	return 0;
+}
+
 static void
 rapl_open(struct pmu_counter *pmu,
 	  const char *domain,
@@ -400,146 +414,57 @@ static struct engines *discover_engines(char *device)
 	return engines;
 }
 
-static int
-filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
-{
-	int fd, err;
-	ssize_t ret;
-
-	fd = open(filename, O_RDONLY);
-	if (fd < 0)
-		return -1;
-
-	ret = read(fd, buf, bufsize - 1);
-	err = errno;
-	close(fd);
-	if (ret < 1) {
-		errno = ret < 0 ? err : ENOMSG;
-
-		return -1;
-	}
-
-	if (ret > 1 && buf[ret - 1] == '\n')
-		buf[ret - 1] = '\0';
-	else
-		buf[ret] = '\0';
-
-	return 0;
-}
-
-static uint64_t filename_to_u64(const char *filename, int base)
-{
-	char buf[64], *b;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	/*
-	 * Handle both single integer and key=value formats by skipping
-	 * leading non-digits.
-	 */
-	b = buf;
-	while (*b && !isdigit(*b))
-		b++;
-
-	return strtoull(b, NULL, base);
-}
-
-static double filename_to_double(const char *filename)
-{
-	char *oldlocale;
-	char buf[80];
-	double v;
-
-	if (filename_to_buf(filename, buf, sizeof(buf)))
-		return 0;
-
-	oldlocale = setlocale(LC_ALL, "C");
-	v = strtod(buf, NULL);
-	setlocale(LC_ALL, oldlocale);
-
-	return v;
-}
-
-#define IMC_ROOT "/sys/devices/uncore_imc/"
-#define IMC_EVENT "/sys/devices/uncore_imc/events/"
+#define _open_pmu(type, cnt, pmu, fd) \
+({ \
+	int fd__; \
+\
+	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
+	if (fd__ >= 0) { \
+		if ((fd) == -1) \
+			(fd) = fd__; \
+		(pmu)->present = true; \
+		(pmu)->idx = (cnt)++; \
+	} \
+\
+	fd__; \
+})
 
-static uint64_t imc_type_id(void)
+static int imc_parse(struct pmu_counter *pmu, const char *str)
 {
-	return filename_to_u64(IMC_ROOT "type", 10);
+	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
 }
 
-static uint64_t imc_data_reads(void)
+static void
+imc_open(struct pmu_counter *pmu,
+	 const char *domain,
+	 struct engines *engines)
 {
-	return filename_to_u64(IMC_EVENT "data_reads", 0);
-}
+	int fd;
 
-static double imc_data_reads_scale(void)
-{
-	return filename_to_double(IMC_EVENT "data_reads.scale");
-}
+	if (imc_parse(pmu, domain) < 0)
+		return;
 
-static const char *imc_data_reads_unit(void)
-{
-	char buf[32];
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
+	if (fd < 0)
+		return;
 
-	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
-}
+	if (engines->imc_fd == -1)
+		engines->imc_fd = fd;
 
-static uint64_t imc_data_writes(void)
-{
-	return filename_to_u64(IMC_EVENT "data_writes", 0);
+	pmu->idx = engines->num_imc++;
+	pmu->present = true;
 }
 
-static double imc_data_writes_scale(void)
+static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	return filename_to_double(IMC_EVENT "data_writes.scale");
+	imc_open(pmu, "data_writes", engines);
 }
 
-static const char *imc_data_writes_unit(void)
+static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
 {
-	char buf[32];
-
-	if (filename_to_buf(IMC_EVENT "data_writes.unit",
-			    buf, sizeof(buf)) == 0)
-		return strdup(buf);
-	else
-		return NULL;
+	imc_open(pmu, "data_reads", engines);
 }
 
-#define _open_pmu(type, cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
-#define _open_imc(cnt, pmu, fd) \
-({ \
-	int fd__; \
-\
-	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
-	if (fd__ >= 0) { \
-		if ((fd) == -1) \
-			(fd) = fd__; \
-		(pmu)->present = true; \
-		(pmu)->idx = (cnt)++; \
-	} \
-\
-	fd__; \
-})
-
 static int pmu_init(struct engines *engines)
 {
 	unsigned int i;
@@ -595,38 +520,8 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->imc_fd = -1;
-	if (imc_type_id()) {
-		unsigned int num = 0;
-
-		engines->imc_reads_scale = imc_data_reads_scale();
-		engines->imc_writes_scale = imc_data_writes_scale();
-
-		engines->imc_reads_unit = imc_data_reads_unit();
-		if (!engines->imc_reads_unit)
-			return -1;
-
-		engines->imc_writes_unit = imc_data_writes_unit();
-		if (!engines->imc_writes_unit)
-			return -1;
-
-		engines->imc_reads.config = imc_data_reads();
-		if (!engines->imc_reads.config)
-			return -1;
-
-		engines->imc_writes.config = imc_data_writes();
-		if (!engines->imc_writes.config)
-			return -1;
-
-		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
-		if (fd < 0)
-			return -1;
-
-		engines->imc_reads.present = true;
-		engines->imc_writes.present = true;
-	}
+	imc_reads_open(&engines->imc_reads, engines);
+	imc_writes_open(&engines->imc_writes, engines);
 
 	return 0;
 }
@@ -692,13 +587,6 @@ static void pmu_sample(struct engines *engines)
 	unsigned int i;
 
 	engines->ts.prev = engines->ts.cur;
-
-	if (engines->imc_fd >= 0) {
-		pmu_read_multi(engines->imc_fd, 2, val);
-		update_sample(&engines->imc_reads, val);
-		update_sample(&engines->imc_writes, val);
-	}
-
 	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
 
 	update_sample(&engines->freq_req, val);
@@ -719,6 +607,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engines->r_gpu, val);
 		update_sample(&engines->r_pkg, val);
 	}
+
+	if (engines->num_imc) {
+		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
+		update_sample(&engines->imc_reads, val);
+		update_sample(&engines->imc_writes, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1172,9 +1066,9 @@ static int
 print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 {
 	struct cnt_item imc_items[] = {
-		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
+		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
 		  "reads", "rd" },
-		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
+		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
 		  "writes", "wr" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
 		{ },
@@ -1189,12 +1083,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	};
 	int ret;
 
+	if (!engines->num_imc)
+		return lines;
+
 	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
-			engines->imc_reads_unit);
+			engines->imc_reads.units);
 	assert(ret >= 0);
 
 	print_groups(groups);
@@ -1205,11 +1102,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
 	if (output_mode == INTERACTIVE) {
 		if (lines++ < con_h)
 			printf("      IMC reads:   %s %s/s\n",
-			       imc_items[0].buf, engines->imc_reads_unit);
+			       imc_items[0].buf, engines->imc_reads.units);
 
 		if (lines++ < con_h)
 			printf("     IMC writes:   %s %s/s\n",
-			       imc_items[1].buf, engines->imc_writes_unit);
+			       imc_items[1].buf, engines->imc_writes.units);
 
 		if (lines++ < con_h)
 			printf("\n");
@@ -1509,9 +1406,7 @@ int main(int argc, char **argv)
 					     t, lines, con_w, con_h,
 					     &consumed);
 
-			if (engines->imc_fd)
-				lines = print_imc(engines, t, lines, con_w,
-						  con_h);
+			lines = print_imc(engines, t, lines, con_w, con_h);
 
 			lines = print_engines_header(engines, t, lines, con_w,
 						     con_h);
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tools/intel_gpu_top: Consolidate imc to use pmu_counter
  2020-11-25 10:35   ` [Intel-gfx] " Chris Wilson
@ 2020-11-25 10:47     ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2020-11-25 10:47 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 25/11/2020 10:35, Chris Wilson wrote:
> Follow the same pattern as rapl for imc, and consolidate everything to
> work on struct pmu_counter.
> 
> v2: Combine rapl_parse/imc_parse into pmu_parse
> v3: Keep the error message for RAPL not reporting Joules

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tools/intel_gpu_top.c | 261 +++++++++++++-----------------------------
>   1 file changed, 78 insertions(+), 183 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 0a49cfecc..5d42a2fad 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -55,6 +55,7 @@ struct pmu_counter {
>   	unsigned int idx;
>   	struct pmu_pair val;
>   	double scale;
> +	const char *units;
>   	bool present;
>   };
>   
> @@ -85,17 +86,14 @@ struct engines {
>   	unsigned int num_rapl;
>   
>   	int imc_fd;
> -	double imc_reads_scale;
> -	const char *imc_reads_unit;
> -	double imc_writes_scale;
> -	const char *imc_writes_unit;
> +	struct pmu_counter imc_reads;
> +	struct pmu_counter imc_writes;
> +	unsigned int num_imc;
>   
>   	struct pmu_counter freq_req;
>   	struct pmu_counter freq_act;
>   	struct pmu_counter irq;
>   	struct pmu_counter rc6;
> -	struct pmu_counter imc_reads;
> -	struct pmu_counter imc_writes;
>   
>   	bool discrete;
>   	char *device;
> @@ -136,14 +134,14 @@ static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
>   	return ret;
>   }
>   
> -static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str)
>   {
>   	locale_t locale, oldlocale;
>   	bool result = true;
>   	char buf[128] = {};
>   	int dir;
>   
> -	dir = open("/sys/devices/power", O_RDONLY);
> +	dir = open(path, O_RDONLY);
>   	if (dir < 0)
>   		return -errno;
>   
> @@ -160,10 +158,8 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
>   
>   	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
> -	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
> -	    strcmp(buf, "Joules"))
> -		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
> -			str, buf);
> +	result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1;
> +	pmu->units = strdup(buf);
>   
>   	uselocale(oldlocale);
>   	freelocale(locale);
> @@ -179,6 +175,24 @@ static int rapl_parse(struct pmu_counter *pmu, const char *str)
>   	return 0;
>   }
>   
> +static int rapl_parse(struct pmu_counter *pmu, const char *str)
> +{
> +	const char *expected_units = "Joules";
> +	int err;
> +
> +	err = pmu_parse(pmu, "/sys/devices/power", str);
> +	if (err < 0)
> +		return err;
> +
> +	if (!pmu->units || strcmp(pmu->units, expected_units)) {
> +		fprintf(stderr,
> +			"Unexpected units for RAPL %s: found '%s', expected '%s'\n",
> +			str, pmu->units, expected_units);
> +	}
> +
> +	return 0;
> +}
> +
>   static void
>   rapl_open(struct pmu_counter *pmu,
>   	  const char *domain,
> @@ -400,146 +414,57 @@ static struct engines *discover_engines(char *device)
>   	return engines;
>   }
>   
> -static int
> -filename_to_buf(const char *filename, char *buf, unsigned int bufsize)
> -{
> -	int fd, err;
> -	ssize_t ret;
> -
> -	fd = open(filename, O_RDONLY);
> -	if (fd < 0)
> -		return -1;
> -
> -	ret = read(fd, buf, bufsize - 1);
> -	err = errno;
> -	close(fd);
> -	if (ret < 1) {
> -		errno = ret < 0 ? err : ENOMSG;
> -
> -		return -1;
> -	}
> -
> -	if (ret > 1 && buf[ret - 1] == '\n')
> -		buf[ret - 1] = '\0';
> -	else
> -		buf[ret] = '\0';
> -
> -	return 0;
> -}
> -
> -static uint64_t filename_to_u64(const char *filename, int base)
> -{
> -	char buf[64], *b;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	/*
> -	 * Handle both single integer and key=value formats by skipping
> -	 * leading non-digits.
> -	 */
> -	b = buf;
> -	while (*b && !isdigit(*b))
> -		b++;
> -
> -	return strtoull(b, NULL, base);
> -}
> -
> -static double filename_to_double(const char *filename)
> -{
> -	char *oldlocale;
> -	char buf[80];
> -	double v;
> -
> -	if (filename_to_buf(filename, buf, sizeof(buf)))
> -		return 0;
> -
> -	oldlocale = setlocale(LC_ALL, "C");
> -	v = strtod(buf, NULL);
> -	setlocale(LC_ALL, oldlocale);
> -
> -	return v;
> -}
> -
> -#define IMC_ROOT "/sys/devices/uncore_imc/"
> -#define IMC_EVENT "/sys/devices/uncore_imc/events/"
> +#define _open_pmu(type, cnt, pmu, fd) \
> +({ \
> +	int fd__; \
> +\
> +	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> +	if (fd__ >= 0) { \
> +		if ((fd) == -1) \
> +			(fd) = fd__; \
> +		(pmu)->present = true; \
> +		(pmu)->idx = (cnt)++; \
> +	} \
> +\
> +	fd__; \
> +})
>   
> -static uint64_t imc_type_id(void)
> +static int imc_parse(struct pmu_counter *pmu, const char *str)
>   {
> -	return filename_to_u64(IMC_ROOT "type", 10);
> +	return pmu_parse(pmu, "/sys/devices/uncore_imc", str);
>   }
>   
> -static uint64_t imc_data_reads(void)
> +static void
> +imc_open(struct pmu_counter *pmu,
> +	 const char *domain,
> +	 struct engines *engines)
>   {
> -	return filename_to_u64(IMC_EVENT "data_reads", 0);
> -}
> +	int fd;
>   
> -static double imc_data_reads_scale(void)
> -{
> -	return filename_to_double(IMC_EVENT "data_reads.scale");
> -}
> +	if (imc_parse(pmu, domain) < 0)
> +		return;
>   
> -static const char *imc_data_reads_unit(void)
> -{
> -	char buf[32];
> +	fd = igt_perf_open_group(pmu->type, pmu->config, engines->imc_fd);
> +	if (fd < 0)
> +		return;
>   
> -	if (filename_to_buf(IMC_EVENT "data_reads.unit", buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> -}
> +	if (engines->imc_fd == -1)
> +		engines->imc_fd = fd;
>   
> -static uint64_t imc_data_writes(void)
> -{
> -	return filename_to_u64(IMC_EVENT "data_writes", 0);
> +	pmu->idx = engines->num_imc++;
> +	pmu->present = true;
>   }
>   
> -static double imc_data_writes_scale(void)
> +static void imc_writes_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	return filename_to_double(IMC_EVENT "data_writes.scale");
> +	imc_open(pmu, "data_writes", engines);
>   }
>   
> -static const char *imc_data_writes_unit(void)
> +static void imc_reads_open(struct pmu_counter *pmu, struct engines *engines)
>   {
> -	char buf[32];
> -
> -	if (filename_to_buf(IMC_EVENT "data_writes.unit",
> -			    buf, sizeof(buf)) == 0)
> -		return strdup(buf);
> -	else
> -		return NULL;
> +	imc_open(pmu, "data_reads", engines);
>   }
>   
> -#define _open_pmu(type, cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group((type), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
> -#define _open_imc(cnt, pmu, fd) \
> -({ \
> -	int fd__; \
> -\
> -	fd__ = igt_perf_open_group(imc_type_id(), (pmu)->config, (fd)); \
> -	if (fd__ >= 0) { \
> -		if ((fd) == -1) \
> -			(fd) = fd__; \
> -		(pmu)->present = true; \
> -		(pmu)->idx = (cnt)++; \
> -	} \
> -\
> -	fd__; \
> -})
> -
>   static int pmu_init(struct engines *engines)
>   {
>   	unsigned int i;
> @@ -595,38 +520,8 @@ static int pmu_init(struct engines *engines)
>   	}
>   
>   	engines->imc_fd = -1;
> -	if (imc_type_id()) {
> -		unsigned int num = 0;
> -
> -		engines->imc_reads_scale = imc_data_reads_scale();
> -		engines->imc_writes_scale = imc_data_writes_scale();
> -
> -		engines->imc_reads_unit = imc_data_reads_unit();
> -		if (!engines->imc_reads_unit)
> -			return -1;
> -
> -		engines->imc_writes_unit = imc_data_writes_unit();
> -		if (!engines->imc_writes_unit)
> -			return -1;
> -
> -		engines->imc_reads.config = imc_data_reads();
> -		if (!engines->imc_reads.config)
> -			return -1;
> -
> -		engines->imc_writes.config = imc_data_writes();
> -		if (!engines->imc_writes.config)
> -			return -1;
> -
> -		fd = _open_imc(num, &engines->imc_reads, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -		fd = _open_imc(num, &engines->imc_writes, engines->imc_fd);
> -		if (fd < 0)
> -			return -1;
> -
> -		engines->imc_reads.present = true;
> -		engines->imc_writes.present = true;
> -	}
> +	imc_reads_open(&engines->imc_reads, engines);
> +	imc_writes_open(&engines->imc_writes, engines);
>   
>   	return 0;
>   }
> @@ -692,13 +587,6 @@ static void pmu_sample(struct engines *engines)
>   	unsigned int i;
>   
>   	engines->ts.prev = engines->ts.cur;
> -
> -	if (engines->imc_fd >= 0) {
> -		pmu_read_multi(engines->imc_fd, 2, val);
> -		update_sample(&engines->imc_reads, val);
> -		update_sample(&engines->imc_writes, val);
> -	}
> -
>   	engines->ts.cur = pmu_read_multi(engines->fd, num_val, val);
>   
>   	update_sample(&engines->freq_req, val);
> @@ -719,6 +607,12 @@ static void pmu_sample(struct engines *engines)
>   		update_sample(&engines->r_gpu, val);
>   		update_sample(&engines->r_pkg, val);
>   	}
> +
> +	if (engines->num_imc) {
> +		pmu_read_multi(engines->imc_fd, engines->num_imc, val);
> +		update_sample(&engines->imc_reads, val);
> +		update_sample(&engines->imc_writes, val);
> +	}
>   }
>   
>   static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
> @@ -1172,9 +1066,9 @@ static int
>   print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   {
>   	struct cnt_item imc_items[] = {
> -		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads_scale,
> +		{ &engines->imc_reads, 6, 0, 1.0, t, engines->imc_reads.scale,
>   		  "reads", "rd" },
> -		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes_scale,
> +		{ &engines->imc_writes, 6, 0, 1.0, t, engines->imc_writes.scale,
>   		  "writes", "wr" },
>   		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit" },
>   		{ },
> @@ -1189,12 +1083,15 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	};
>   	int ret;
>   
> +	if (!engines->num_imc)
> +		return lines;
> +
>   	ret = asprintf((char **)&imc_group.display_name, "IMC %s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	ret = asprintf((char **)&imc_items[2].unit, "%s/s",
> -			engines->imc_reads_unit);
> +			engines->imc_reads.units);
>   	assert(ret >= 0);
>   
>   	print_groups(groups);
> @@ -1205,11 +1102,11 @@ print_imc(struct engines *engines, double t, int lines, int con_w, int con_h)
>   	if (output_mode == INTERACTIVE) {
>   		if (lines++ < con_h)
>   			printf("      IMC reads:   %s %s/s\n",
> -			       imc_items[0].buf, engines->imc_reads_unit);
> +			       imc_items[0].buf, engines->imc_reads.units);
>   
>   		if (lines++ < con_h)
>   			printf("     IMC writes:   %s %s/s\n",
> -			       imc_items[1].buf, engines->imc_writes_unit);
> +			       imc_items[1].buf, engines->imc_writes.units);
>   
>   		if (lines++ < con_h)
>   			printf("\n");
> @@ -1509,9 +1406,7 @@ int main(int argc, char **argv)
>   					     t, lines, con_w, con_h,
>   					     &consumed);
>   
> -			if (engines->imc_fd)
> -				lines = print_imc(engines, t, lines, con_w,
> -						  con_h);
> +			lines = print_imc(engines, t, lines, con_w, con_h);
>   
>   			lines = print_engines_header(engines, t, lines, con_w,
>   						     con_h);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2)
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
                   ` (4 preceding siblings ...)
  (?)
@ 2020-11-25 10:57 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25 10:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 3827 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2)
URL   : https://patchwork.freedesktop.org/series/84235/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9389 -> IGTPW_5224
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html

Known issues
------------

  Here are the changes found in IGTPW_5224 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@core_hotunplug@unbind-rebind:
    - fi-tgl-u2:          [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-u2/igt@core_hotunplug@unbind-rebind.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-tgl-u2/igt@core_hotunplug@unbind-rebind.html

  * igt@i915_module_load@reload:
    - fi-icl-u2:          [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-icl-u2/igt@i915_module_load@reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-icl-u2/igt@i915_module_load@reload.html
    - fi-apl-guc:         [PASS][5] -> [DMESG-WARN][6] ([i915#1635] / [i915#1982]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-apl-guc/igt@i915_module_load@reload.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-apl-guc/igt@i915_module_load@reload.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-byt-j1900:       [PASS][7] -> [DMESG-WARN][8] ([i915#1982])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-byt-j1900/igt@i915_pm_rpm@basic-pci-d3-state.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-byt-j1900/igt@i915_pm_rpm@basic-pci-d3-state.html

  
#### Possible fixes ####

  * igt@kms_chamelium@dp-crc-fast:
    - fi-cml-u2:          [DMESG-WARN][9] ([i915#1982]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-byt-j1900:       [DMESG-WARN][11] ([i915#1982]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
    - fi-icl-u2:          [DMESG-WARN][13] ([i915#1982]) -> [PASS][14] +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html

  
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982


Participating hosts (43 -> 38)
------------------------------

  Missing    (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-tgl-y fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5224

  CI-20190529: 20190529
  CI_DRM_9389: b0c2cf3ad04abd9e7a44abe12e736bb5ab587393 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5224: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html

[-- Attachment #1.2: Type: text/html, Size: 4989 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3)
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
                   ` (5 preceding siblings ...)
  (?)
@ 2020-11-25 11:27 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25 11:27 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 5259 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3)
URL   : https://patchwork.freedesktop.org/series/84235/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9389 -> IGTPW_5225
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html

Known issues
------------

  Here are the changes found in IGTPW_5225 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_flink_basic@basic:
    - fi-tgl-y:           [PASS][1] -> [DMESG-WARN][2] ([i915#402]) +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-y/igt@gem_flink_basic@basic.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-tgl-y/igt@gem_flink_basic@basic.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-bsw-kefka:       [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@kms_busy@basic@modeset:
    - fi-tgl-y:           [PASS][5] -> [DMESG-WARN][6] ([i915#1982])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-y/igt@kms_busy@basic@modeset.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-tgl-y/igt@kms_busy@basic@modeset.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-kbl-7500u:       [PASS][7] -> [FAIL][8] ([i915#1161] / [i915#262])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-kbl-7500u/igt@kms_chamelium@dp-crc-fast.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-kbl-7500u/igt@kms_chamelium@dp-crc-fast.html

  
#### Possible fixes ####

  * igt@kms_chamelium@dp-crc-fast:
    - fi-cml-u2:          [DMESG-WARN][9] ([i915#1982]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-byt-j1900:       [DMESG-WARN][11] ([i915#1982]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
    - fi-icl-u2:          [DMESG-WARN][13] ([i915#1982]) -> [PASS][14] +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html

  * igt@kms_flip@basic-flip-vs-dpms@d-edp1:
    - fi-tgl-y:           [DMESG-WARN][15] ([i915#1982]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-y/igt@kms_flip@basic-flip-vs-dpms@d-edp1.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-tgl-y/igt@kms_flip@basic-flip-vs-dpms@d-edp1.html

  * igt@prime_self_import@basic-with_one_bo:
    - fi-tgl-y:           [DMESG-WARN][17] ([i915#402]) -> [PASS][18] +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html

  
#### Warnings ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-tgl-y:           [DMESG-WARN][19] ([i915#2411]) -> [DMESG-WARN][20] ([i915#2411] / [i915#402])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/fi-tgl-y/igt@gem_exec_suspend@basic-s3.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/fi-tgl-y/igt@gem_exec_suspend@basic-s3.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1161]: https://gitlab.freedesktop.org/drm/intel/issues/1161
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402


Participating hosts (43 -> 39)
------------------------------

  Missing    (4): fi-ilk-m540 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5225

  CI-20190529: 20190529
  CI_DRM_9389: b0c2cf3ad04abd9e7a44abe12e736bb5ab587393 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5225: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html

[-- Attachment #1.2: Type: text/html, Size: 6639 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2)
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
                   ` (6 preceding siblings ...)
  (?)
@ 2020-11-25 12:29 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25 12:29 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 23481 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2)
URL   : https://patchwork.freedesktop.org/series/84235/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9389_full -> IGTPW_5224_full
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with IGTPW_5224_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_5224_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_5224_full:

### IGT changes ###

#### Warnings ####

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][1] ([i915#2681]) -> [WARN][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb1/igt@i915_pm_rc6_residency@rc6-idle.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb5/igt@i915_pm_rc6_residency@rc6-idle.html

  
Known issues
------------

  Here are the changes found in IGTPW_5224_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_reloc@basic-many-active@rcs0:
    - shard-glk:          [PASS][3] -> [FAIL][4] ([i915#2389])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk2/igt@gem_exec_reloc@basic-many-active@rcs0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk7/igt@gem_exec_reloc@basic-many-active@rcs0.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-iclb:         [PASS][5] -> [INCOMPLETE][6] ([i915#1185] / [i915#2369])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb2/igt@gem_exec_suspend@basic-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb3/igt@gem_exec_suspend@basic-s3.html
    - shard-glk:          [PASS][7] -> [INCOMPLETE][8] ([i915#2369] / [i915#2635])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk7/igt@gem_exec_suspend@basic-s3.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk8/igt@gem_exec_suspend@basic-s3.html
    - shard-hsw:          [PASS][9] -> [INCOMPLETE][10] ([i915#1888] / [i915#2369] / [i915#2637])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw5/igt@gem_exec_suspend@basic-s3.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw7/igt@gem_exec_suspend@basic-s3.html
    - shard-kbl:          [PASS][11] -> [INCOMPLETE][12] ([i915#155] / [i915#2369])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@gem_exec_suspend@basic-s3.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl2/igt@gem_exec_suspend@basic-s3.html
    - shard-apl:          [PASS][13] -> [INCOMPLETE][14] ([i915#1635] / [i915#2369] / [i915#2635])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl4/igt@gem_exec_suspend@basic-s3.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl6/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_suspend@debugfs-reader:
    - shard-glk:          [PASS][15] -> [INCOMPLETE][16] ([i915#2635])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk4/igt@i915_suspend@debugfs-reader.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk4/igt@i915_suspend@debugfs-reader.html
    - shard-apl:          [PASS][17] -> [INCOMPLETE][18] ([i915#1635] / [i915#2635])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl6/igt@i915_suspend@debugfs-reader.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl1/igt@i915_suspend@debugfs-reader.html
    - shard-iclb:         [PASS][19] -> [INCOMPLETE][20] ([i915#1185])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@i915_suspend@debugfs-reader.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb4/igt@i915_suspend@debugfs-reader.html
    - shard-kbl:          [PASS][21] -> [INCOMPLETE][22] ([i915#155])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl7/igt@i915_suspend@debugfs-reader.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl6/igt@i915_suspend@debugfs-reader.html
    - shard-hsw:          [PASS][23] -> [INCOMPLETE][24] ([i915#2637])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw8/igt@i915_suspend@debugfs-reader.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw2/igt@i915_suspend@debugfs-reader.html

  * igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge:
    - shard-glk:          [PASS][25] -> [DMESG-WARN][26] ([i915#1982]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk7/igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk7/igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          [PASS][27] -> [FAIL][28] ([i915#96])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw4/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw6/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
    - shard-kbl:          [PASS][29] -> [DMESG-WARN][30] ([i915#1982]) +3 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@kms_cursor_legacy@basic-flip-after-cursor-atomic.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl6/igt@kms_cursor_legacy@basic-flip-after-cursor-atomic.html

  * igt@kms_cursor_legacy@cursora-vs-flipa-varying-size:
    - shard-apl:          [PASS][31] -> [DMESG-WARN][32] ([i915#1635] / [i915#1982]) +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl1/igt@kms_cursor_legacy@cursora-vs-flipa-varying-size.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl7/igt@kms_cursor_legacy@cursora-vs-flipa-varying-size.html

  * igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
    - shard-tglb:         [PASS][33] -> [FAIL][34] ([i915#2346])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb2/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb7/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-tglb:         [PASS][35] -> [DMESG-WARN][36] ([i915#1982]) +1 similar issue
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html

  * igt@kms_plane_lowres@pipe-b-tiling-x:
    - shard-kbl:          [PASS][37] -> [DMESG-WARN][38] ([i915#165] / [i915#78])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@kms_plane_lowres@pipe-b-tiling-x.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl2/igt@kms_plane_lowres@pipe-b-tiling-x.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [PASS][39] -> [SKIP][40] ([fdo#109441]) +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb4/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_universal_plane@universal-plane-pipe-a-functional:
    - shard-kbl:          [PASS][41] -> [FAIL][42] ([i915#331])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl2/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl4/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
    - shard-apl:          [PASS][43] -> [FAIL][44] ([i915#1635] / [i915#331])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl2/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl4/igt@kms_universal_plane@universal-plane-pipe-a-functional.html

  * igt@kms_vblank@pipe-b-query-forked-busy:
    - shard-kbl:          [PASS][45] -> [DMESG-WARN][46] ([i915#78])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl7/igt@kms_vblank@pipe-b-query-forked-busy.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl2/igt@kms_vblank@pipe-b-query-forked-busy.html

  
#### Possible fixes ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-glk:          [INCOMPLETE][47] ([i915#2283] / [i915#2405]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk2/igt@device_reset@unbind-reset-rebind.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk5/igt@device_reset@unbind-reset-rebind.html
    - shard-apl:          [INCOMPLETE][49] ([i915#1635] / [i915#2283] / [i915#2405]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl6/igt@device_reset@unbind-reset-rebind.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl7/igt@device_reset@unbind-reset-rebind.html
    - shard-kbl:          [INCOMPLETE][51] ([i915#2283] / [i915#2405]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@device_reset@unbind-reset-rebind.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl1/igt@device_reset@unbind-reset-rebind.html
    - shard-tglb:         [INCOMPLETE][53] ([i915#1602] / [i915#750]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@device_reset@unbind-reset-rebind.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb7/igt@device_reset@unbind-reset-rebind.html
    - shard-iclb:         [INCOMPLETE][55] ([i915#2283] / [i915#2405]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@device_reset@unbind-reset-rebind.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb3/igt@device_reset@unbind-reset-rebind.html

  * igt@feature_discovery@psr2:
    - shard-iclb:         [SKIP][57] ([i915#658]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb1/igt@feature_discovery@psr2.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb2/igt@feature_discovery@psr2.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-glk:          [DMESG-WARN][59] ([i915#118] / [i915#95]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk4/igt@gem_exec_whisper@basic-fds-forked.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk1/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-iclb:         [DMESG-WARN][61] -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb7/igt@i915_pm_backlight@fade_with_suspend.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb4/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][63] ([i915#454]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@i915_pm_dc@dc6-psr.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb1/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@gem-execbuf-stress:
    - shard-glk:          [SKIP][65] ([fdo#109271]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk6/igt@i915_pm_rpm@gem-execbuf-stress.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk8/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-apl:          [SKIP][67] ([fdo#109271] / [i915#1635]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl1/igt@i915_pm_rpm@gem-execbuf-stress.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl1/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-kbl:          [SKIP][69] ([fdo#109271]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl1/igt@i915_pm_rpm@gem-execbuf-stress.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl3/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-hsw:          [SKIP][71] ([fdo#109271]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw4/igt@i915_pm_rpm@gem-execbuf-stress.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw2/igt@i915_pm_rpm@gem-execbuf-stress.html

  * igt@kms_busy@basic-modeset-pipe-c:
    - shard-hsw:          [DMESG-WARN][73] ([i915#44]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw4/igt@kms_busy@basic-modeset-pipe-c.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw4/igt@kms_busy@basic-modeset-pipe-c.html

  * igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge:
    - shard-apl:          [DMESG-WARN][75] ([i915#1635] / [i915#1982]) -> [PASS][76] +3 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl3/igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl7/igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
    - shard-glk:          [DMESG-WARN][77] ([i915#1982]) -> [PASS][78] +3 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk1/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk6/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html

  * igt@kms_fbcon_fbt@fbc:
    - shard-glk:          [FAIL][79] ([i915#64]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk6/igt@kms_fbcon_fbt@fbc.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-glk1/igt@kms_fbcon_fbt@fbc.html

  * igt@kms_flip@flip-vs-rmfb-interruptible@c-dp1:
    - shard-kbl:          [DMESG-WARN][81] ([i915#62]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl2/igt@kms_flip@flip-vs-rmfb-interruptible@c-dp1.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl7/igt@kms_flip@flip-vs-rmfb-interruptible@c-dp1.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc:
    - shard-tglb:         [DMESG-WARN][83] ([i915#1982]) -> [PASS][84] +1 similar issue
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][85] ([fdo#109441]) -> [PASS][86] +1 similar issue
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb7/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_vblank@pipe-b-wait-forked-busy:
    - shard-kbl:          [DMESG-WARN][87] ([i915#1982]) -> [PASS][88] +5 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl1/igt@kms_vblank@pipe-b-wait-forked-busy.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-kbl4/igt@kms_vblank@pipe-b-wait-forked-busy.html

  * igt@perf_pmu@module-unload:
    - shard-apl:          [DMESG-WARN][89] ([i915#1635] / [i915#1982] / [i915#262]) -> [PASS][90]
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl3/igt@perf_pmu@module-unload.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-apl1/igt@perf_pmu@module-unload.html

  
#### Warnings ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-hsw:          [INCOMPLETE][91] ([i915#2283] / [i915#2405]) -> [WARN][92] ([i915#2283])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw6/igt@device_reset@unbind-reset-rebind.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw5/igt@device_reset@unbind-reset-rebind.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-tglb:         [DMESG-WARN][93] ([i915#2411]) -> [INCOMPLETE][94] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2369] / [i915#2411])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb2/igt@gem_exec_suspend@basic-s3.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb7/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-tglb:         [DMESG-WARN][95] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2411]) -> [DMESG-WARN][96] ([i915#2411])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb5/igt@i915_pm_backlight@fade_with_suspend.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb6/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_suspend@debugfs-reader:
    - shard-tglb:         [DMESG-WARN][97] ([i915#2411]) -> [INCOMPLETE][98] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2411] / [i915#456])
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb7/igt@i915_suspend@debugfs-reader.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb5/igt@i915_suspend@debugfs-reader.html

  * igt@runner@aborted:
    - shard-hsw:          [FAIL][99] ([i915#2283] / [i915#2295]) -> ([FAIL][100], [FAIL][101]) ([i915#2295])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw6/igt@runner@aborted.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw7/igt@runner@aborted.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-hsw2/igt@runner@aborted.html
    - shard-iclb:         ([FAIL][102], [FAIL][103], [FAIL][104]) ([i915#1814] / [i915#2283] / [i915#2295] / [i915#483]) -> ([FAIL][105], [FAIL][106], [FAIL][107]) ([i915#2295])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb3/igt@runner@aborted.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@runner@aborted.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb7/igt@runner@aborted.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb3/igt@runner@aborted.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb2/igt@runner@aborted.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-iclb4/igt@runner@aborted.html
    - shard-tglb:         ([FAIL][108], [FAIL][109], [FAIL][110]) ([i915#2295]) -> ([FAIL][111], [FAIL][112], [FAIL][113]) ([i915#1602] / [i915#2295])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb5/igt@runner@aborted.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@runner@aborted.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb6/igt@runner@aborted.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb8/igt@runner@aborted.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb7/igt@runner@aborted.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/shard-tglb5/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1185]: https://gitlab.freedesktop.org/drm/intel/issues/1185
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
  [i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#165]: https://gitlab.freedesktop.org/drm/intel/issues/165
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#1887]: https://gitlab.freedesktop.org/drm/intel/issues/1887
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2283]: https://gitlab.freedesktop.org/drm/intel/issues/2283
  [i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
  [i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
  [i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2597]: https://gitlab.freedesktop.org/drm/intel/issues/2597
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#2635]: https://gitlab.freedesktop.org/drm/intel/issues/2635
  [i915#2637]: https://gitlab.freedesktop.org/drm/intel/issues/2637
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#331]: https://gitlab.freedesktop.org/drm/intel/issues/331
  [i915#44]: https://gitlab.freedesktop.org/drm/intel/issues/44
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#483]: https://gitlab.freedesktop.org/drm/intel/issues/483
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#64]: https://gitlab.freedesktop.org/drm/intel/issues/64
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750
  [i915#78]: https://gitlab.freedesktop.org/drm/intel/issues/78
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
  [i915#96]: https://gitlab.freedesktop.org/drm/intel/issues/96


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5224
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_9389: b0c2cf3ad04abd9e7a44abe12e736bb5ab587393 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5224: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5224/index.html

[-- Attachment #1.2: Type: text/html, Size: 29449 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3)
  2020-11-24 23:27 ` [igt-dev] " Chris Wilson
                   ` (7 preceding siblings ...)
  (?)
@ 2020-11-25 13:06 ` Patchwork
  -1 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2020-11-25 13:06 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 22015 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3)
URL   : https://patchwork.freedesktop.org/series/84235/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9389_full -> IGTPW_5225_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html

Known issues
------------

  Here are the changes found in IGTPW_5225_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3:
    - shard-iclb:         [PASS][1] -> [INCOMPLETE][2] ([i915#1185] / [i915#2369])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb2/igt@gem_exec_suspend@basic-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb2/igt@gem_exec_suspend@basic-s3.html
    - shard-glk:          [PASS][3] -> [INCOMPLETE][4] ([i915#2369] / [i915#2635])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk7/igt@gem_exec_suspend@basic-s3.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk6/igt@gem_exec_suspend@basic-s3.html
    - shard-hsw:          [PASS][5] -> [INCOMPLETE][6] ([i915#1888] / [i915#2369] / [i915#2637])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw5/igt@gem_exec_suspend@basic-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-hsw2/igt@gem_exec_suspend@basic-s3.html
    - shard-kbl:          [PASS][7] -> [INCOMPLETE][8] ([i915#155] / [i915#2369])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@gem_exec_suspend@basic-s3.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl2/igt@gem_exec_suspend@basic-s3.html

  * igt@kms_addfb_basic@framebuffer-vs-set-tiling:
    - shard-apl:          [PASS][9] -> [DMESG-WARN][10] ([i915#1635] / [i915#1982]) +2 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl3/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl4/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [PASS][11] -> [FAIL][12] ([i915#54]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
    - shard-apl:          [PASS][13] -> [FAIL][14] ([i915#1635] / [i915#54]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl4/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
    - shard-glk:          [PASS][15] -> [DMESG-WARN][16] ([i915#1982]) +6 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk4/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk1/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
    - shard-tglb:         [PASS][17] -> [FAIL][18] ([i915#2346])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb2/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb2/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1:
    - shard-tglb:         [PASS][19] -> [FAIL][20] ([i915#2598])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb8/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb8/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1.html

  * igt@kms_flip@plain-flip-fb-recreate@a-hdmi-a1:
    - shard-glk:          [PASS][21] -> [FAIL][22] ([i915#2122])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk3/igt@kms_flip@plain-flip-fb-recreate@a-hdmi-a1.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk1/igt@kms_flip@plain-flip-fb-recreate@a-hdmi-a1.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render:
    - shard-kbl:          [PASS][23] -> [DMESG-WARN][24] ([i915#1982]) +6 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-mmap-wc:
    - shard-tglb:         [PASS][25] -> [DMESG-WARN][26] ([i915#1982]) +3 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb2/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-mmap-wc.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb3/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-mmap-wc.html

  * igt@kms_plane_cursor@pipe-a-overlay-size-64:
    - shard-snb:          [PASS][27] -> [SKIP][28] ([fdo#109271])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-snb5/igt@kms_plane_cursor@pipe-a-overlay-size-64.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-snb7/igt@kms_plane_cursor@pipe-a-overlay-size-64.html

  * igt@kms_psr@psr2_sprite_render:
    - shard-iclb:         [PASS][29] -> [SKIP][30] ([fdo#109441]) +1 similar issue
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb2/igt@kms_psr@psr2_sprite_render.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb1/igt@kms_psr@psr2_sprite_render.html

  * igt@perf_pmu@module-unload:
    - shard-tglb:         [PASS][31] -> [DMESG-WARN][32] ([i915#1982] / [i915#262])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@perf_pmu@module-unload.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb2/igt@perf_pmu@module-unload.html

  
#### Possible fixes ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-glk:          [INCOMPLETE][33] ([i915#2283] / [i915#2405]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk2/igt@device_reset@unbind-reset-rebind.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk3/igt@device_reset@unbind-reset-rebind.html
    - shard-apl:          [INCOMPLETE][35] ([i915#1635] / [i915#2283] / [i915#2405]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl6/igt@device_reset@unbind-reset-rebind.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl6/igt@device_reset@unbind-reset-rebind.html
    - shard-kbl:          [INCOMPLETE][37] ([i915#2283] / [i915#2405]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl6/igt@device_reset@unbind-reset-rebind.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl3/igt@device_reset@unbind-reset-rebind.html
    - shard-tglb:         [INCOMPLETE][39] ([i915#1602] / [i915#750]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@device_reset@unbind-reset-rebind.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb2/igt@device_reset@unbind-reset-rebind.html
    - shard-iclb:         [INCOMPLETE][41] ([i915#2283] / [i915#2405]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@device_reset@unbind-reset-rebind.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb1/igt@device_reset@unbind-reset-rebind.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-glk:          [DMESG-WARN][43] ([i915#118] / [i915#95]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk4/igt@gem_exec_whisper@basic-fds-forked.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk1/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-iclb:         [DMESG-WARN][45] -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb7/igt@i915_pm_backlight@fade_with_suspend.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb7/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][47] ([i915#454]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@i915_pm_dc@dc6-psr.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb2/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@gem-execbuf-stress:
    - shard-glk:          [SKIP][49] ([fdo#109271]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk6/igt@i915_pm_rpm@gem-execbuf-stress.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk4/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-apl:          [SKIP][51] ([fdo#109271] / [i915#1635]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl1/igt@i915_pm_rpm@gem-execbuf-stress.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl7/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-kbl:          [SKIP][53] ([fdo#109271]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl1/igt@i915_pm_rpm@gem-execbuf-stress.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl1/igt@i915_pm_rpm@gem-execbuf-stress.html
    - shard-hsw:          [SKIP][55] ([fdo#109271]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw4/igt@i915_pm_rpm@gem-execbuf-stress.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-hsw2/igt@i915_pm_rpm@gem-execbuf-stress.html

  * igt@kms_busy@basic-modeset-pipe-c:
    - shard-hsw:          [DMESG-WARN][57] ([i915#44]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw4/igt@kms_busy@basic-modeset-pipe-c.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-hsw1/igt@kms_busy@basic-modeset-pipe-c.html

  * igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge:
    - shard-apl:          [DMESG-WARN][59] ([i915#1635] / [i915#1982]) -> [PASS][60] +4 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl3/igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl8/igt@kms_cursor_edge_walk@pipe-c-256x256-left-edge.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
    - shard-glk:          [DMESG-WARN][61] ([i915#1982]) -> [PASS][62] +4 similar issues
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk1/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk5/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html

  * igt@kms_fbcon_fbt@fbc:
    - shard-glk:          [FAIL][63] ([i915#64]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-glk6/igt@kms_fbcon_fbt@fbc.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-glk2/igt@kms_fbcon_fbt@fbc.html

  * igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary:
    - shard-kbl:          [FAIL][65] ([i915#49]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
    - shard-apl:          [FAIL][67] ([i915#1635] / [i915#49]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl1/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl8/igt@kms_frontbuffer_tracking@fbc-indfb-scaledprimary.html

  * igt@kms_frontbuffer_tracking@fbc-stridechange:
    - shard-tglb:         [DMESG-WARN][69] ([i915#1982]) -> [PASS][70] +2 similar issues
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@kms_frontbuffer_tracking@fbc-stridechange.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb8/igt@kms_frontbuffer_tracking@fbc-stridechange.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [SKIP][71] ([fdo#109441]) -> [PASS][72] +3 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb6/igt@kms_psr@psr2_cursor_render.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb2/igt@kms_psr@psr2_cursor_render.html

  * igt@kms_vblank@pipe-b-wait-forked-busy:
    - shard-kbl:          [DMESG-WARN][73] ([i915#1982]) -> [PASS][74] +5 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-kbl1/igt@kms_vblank@pipe-b-wait-forked-busy.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-kbl7/igt@kms_vblank@pipe-b-wait-forked-busy.html

  
#### Warnings ####

  * igt@device_reset@unbind-reset-rebind:
    - shard-hsw:          [INCOMPLETE][75] ([i915#2283] / [i915#2405]) -> [WARN][76] ([i915#2283])
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw6/igt@device_reset@unbind-reset-rebind.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-hsw7/igt@device_reset@unbind-reset-rebind.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-tglb:         [DMESG-WARN][77] ([i915#2411]) -> [INCOMPLETE][78] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2369] / [i915#2411])
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb2/igt@gem_exec_suspend@basic-s3.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb8/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-tglb:         [DMESG-WARN][79] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#2411]) -> [DMESG-WARN][80] ([i915#2411])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb5/igt@i915_pm_backlight@fade_with_suspend.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb1/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_dc@dc3co-vpb-simulation:
    - shard-iclb:         [SKIP][81] ([i915#588]) -> [SKIP][82] ([i915#658])
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb2/igt@i915_pm_dc@dc3co-vpb-simulation.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb4/igt@i915_pm_dc@dc3co-vpb-simulation.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-iclb:         [WARN][83] ([i915#1804] / [i915#2684]) -> [WARN][84] ([i915#2681] / [i915#2684])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb3/igt@i915_pm_rc6_residency@rc6-fence.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb1/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][85] ([i915#2681]) -> [WARN][86] ([i915#1804])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb1/igt@i915_pm_rc6_residency@rc6-idle.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb3/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
    - shard-apl:          [FAIL][87] ([fdo#108145] / [i915#1635] / [i915#265]) -> [DMESG-FAIL][88] ([fdo#108145] / [i915#1635] / [i915#1982])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-apl8/igt@kms_plane_alpha_blend@pipe-b-alpha-7efc.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-apl3/igt@kms_plane_alpha_blend@pipe-b-alpha-7efc.html

  * igt@kms_vblank@pipe-b-ts-continuation-suspend:
    - shard-tglb:         [DMESG-WARN][89] ([i915#2411]) -> [INCOMPLETE][90] ([i915#1436] / [i915#1798] / [i915#1982] / [i915#456])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb8/igt@kms_vblank@pipe-b-ts-continuation-suspend.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb1/igt@kms_vblank@pipe-b-ts-continuation-suspend.html

  * igt@runner@aborted:
    - shard-hsw:          [FAIL][91] ([i915#2283] / [i915#2295]) -> [FAIL][92] ([i915#2295])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-hsw6/igt@runner@aborted.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-hsw2/igt@runner@aborted.html
    - shard-iclb:         ([FAIL][93], [FAIL][94], [FAIL][95]) ([i915#1814] / [i915#2283] / [i915#2295] / [i915#483]) -> ([FAIL][96], [FAIL][97]) ([i915#2295])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb7/igt@runner@aborted.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb8/igt@runner@aborted.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-iclb3/igt@runner@aborted.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb2/igt@runner@aborted.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-iclb3/igt@runner@aborted.html
    - shard-tglb:         ([FAIL][98], [FAIL][99], [FAIL][100]) ([i915#2295]) -> ([FAIL][101], [FAIL][102], [FAIL][103]) ([i915#1602] / [i915#2295])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb5/igt@runner@aborted.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb6/igt@runner@aborted.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9389/shard-tglb3/igt@runner@aborted.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb1/igt@runner@aborted.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb7/igt@runner@aborted.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/shard-tglb8/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1185]: https://gitlab.freedesktop.org/drm/intel/issues/1185
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
  [i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#1798]: https://gitlab.freedesktop.org/drm/intel/issues/1798
  [i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#1887]: https://gitlab.freedesktop.org/drm/intel/issues/1887
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
  [i915#2283]: https://gitlab.freedesktop.org/drm/intel/issues/2283
  [i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
  [i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2597]: https://gitlab.freedesktop.org/drm/intel/issues/2597
  [i915#2598]: https://gitlab.freedesktop.org/drm/intel/issues/2598
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#2635]: https://gitlab.freedesktop.org/drm/intel/issues/2635
  [i915#2637]: https://gitlab.freedesktop.org/drm/intel/issues/2637
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
  [i915#44]: https://gitlab.freedesktop.org/drm/intel/issues/44
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#483]: https://gitlab.freedesktop.org/drm/intel/issues/483
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
  [i915#64]: https://gitlab.freedesktop.org/drm/intel/issues/64
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5870 -> IGTPW_5225
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_9389: b0c2cf3ad04abd9e7a44abe12e736bb5ab587393 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5225: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html
  IGT_5870: 08b13995b85df26a77212e4fb21fd772976ef33c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5225/index.html

[-- Attachment #1.2: Type: text/html, Size: 27395 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Intel-gfx] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power
@ 2020-11-24 23:21 Chris Wilson
  0 siblings, 0 replies; 19+ messages in thread
From: Chris Wilson @ 2020-11-24 23:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

With integrated graphics the TDP is shared between the gpu and the cpu,
knowing the total energy consumed by the package is relevant to
understanding throttling.

v2: Tidy integration by eliminating struct rapl and improve output
formatting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tools/intel_gpu_top.c | 218 +++++++++++++++++++++++++-----------------
 1 file changed, 130 insertions(+), 88 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 86de09aa9..0a49cfecc 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -50,10 +50,12 @@ struct pmu_pair {
 };
 
 struct pmu_counter {
-	bool present;
+	uint64_t type;
 	uint64_t config;
 	unsigned int idx;
 	struct pmu_pair val;
+	double scale;
+	bool present;
 };
 
 struct engine {
@@ -79,8 +81,8 @@ struct engines {
 	struct pmu_pair ts;
 
 	int rapl_fd;
-	double rapl_scale;
-	const char *rapl_unit;
+	struct pmu_counter r_gpu, r_pkg;
+	unsigned int num_rapl;
 
 	int imc_fd;
 	double imc_reads_scale;
@@ -92,7 +94,6 @@ struct engines {
 	struct pmu_counter freq_act;
 	struct pmu_counter irq;
 	struct pmu_counter rc6;
-	struct pmu_counter rapl;
 	struct pmu_counter imc_reads;
 	struct pmu_counter imc_writes;
 
@@ -108,6 +109,109 @@ struct engines {
 
 };
 
+__attribute__((format(scanf,3,4)))
+static int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...)
+{
+	FILE *file;
+	int fd;
+	int ret = -1;
+
+	fd = openat(dir, attr, O_RDONLY);
+	if (fd < 0)
+		return -1;
+
+	file = fdopen(fd, "r");
+	if (file) {
+		va_list ap;
+
+		va_start(ap, fmt);
+		ret = vfscanf(file, fmt, ap);
+		va_end(ap);
+
+		fclose(file);
+	} else {
+		close(fd);
+	}
+
+	return ret;
+}
+
+static int rapl_parse(struct pmu_counter *pmu, const char *str)
+{
+	locale_t locale, oldlocale;
+	bool result = true;
+	char buf[128] = {};
+	int dir;
+
+	dir = open("/sys/devices/power", O_RDONLY);
+	if (dir < 0)
+		return -errno;
+
+	/* Replace user environment with plain C to match kernel format */
+	locale = newlocale(LC_ALL, "C", 0);
+	oldlocale = uselocale(locale);
+
+	result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str);
+	result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str);
+	result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1;
+
+	snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str);
+	if (igt_sysfs_scanf(dir, buf, "%127s", buf) == 1 &&
+	    strcmp(buf, "Joules"))
+		fprintf(stderr, "Unexpected units for RAPL %s: found %s\n",
+			str, buf);
+
+	uselocale(oldlocale);
+	freelocale(locale);
+
+	close(dir);
+
+	if (!result)
+		return -EINVAL;
+
+	if (isnan(pmu->scale) || !pmu->scale)
+		return -ERANGE;
+
+	return 0;
+}
+
+static void
+rapl_open(struct pmu_counter *pmu,
+	  const char *domain,
+	  struct engines *engines)
+{
+	int fd;
+
+	if (rapl_parse(pmu, domain) < 0)
+		return;
+
+	fd = igt_perf_open_group(pmu->type, pmu->config, engines->rapl_fd);
+	if (fd < 0)
+		return;
+
+	if (engines->rapl_fd == -1)
+		engines->rapl_fd = fd;
+
+	pmu->idx = engines->num_rapl++;
+	pmu->present = true;
+}
+
+static void gpu_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "gpu", engines);
+}
+
+static void pkg_power_open(struct pmu_counter *pmu,
+			   struct engines *engines)
+{
+	rapl_open(pmu, "pkg", engines);
+}
+
 static uint64_t
 get_pmu_config(int dirfd, const char *name, const char *counter)
 {
@@ -357,38 +461,6 @@ static double filename_to_double(const char *filename)
 	return v;
 }
 
-#define RAPL_ROOT "/sys/devices/power/"
-#define RAPL_EVENT "/sys/devices/power/events/"
-
-static uint64_t rapl_type_id(void)
-{
-	return filename_to_u64(RAPL_ROOT "type", 10);
-}
-
-static uint64_t rapl_gpu_power(void)
-{
-	return filename_to_u64(RAPL_EVENT "energy-gpu", 0);
-}
-
-static double rapl_gpu_power_scale(void)
-{
-	return filename_to_double(RAPL_EVENT "energy-gpu.scale");
-}
-
-static const char *rapl_gpu_power_unit(void)
-{
-	char buf[32];
-
-	if (filename_to_buf(RAPL_EVENT "energy-gpu.unit",
-			    buf, sizeof(buf)) == 0)
-		if (!strcmp(buf, "Joules"))
-			return strdup("Watts");
-		else
-			return strdup(buf);
-	else
-		return NULL;
-}
-
 #define IMC_ROOT "/sys/devices/uncore_imc/"
 #define IMC_EVENT "/sys/devices/uncore_imc/events/"
 
@@ -517,22 +589,9 @@ static int pmu_init(struct engines *engines)
 	}
 
 	engines->rapl_fd = -1;
-	if (!engines->discrete && rapl_type_id()) {
-		engines->rapl_scale = rapl_gpu_power_scale();
-		engines->rapl_unit = rapl_gpu_power_unit();
-		if (!engines->rapl_unit)
-			return -1;
-
-		engines->rapl.config = rapl_gpu_power();
-		if (!engines->rapl.config)
-			return -1;
-
-		engines->rapl_fd = igt_perf_open(rapl_type_id(),
-						 engines->rapl.config);
-		if (engines->rapl_fd < 0)
-			return -1;
-
-		engines->rapl.present = true;
+	if (!engines->discrete) {
+		gpu_power_open(&engines->r_gpu, engines);
+		pkg_power_open(&engines->r_pkg, engines);
 	}
 
 	engines->imc_fd = -1;
@@ -614,25 +673,6 @@ static void fill_str(char *buf, unsigned int bufsz, char c, unsigned int num)
 	*buf = 0;
 }
 
-static uint64_t __pmu_read_single(int fd, uint64_t *ts)
-{
-	uint64_t data[2] = { };
-	ssize_t len;
-
-	len = read(fd, data, sizeof(data));
-	assert(len == sizeof(data));
-
-	if (ts)
-		*ts = data[1];
-
-	return data[0];
-}
-
-static uint64_t pmu_read_single(int fd)
-{
-	return __pmu_read_single(fd, NULL);
-}
-
 static void __update_sample(struct pmu_counter *counter, uint64_t val)
 {
 	counter->val.prev = counter->val.cur;
@@ -653,10 +693,6 @@ static void pmu_sample(struct engines *engines)
 
 	engines->ts.prev = engines->ts.cur;
 
-	if (engines->rapl_fd >= 0)
-		__update_sample(&engines->rapl,
-				pmu_read_single(engines->rapl_fd));
-
 	if (engines->imc_fd >= 0) {
 		pmu_read_multi(engines->imc_fd, 2, val);
 		update_sample(&engines->imc_reads, val);
@@ -677,6 +713,12 @@ static void pmu_sample(struct engines *engines)
 		update_sample(&engine->sema, val);
 		update_sample(&engine->wait, val);
 	}
+
+	if (engines->num_rapl) {
+		pmu_read_multi(engines->rapl_fd, engines->num_rapl, val);
+		update_sample(&engines->r_gpu, val);
+		update_sample(&engines->r_pkg, val);
+	}
 }
 
 static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█" };
@@ -1076,14 +1118,14 @@ print_header(const struct igt_device_card *card,
 		.items = rc6_items,
 	};
 	struct cnt_item power_items[] = {
-		{ &engines->rapl, 4, 2, 1.0, t, engines->rapl_scale, "value",
-		  "W" },
+		{ &engines->r_gpu, 4, 2, 1.0, t, engines->r_gpu.scale, "GPU", "gpu" },
+		{ &engines->r_pkg, 4, 2, 1.0, t, engines->r_pkg.scale, "Package", "pkg" },
 		{ NULL, 0, 0, 0.0, 0.0, 0.0, "unit", "W" },
 		{ },
 	};
 	struct cnt_group power_group = {
 		.name = "power",
-		.display_name = "Power",
+		.display_name = "Power W",
 		.items = power_items,
 	};
 	struct cnt_group *groups[] = {
@@ -1108,17 +1150,17 @@ print_header(const struct igt_device_card *card,
 
 		if (lines++ < con_h) {
 			printf("intel-gpu-top: %s - ", card->card);
-			if (!engines->discrete)
-				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, power_items[0].buf,
-					engines->rapl_unit,
-					irq_items[0].buf);
-			else
-				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
-					freq_items[1].buf, freq_items[0].buf,
-					rc6_items[0].buf, irq_items[0].buf);
+			printf("%s/%s MHz;  %s%% RC6; ",
+			       freq_items[1].buf, freq_items[0].buf,
+			       rc6_items[0].buf);
+			if (engines->r_gpu.present) {
+				printf("%s/%s W; ",
+				       power_items[0].buf,
+				       power_items[1].buf);
+			}
+			printf("%s irqs/s\n", irq_items[0].buf);
 		}
+
 		if (lines++ < con_h)
 			printf("\n");
 	}
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-11-25 13:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 23:27 [Intel-gfx] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power Chris Wilson
2020-11-24 23:27 ` [igt-dev] " Chris Wilson
2020-11-24 23:27 ` [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_gpu_top: Consolidate imc to use pmu_counter Chris Wilson
2020-11-25  8:58   ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
2020-11-25 10:04   ` [Intel-gfx] [PATCH i-g-t] " Chris Wilson
2020-11-25 10:04     ` [igt-dev] " Chris Wilson
2020-11-25 10:17     ` [Intel-gfx] " Tvrtko Ursulin
2020-11-25 10:17       ` Tvrtko Ursulin
2020-11-25 10:35   ` [Intel-gfx] " Chris Wilson
2020-11-25 10:47     ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
2020-11-25  0:02 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power Patchwork
2020-11-25  4:42 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-25  8:56 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 1/2] " Tvrtko Ursulin
2020-11-25  8:56   ` Tvrtko Ursulin
2020-11-25 10:57 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2) Patchwork
2020-11-25 11:27 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3) Patchwork
2020-11-25 12:29 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev2) Patchwork
2020-11-25 13:06 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tools/intel_gpu_top: Include total package power (rev3) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-11-24 23:21 [Intel-gfx] [PATCH i-g-t 1/2] tools/intel_gpu_top: Include total package power Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.