summaryrefslogtreecommitdiff
path: root/lib/igt_perf.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2018-04-04 16:26:49 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2018-05-31 11:30:45 +0100
commit63f0bf3d50b70f011b9d600a1a4bc1a1c7720654 (patch)
treedcfbafd73774e24d038dbf60728c2eac468782a3 /lib/igt_perf.c
parent6796a604bab6df9c84af149e799902360afdd157 (diff)
intel-gpu-top: Rewrite the tool to be safe to use
intel-gpu-top is a dangerous tool which can hang machines due unsafe mmio register access. This patch rewrites it to use only PMU. Only overall command streamer busyness and GPU global data such as power and frequencies are included in this new version. For access to more GPU functional unit level data, an OA metric based tool like gpu-top should be used instead. v2: * Sort engines by class and instance. * Do not wait for one sampling period to display something on screen. * Move code out of the asserts. (Rinat Ibragimov) * Continuously adapt to terminal size. (Rinat Ibragimov) v3: * Change layout and precision of some field. (Chris Wilson) Eero Tamminen: * Use more user friendly engine names. * Don't error out if a counter is missing. * Add IMC read/write bandwidth. * Report minimum required kernel version. v4: * Really support 4.16 by skipping of missing engines. * Simpler and less hacky float printing. * Preserve copyright header. (Antonio Argenziano) * Simplify engines_ptr macro. (Rinat Ibragimov) v5: * Get RAPL unit from sysfs. * Consolidate sysfs paths with a macro. * Tidy error handling by carrying over and reporting errno. * Check against console height on all prints. * More readable minimum kernel version message. (Eero Tamminen) * Column banner for per engine stats. (Eero Tamminen) v6: * Man page update. (Eero Tamminen) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Eero Tamminen <eero.t.tamminen@intel.com> Cc: Rinat Ibragimov <ibragimovrinat@mail.ru> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v1 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v0.5 Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Diffstat (limited to 'lib/igt_perf.c')
-rw-r--r--lib/igt_perf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/igt_perf.c b/lib/igt_perf.c
index 99d82ea5..e3dec2cc 100644
--- a/lib/igt_perf.c
+++ b/lib/igt_perf.c
@@ -69,3 +69,9 @@ int igt_perf_open(uint64_t type, uint64_t config)
return _perf_open(type, config, -1,
PERF_FORMAT_TOTAL_TIME_ENABLED);
}
+
+int igt_perf_open_group(uint64_t type, uint64_t config, int group)
+{
+ return _perf_open(type, config, group,
+ PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_GROUP);
+}