diff mbox series

linux-user: Improve strace output of pread64() and pwrite64()

Message ID 20230115090415.6936-1-deller@gmx.de (mailing list archive)
State New, archived
Headers show
Series linux-user: Improve strace output of pread64() and pwrite64() | expand

Commit Message

Helge Deller Jan. 15, 2023, 9:04 a.m. UTC
Make the strace look nicer for those two syscalls.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/strace.list | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.38.1

Comments

Laurent Vivier Jan. 26, 2023, 3:12 p.m. UTC | #1
Le 15/01/2023 à 10:04, Helge Deller a écrit :
> Make the strace look nicer for those two syscalls.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/strace.list | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/strace.list b/linux-user/strace.list
> index 909298099e..41bb6bbfbc 100644
> --- a/linux-user/strace.list
> +++ b/linux-user/strace.list
> @@ -1061,7 +1061,7 @@
>   { TARGET_NR_prctl, "prctl" , NULL, NULL, NULL },
>   #endif
>   #ifdef TARGET_NR_pread64
> -{ TARGET_NR_pread64, "pread64" , NULL, NULL, NULL },
> +{ TARGET_NR_pread64, "pread64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
>   #endif
>   #ifdef TARGET_NR_preadv
>   { TARGET_NR_preadv, "preadv" , NULL, NULL, NULL },
> @@ -1092,7 +1092,7 @@
>   { TARGET_NR_putpmsg, "putpmsg" , NULL, NULL, NULL },
>   #endif
>   #ifdef TARGET_NR_pwrite64
> -{ TARGET_NR_pwrite64, "pwrite64" , NULL, NULL, NULL },
> +{ TARGET_NR_pwrite64, "pwrite64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
>   #endif
>   #ifdef TARGET_NR_pwritev
>   { TARGET_NR_pwritev, "pwritev" , NULL, NULL, NULL },
> --
> 2.38.1
> 
> 

You need to use regpairs_aligned() and target_offset64() to correctly display the offset.

Thanks,
Laurent
Helge Deller Jan. 27, 2023, 8:31 p.m. UTC | #2
On 1/26/23 16:12, Laurent Vivier wrote:
> Le 15/01/2023 à 10:04, Helge Deller a écrit :
>> Make the strace look nicer for those two syscalls.
>>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> ---
>>   linux-user/strace.list | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/linux-user/strace.list b/linux-user/strace.list
>> index 909298099e..41bb6bbfbc 100644
>> --- a/linux-user/strace.list
>> +++ b/linux-user/strace.list
>> @@ -1061,7 +1061,7 @@
>>   { TARGET_NR_prctl, "prctl" , NULL, NULL, NULL },
>>   #endif
>>   #ifdef TARGET_NR_pread64
>> -{ TARGET_NR_pread64, "pread64" , NULL, NULL, NULL },
>> +{ TARGET_NR_pread64, "pread64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
>>   #endif
>>   #ifdef TARGET_NR_preadv
>>   { TARGET_NR_preadv, "preadv" , NULL, NULL, NULL },
>> @@ -1092,7 +1092,7 @@
>>   { TARGET_NR_putpmsg, "putpmsg" , NULL, NULL, NULL },
>>   #endif
>>   #ifdef TARGET_NR_pwrite64
>> -{ TARGET_NR_pwrite64, "pwrite64" , NULL, NULL, NULL },
>> +{ TARGET_NR_pwrite64, "pwrite64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
>>   #endif
>>   #ifdef TARGET_NR_pwritev
>>   { TARGET_NR_pwritev, "pwritev" , NULL, NULL, NULL },
>> --
>
> You need to use regpairs_aligned() and target_offset64() to correctly display the offset.

Good catch!
I'll send an fixed patch.

Thanks!
Helge
diff mbox series

Patch

diff --git a/linux-user/strace.list b/linux-user/strace.list
index 909298099e..41bb6bbfbc 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1061,7 +1061,7 @@ 
 { TARGET_NR_prctl, "prctl" , NULL, NULL, NULL },
 #endif
 #ifdef TARGET_NR_pread64
-{ TARGET_NR_pread64, "pread64" , NULL, NULL, NULL },
+{ TARGET_NR_pread64, "pread64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_preadv
 { TARGET_NR_preadv, "preadv" , NULL, NULL, NULL },
@@ -1092,7 +1092,7 @@ 
 { TARGET_NR_putpmsg, "putpmsg" , NULL, NULL, NULL },
 #endif
 #ifdef TARGET_NR_pwrite64
-{ TARGET_NR_pwrite64, "pwrite64" , NULL, NULL, NULL },
+{ TARGET_NR_pwrite64, "pwrite64" , "%s(%d,%p,%d,%u,%u)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_pwritev
 { TARGET_NR_pwritev, "pwritev" , NULL, NULL, NULL },