]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc/tracing: Allow tracing of mmap syscalls
authorBalbir Singh <bsingharora@gmail.com>
Wed, 12 Apr 2017 06:35:19 +0000 (16:35 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 12 Apr 2017 12:32:43 +0000 (22:32 +1000)
commit9c355917fcf006af47ffaa5ae43a1a804764a6f6
treee04d91a6bbaa0272f6320ab01f575ce7008b1b6d
parent03dfee6d5f824d14e3ecb742518740de69e603cc
powerpc/tracing: Allow tracing of mmap syscalls

Currently sys_mmap() and sys_mmap2() (32-bit only), are not visible to the
syscall tracing machinery. This means users are not able to see the execution of
mmap() syscalls using the syscall tracer.

Fix that by using SYSCALL_DEFINE6 for sys_mmap() and sys_mmap2() so that the
meta-data associated with these syscalls is visible to the syscall tracer.

A side-effect of this change is that the return type has changed from unsigned
long to long. However this should have no effect, the only code in the kernel
which uses the result of these syscalls is in the syscall return path, which is
written in asm and treats the result as unsigned regardless.

Example output:
  cat-3399  [001] ....   196.542410: sys_mmap(addr: 7fff922a0000, len: 20000, prot: 3, flags: 812, fd: 3, offset: 1b0000)
  cat-3399  [001] ....   196.542443: sys_mmap -> 0x7fff922a0000
  cat-3399  [001] ....   196.542668: sys_munmap(addr: 7fff922c0000, len: 6d2c)
  cat-3399  [001] ....   196.542677: sys_munmap -> 0x0

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Massage change log, add detail on return type change]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/syscalls.h
arch/powerpc/kernel/syscalls.c