<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 11, 2019 at 6:01 PM Patrik Jakobsson <<a href="mailto:pjakobsson@suse.de">pjakobsson@suse.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jun 10, 2019 at 11:49:01PM +0800, Zhibin Li wrote:<br>
> Hi all,<br>
> <br>
> I just finished my final so I didn't do much last week.<br>
> <br>
> Accomplishments:<br>
> - Went through i915 source code to mark down what's missing in the original<br>
> patch set.<br>
> - Started to test i915 manually. But I came across some problems (I will<br>
> mention them below in the questions section.<br>
> <br>
> Questions:<br>
> When I started to test i915 ioctls, I found that it can't be integrated<br>
> into strace's test suite. Please take a look at [1]. It makes sense that<br>
> Patrik uses the driver name linked to the file descriptor to identify the<br>
> specific device. After that the matched ioctl decoder will be invoked.<br>
> Here's my question: Is there any way to tamper the path linked to the fd?<br>
> Something like injection? I mean we usually use fd = -1 in the test but in<br>
> this case it won't work because a valid driver name has to be obtained from<br>
> the fd. Using -1 will simply match no devices.<br>
> Or can we tamper the priv_data in struct tcb when we run tests? Because the<br>
> driver name is stored in priv_data.<br>
> I'm able to test those device specific ioctls by simply returning them. For<br>
> example there is if...else clause to determine which (i915 or something<br>
> else) decoder to invoke. When I want to test i915, I can temporarily remove<br>
> the if...else and return i915_drm_ioctl(). In this way I can manually test<br>
> if it works.<br>
<br>
Hi Zhibin,<br>
If you store the name of the driver (ie "i915") in tcb_priv_data before<br>
drm_is_driver() gets called you would skip drm_get_driver_name()<br>
entirely. Does that solve your problem?<br>
<br>
-Patrik<br>
<br></blockquote><div>Yes it could work. But for now the problem is how to store the name. I mean</div><div>in the test suite there is an option -e inject= for tampering something in the tcb</div><div>but I'm not sure there is an available way to store something in priv_data.</div><div>So I'm looking into the injection implementation to see if I can add support for it.</div><div>Any other suggestions from you guys?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> TODO:<br>
> - As mentioned above, I'm still looking for a better way to test them.<br>
> - Add missing functions in i915 decoder.<br>
> <br>
> BTW is the IRC logger robot absent? I can't see any logs from [2] anymore.<br>
> <br>
> [1] <a href="https://github.com/haoyouab/strace/blob/stuff/drm.c#L28" rel="noreferrer" target="_blank">https://github.com/haoyouab/strace/blob/stuff/drm.c#L28</a><br>
> [2] <a href="https://strace.io/logs" rel="noreferrer" target="_blank">https://strace.io/logs</a><br>
> <br>
> Thanks,<br>
> Zhibin Li<br>
<br>
> -- <br>
> Strace-devel mailing list<br>
> <a href="mailto:Strace-devel@lists.strace.io" target="_blank">Strace-devel@lists.strace.io</a><br>
> <a href="https://lists.strace.io/mailman/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.strace.io/mailman/listinfo/strace-devel</a><br>
<br>
-- <br>
Strace-devel mailing list<br>
<a href="mailto:Strace-devel@lists.strace.io" target="_blank">Strace-devel@lists.strace.io</a><br>
<a href="https://lists.strace.io/mailman/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.strace.io/mailman/listinfo/strace-devel</a><br>
</blockquote></div></div>