qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Taylor Simpson <tsimpson@quicinc.com>, qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi, laurent@vivier.eu
Subject: Re: [PATCH] Enable strace for TARGET_NR_llseek
Date: Tue, 17 Mar 2020 10:19:34 +0100	[thread overview]
Message-ID: <f61c50e4-4d71-2260-c3aa-555d7bf300b5@redhat.com> (raw)
In-Reply-To: <1584391940-29281-1-git-send-email-tsimpson@quicinc.com>

On 3/16/20 9:52 PM, Taylor Simpson wrote:
> linux-user/syscall.c handles the case where TARGET_NR_llseek (one underscore)
> is defined and TARGET_NR__llseek (two underscores)
>      /* Newer kernel ports have llseek() instead of _llseek() */
>      #if defined(TARGET_NR_llseek) && !defined(TARGET_NR__llseek)
>      #define TARGET_NR__llseek TARGET_NR_llseek
>      #endif
> 
> Unfortunately, strace will print "Unknown syscall" in this case.  This patch
> fixes that problem.
> 
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>   linux-user/strace.c    | 2 +-
>   linux-user/strace.list | 3 +++
>   2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 4f7130b..4bcc00b 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -1667,7 +1667,7 @@ print_linkat(const struct syscallname *name,
>   }
>   #endif
>   
> -#ifdef TARGET_NR__llseek
> +#ifdef defined(TARGET_NR__llseek) || defined(TARGET_NR_llseek)
>   static void
>   print__llseek(const struct syscallname *name,
>       abi_long arg0, abi_long arg1, abi_long arg2,
> diff --git a/linux-user/strace.list b/linux-user/strace.list
> index d49a1e9..5a01e95 100644
> --- a/linux-user/strace.list
> +++ b/linux-user/strace.list
> @@ -503,6 +503,9 @@
>   #ifdef TARGET_NR__llseek
>   { TARGET_NR__llseek, "_llseek" , NULL, print__llseek, NULL },
>   #endif
> +#ifdef TARGET_NR_llseek
> +{ TARGET_NR_llseek, "_llseek" , NULL, print__llseek, NULL },
> +#endif
>   #ifdef TARGET_NR_lock
>   { TARGET_NR_lock, "lock" , NULL, NULL, NULL },
>   #endif
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



      reply	other threads:[~2020-03-17  9:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 20:52 [PATCH] Enable strace for TARGET_NR_llseek Taylor Simpson
2020-03-17  9:19 ` Philippe Mathieu-Daudé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f61c50e4-4d71-2260-c3aa-555d7bf300b5@redhat.com \
    --to=philmd@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=tsimpson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).