[igt-dev] [PATCH i-g-t] lib/igt_perf: Support multiple GPUs

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 27 16:34:26 UTC 2019


Quoting Robert M. Fosha (2019-12-27 16:23:12)
> With discrete graphics system can have both integrated and discrete GPU
> handled by i915.
> 
> Update path to PMU for non-integrated devices to include PCI device name
> string to match driver implementation. Integrated devices keep legacy
> path.
> 
> Signed-off-by: Robert M. Fosha <robert.m.fosha at intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  lib/igt_perf.c    | 53 ++++++++++++++++++++++++++++++++++++++++++++---
>  tools/meson.build |  2 +-
>  2 files changed, 51 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_perf.c b/lib/igt_perf.c
> index e3dec2cc..f4a0036f 100644
> --- a/lib/igt_perf.c
> +++ b/lib/igt_perf.c
> @@ -5,27 +5,74 @@
>  #include <string.h>
>  #include <errno.h>
>  #include <sys/sysinfo.h>
> +#include <sys/stat.h>
>  
>  #include "igt_perf.h"
>  
> +#include "drmtest.h"
> +#include "igt_debugfs.h"
> +
> +static char *perf_event_sysfs_path(void)
> +{
> +       int drm_fd;
> +       static const char unique[] = "unique=";
> +       static const char prefix[] = "/sys/bus/event_source/devices/i915";
> +       char path[100];
> +       char buf[100];
> +       char *busid;
> +       struct stat st;
> +
> +       drm_fd = drm_open_driver(DRIVER_INTEL);

Just stop there. How does this relate to the device we want?
-Chris


More information about the igt-dev mailing list