From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Xu, Terrence" <terrence.xu@intel.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: Ayaz A Siddiqui <ayaz.siddiqui@intel.com>,
"Xu, Colin" <colin.xu@intel.com>,
"Wang, Zhenyu Z" <zhenyu.z.wang@intel.com>,
"Jin, Gordon" <gordon.jin@intel.com>
Subject: Re: [igt-dev] [i-g-t] i915/perf: Correct the logic of finding i915 pmu event path
Date: Tue, 14 Apr 2020 13:05:13 +0100 [thread overview]
Message-ID: <611b6151-2e63-56fe-87d1-3adb8f01239f@linux.intel.com> (raw)
In-Reply-To: <EE92950F97EE42469CA4F508D4691F5E3E6EE99F@SHSMSX104.ccr.corp.intel.com>
+ Ayaz
On 10/04/2020 13:32, Xu, Terrence wrote:
>
>> -----Original Message-----
>> From: Chris Wilson <chris@chris-wilson.co.uk>
>> Quoting Terrence Xu (2020-04-10 11:20:46)
>>> Hardcoded i915 PMU event path /sys/bus/event_source/devices/i915
>>> isn't always correct when vGPU isn't on BDF 0:2.0 in virtualization
>>> environment.
>>>
>>> e.g. It will show as sys/bus/event_source/devices/i915-0000:00:03.0
>>> when vGPU is on BDF 0:3.0.
>>>
>>> Refine the path name so that intel_gpu_top can find the correct adapter.
>>>
>>> Signed-off-by: Terrence Xu <terrence.xu@intel.com>
>>> ---
>>> lib/igt_perf.c | 15 ++++++++++++++-
>>> tools/intel_gpu_top.c | 16 +++++++++++++++-
>>> 2 files changed, 29 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/igt_perf.c b/lib/igt_perf.c index
>>> 418c1c188..3531209b3 100644
>>> --- a/lib/igt_perf.c
>>> +++ b/lib/igt_perf.c
>>> @@ -7,6 +7,7 @@
>>> #include <sys/stat.h>
>>> #include <sys/sysinfo.h>
>>> #include <sys/sysmacros.h>
>>> +#include <dirent.h>
>>>
>>> #include "igt_perf.h"
>>>
>>> @@ -75,11 +76,23 @@ uint64_t i915_perf_type_id(int i915) uint64_t
>>> igt_perf_type_id(const char *device) {
>>> char buf[64];
>>> + char dev[64];
>>> ssize_t ret;
>>> int fd;
>>> + DIR *dir;
>>> + struct dirent *dent;
>>> +
>>> + dir = opendir("/sys/bus/event_source/devices/");
>>
>> Nak, this is passed the explicit device to use.
>>
>> i915_perf_type_id() takes the device fd and expands it to the pmu device name.
>> -Chris
> [Xu, Terrence] Thanks for your quick response! Do you think we can use perf_i915_open_group() instead of perf_igfx_open_group() in intel_gpu_top when open pmu? Since i915_perf_type_id() can provide the right i915 pmu.
Ayaz has a patch series in progress which should fix this.
Apart that it would think of 0000:00:03.0 as a discrete GPU but perhaps
that would be okay for now, since only difference would be omission or
RAPL (power) data which is probably correct for virtualization.
Regards,
Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-04-14 12:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 10:20 [igt-dev] [i-g-t] i915/perf: Correct the logic of finding i915 pmu event path Terrence Xu
2020-04-10 10:31 ` Chris Wilson
2020-04-10 12:32 ` Xu, Terrence
2020-04-14 12:05 ` Tvrtko Ursulin [this message]
2020-04-10 11:10 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=611b6151-2e63-56fe-87d1-3adb8f01239f@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=ayaz.siddiqui@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=colin.xu@intel.com \
--cc=gordon.jin@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=terrence.xu@intel.com \
--cc=zhenyu.z.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox