summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2020-11-27 09:28:33 +0100
committerPetri Latvala <petri.latvala@intel.com>2020-11-30 12:27:09 +0200
commit254eb00975064b9765b1d2e237a15fc6b690ad1a (patch)
tree0fdbcb811e66e3b34039b19dab30781117d54ae7
parent969457bda94a8e117bfca037052584827a7d2e83 (diff)
tools/intel_gpu_top: Add generation info in header
In multi device world we may want to see generation of device we're tracking counters. Add pretty name of the device to be more verbose. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/meson.build1
-rw-r--r--tools/intel_gpu_top.c8
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index fecf34cd..c476eeab 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -118,7 +118,9 @@ libigt_device_scan_la_SOURCES = \
igt_list.c \
igt_tools_stub.c \
igt_device_scan.c \
- igt_device_scan.h
+ igt_device_scan.h \
+ intel_device_info.c \
+ intel_chipset.h
libigt_perf_la_SOURCES = \
igt_perf.c \
diff --git a/lib/meson.build b/lib/meson.build
index 090a10cd..540facb2 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -182,6 +182,7 @@ lib_igt_device_scan_build = static_library('igt_device_scan',
['igt_device_scan.c',
'igt_list.c',
'igt_tools_stub.c',
+ 'intel_device_info.c',
],
dependencies : scan_dep,
include_directories : inc)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 3ff9236e..dbd35367 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -964,6 +964,7 @@ static bool print_groups(struct cnt_group **groups)
static int
print_header(const struct igt_device_card *card,
+ const char *codename,
struct engines *engines, double t,
int lines, int con_w, int con_h, bool *consumed)
{
@@ -1043,7 +1044,7 @@ print_header(const struct igt_device_card *card,
printf("\033[H\033[J");
if (lines++ < con_h) {
- printf("intel-gpu-top: %s - ", card->card);
+ printf("intel-gpu-top: %s @ %s - ", codename, card->card);
printf("%s/%s MHz; %s%% RC6; ",
freq_items[1].buf, freq_items[0].buf,
rc6_items[0].buf);
@@ -1256,6 +1257,7 @@ int main(int argc, char **argv)
bool list_device = false;
char *pmu_device, *opt_device = NULL;
struct igt_device_card card;
+ char *codename = NULL;
/* Parse options */
while ((ch = getopt(argc, argv, "o:s:d:JLlh")) != -1) {
@@ -1380,6 +1382,7 @@ int main(int argc, char **argv)
ret = EXIT_SUCCESS;
pmu_sample(engines);
+ codename = igt_device_get_pretty_name(&card, false);
while (!stop_top) {
bool consumed = false;
@@ -1402,7 +1405,7 @@ int main(int argc, char **argv)
break;
while (!consumed) {
- lines = print_header(&card, engines,
+ lines = print_header(&card, codename, engines,
t, lines, con_w, con_h,
&consumed);
@@ -1427,6 +1430,7 @@ int main(int argc, char **argv)
usleep(period_us);
}
+ free(codename);
err:
free(engines);
free(pmu_device);