linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
To: "linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>, Paul Clarke <pc@us.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: sys_exit: NR -1
Date: Wed, 12 Jun 2019 12:02:53 +0530	[thread overview]
Message-ID: <1560320989.8h9se8cb9p.naveen@linux.ibm.com> (raw)
In-Reply-To: <2f004b41-4f6f-3e6f-227a-cb199b8429d2@us.ibm.com>

Paul Clarke wrote:
> What are the circumstances in which raw_syscalls:sys_exit reports "-1" for the syscall ID?
> 
>     perf  5375 [007] 59632.478528:   raw_syscalls:sys_enter: NR 1 (3, 9fb888, 8, 2d83740, 1, 7ffff)
>     perf  5375 [007] 59632.478532:    raw_syscalls:sys_exit: NR 1 = 8
>     perf  5375 [007] 59632.478538:   raw_syscalls:sys_enter: NR 15 (11, 7ffffca734b0, 7ffffca73380, 2d83740, 1, 7ffff)
>     perf  5375 [007] 59632.478539:    raw_syscalls:sys_exit: NR -1 = 8
>     perf  5375 [007] 59632.478543:   raw_syscalls:sys_enter: NR 16 (4, 2401, 0, 2d83740, 1, 0)
>     perf  5375 [007] 59632.478551:    raw_syscalls:sys_exit: NR 16 = 0

Which architecture?
For powerpc, see:

static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
{
	/*
	 * Note that we are returning an int here. That means 0xffffffff, ie.
	 * 32-bit negative 1, will be interpreted as -1 on a 64-bit kernel.
	 * This is important for seccomp so that compat tasks can set r0 = -1
	 * to reject the syscall.
	 */
	return TRAP(regs) == 0xc00 ? regs->gpr[0] : -1;
}


- Naveen



       reply	other threads:[~2019-06-12  6:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2f004b41-4f6f-3e6f-227a-cb199b8429d2@us.ibm.com>
2019-06-12  6:32 ` Naveen N. Rao [this message]
2019-06-13 21:00   ` sys_exit: NR -1 Paul Clarke
2019-06-13 21:11     ` Paul Clarke
2019-06-13 21:56       ` sys_exit: NR 0 (was "sys_exit: NR -1") Paul Clarke

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=1560320989.8h9se8cb9p.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.ibm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pc@us.ibm.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).