[PATCH v2] Add decoding for parametered ioctls

Gabriel Laskar gabriel at lse.epita.fr
Wed Jan 21 20:42:14 UTC 2015


On Wed, Jan 21, 2015 at 9:16 PM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Wed, Jan 21, 2015 at 08:53:00PM +0100, Gabriel Laskar wrote:
>> Some ioctls from evdev, hiddev, mixer, uinput, spi and joystick are
>> parametered by a size or a number that is variable. These changes add
>> the display of these ones, and their parameters.
> [...]
>> @@ -398,13 +398,16 @@ sys_ioctl(struct tcb *tcp)
>>       if (entering(tcp)) {
>>               printfd(tcp, tcp->u_arg[0]);
>>               tprints(", ");
>> -             iop = ioctl_lookup(tcp->u_arg[1]);
>> -             if (iop) {
>> -                     tprints(iop->symbol);
>> -                     while ((iop = ioctl_next_match(iop)))
>> -                             tprintf(" or %s", iop->symbol);
>> -             } else
>> -                     ioctl_print_code(tcp->u_arg[1]);
>> +             if (!ioctl_decode_command_number(tcp->u_arg[1])) {
>> +                     iop = ioctl_lookup(tcp->u_arg[1]);
>> +                     if (iop) {
>> +                             tprints(iop->symbol);
>> +                             while ((iop = ioctl_next_match(iop)))
>> +                                     tprintf(" or %s", iop->symbol);
>> +                     } else {
>> +                             ioctl_print_code("%#lx", tcp->u_arg[1]);
>
> ioctl_print_code() takes only one argument.
>
> [...]
>> +             default:
>> +                     return 0;
>> +     }
>> +>>>>>>> Add decoding for parametered ioctls
>> +}
>> +
>>  int
>>  ioctl_decode(struct tcb *tcp, unsigned int code, long arg)
>>  {
>
> Have you tried to compile this code containing merge markers?

Ergh, I had but before the merge... sorry for the noise.



-- 
Gabriel Laskar




More information about the Strace-devel mailing list