[PATCH] Linux: Enhance glibcsyscalls.py to support listing system calls

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon May 11 20:21:19 GMT 2020



On 11/05/2020 17:17, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 11/05/2020 17:13, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>>> +class ArchSyscall:
>>>>> +    """Canonical name and location of a syscall header."""
>>>>> +
>>>>> +    def __init__(self, name, path):
>>>>> +        self.name = name
>>>>> +        self.path = path
>>>>> +
>>>>> +    def __repr__(self):
>>>>> +        return 'ArchSyscall(name={!r}, patch={!r})'.format(
>>>>> +            self.name, self.path)
>>>>
>>>> I am missing why you need to call the repr() for the str objects issued
>>>> by the generator below.
>>>
>>> I don't, but I want to make sure that we get good debugging output if
>>> needed.
>>>
>>> Should I still make the __doc__ change?  The --help output from the
>>> script itself is quite reasonable.
>>>
>>
>> I am fine with the __doc__ change.
> 
> Uhm, which __doc__ change?  There isn't one.

Sorry, I meant patch is ok as is.

> 
> Output from the script is quite reasonable without it:
> 
> $ python3 sysdeps/unix/sysv/linux/glibcsyscalls.py 
> usage: glibcsyscalls.py [-h] {list-headers,query-syscall} ...
> glibcsyscalls.py: error: the following arguments are required: command
> $ python3 sysdeps/unix/sysv/linux/glibcsyscalls.py  --help
> usage: glibcsyscalls.py [-h] {list-headers,query-syscall} ...
> 
> positional arguments:
>   {list-headers,query-syscall}
>     list-headers        Print the absolute paths of all arch-syscall.h header
>                         files
>     query-syscall       Summarize the implementation status of system calls
> 
> optional arguments:
>   -h, --help            show this help message and exit
> 


More information about the Libc-alpha mailing list