[RFC PATCH v3 2/3] drm: implement decoding of DRM ioctls
Eugene Syromyatnikov
evgsyr at gmail.com
Thu Aug 1 17:31:02 UTC 2019
On Thu, Aug 1, 2019 at 6:06 PM Zhibin Li <haoyouab at gmail.com> wrote:
>
>
>
> On Mon, Jul 29, 2019 at 9:58 AM Eugene Syromiatnikov <esyr at redhat.com> wrote:
>>
>>
>> > +# include "xlat/drm_stat_type.h"
>> > +
>> > +static int
>> > +drm_get_stats(struct tcb *const tcp, const kernel_ulong_t arg)
>> > +{
>> > + struct_drm_stats stats;
>> > +
>> > + if (exiting(tcp)) {
>> > + tprints(", ");
>> > + if (umove_or_printaddr(tcp, arg, &stats))
>> > + return RVAL_IOCTL_DECODED;
>> > + PRINT_FIELD_U("{", stats, count);
>> > + tprints(", data=[");
>> > +
>>
>> > + for (unsigned int i = 0; i < 15; i++) {
>> Why is "15" hard-coded?
>>
>> Also, it seems that it should go up to "count".
>
>
> I just found that in kernel commit v3.12-rc1~61^2~98, GET_STATS
> was no-oped out and there is a explanation about it. Do we have to
> support decoding of this one? (Some other ioctls may come across
> similar situations, how do we choose which is the oldest version to
> support?)
Currently, strace tends to support Linux 2.6.18+; realistically, RHEL
6 is likely the only (still supported) distribution that has DRM code
that old. So, I would say that it would be nice to properly decode it,
unless it imposes too much burden.
--
Eugene Syromyatnikov
mailto:evgsyr at gmail.com
xmpp:esyr at jabber.{ru|org}
More information about the Strace-devel
mailing list