From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/i915/perf: fix loading configurations
Date: Mon, 24 Feb 2020 16:03:32 +0200 [thread overview]
Message-ID: <9b5f5bc7-ea2f-3b8e-c35c-146fb0638aa0@intel.com> (raw)
In-Reply-To: <158254655397.15220.2982057383454296913@skylake-alporthouse-com>
On 24/02/2020 14:15, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2020-02-24 09:24:17)
>> The configuration ID created is returned not passed by argument.
>>
>> This would lead the verify first test in the perf tests to fail.
>>
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> Fixes: 3fd64d9fb8 ("lib/i915-perf: Add support for loading perf configurations")
>> ---
>> lib/i915/perf.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/i915/perf.c b/lib/i915/perf.c
>> index 35b9aff9..1adf1393 100644
>> --- a/lib/i915/perf.c
>> +++ b/lib/i915/perf.c
>> @@ -427,7 +427,7 @@ static void
>> load_metric_set_config(struct intel_perf_metric_set *metric_set, int drm_fd)
>> {
>> struct drm_i915_perf_oa_config config;
>> - uint64_t config_id = 0;
>> + int ret;
> Hmm, the syscall return is a long, but glibc ioctl() is only an int.
> That bodes well for the future :(
>
>> memset(&config, 0, sizeof(config));
>>
>> @@ -442,10 +442,11 @@ load_metric_set_config(struct intel_perf_metric_set *metric_set, int drm_fd)
>> config.n_flex_regs = metric_set->n_flex_regs;
>> config.flex_regs_ptr = (uintptr_t) metric_set->flex_regs;
>>
>> - while (ioctl(drm_fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, &config) < 0 &&
>> + while ((ret = ioctl(drm_fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, &config)) < 0 &&
>> (errno == EAGAIN || errno == EINTR));
> ret = igt_ioctl(drm_fd, ADD_CONFIG, &config);
>
> That will eat the EAGAIN/EINTR for you.
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris
If you don't mind I'll just have my own version of that ioctl helper
locally.
I tried you suggestion but it started to pull all kind of headers I
don't really want to depend on.
-Lionel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-02-24 14:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 9:24 [igt-dev] [PATCH i-g-t 1/2] lib/i915/perf: fix loading configurations Lionel Landwerlin
2020-02-24 9:24 ` [igt-dev] [PATCH i-g-t 2/2] tests/perf: debug trace when configuration loading fails Lionel Landwerlin
2020-02-24 12:16 ` Chris Wilson
2020-02-24 10:11 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/i915/perf: fix loading configurations Patchwork
2020-02-24 12:15 ` [igt-dev] [PATCH i-g-t 1/2] " Chris Wilson
2020-02-24 14:03 ` Lionel Landwerlin [this message]
2020-02-24 14:04 ` Chris Wilson
2020-02-25 12:19 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " 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=9b5f5bc7-ea2f-3b8e-c35c-146fb0638aa0@intel.com \
--to=lionel.g.landwerlin@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
/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