Skip to content

tracing: add compat syscall support v3

Jason Baron lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 16 repliesIn review

Changes in v3 from the cover letter

- create a separate "compat_syscalls" event subsystem
- ARCH_COMPAT_SYSCALL_DEFINE#N() tacks "sys32" to start of syscall name
- COMPAT_SYSCALL_DEFINE#N() tacks "compat_sys" to start of syscall name
- both above macros create perf events as: [enter|exit]_compat_sys_blah
- non-compat syscall naming changes to: [enter|exit]_sys_blah
- removes any unreferenced compat syscalls from debugfs

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14x86: add NR_syscalls_compat, make ia32 syscall table visiblearch/x86/ia32/ia32entry.S arch/x86/include/asm/compat.h+5 -00 replies
2/14x86: add arch_compat_syscall_addr()arch/x86/include/asm/syscall.h arch/x86/kernel/ftrace.c+13 -01 reply
3/14compat: have generic is_compat_task for !CONFIG_COMPATarch/s390/include/asm/compat.h arch/s390/kernel/ptrace.c arch/s390/kernel/setup.c +8 more+16 -110 replies
4/14tracing: remove syscall bitmaps in preparation for compat supportinclude/linux/syscalls.h include/trace/syscall.h kernel/trace/trace_syscalls.c+32 -220 replies
5/14tracing: move __start_ftrace_events and __stop_ftrace_events to header fileinclude/linux/ftrace_event.h kernel/trace/trace_events.c+3 -30 replies
6/14tracing: add tracing support for compat syscallsinclude/linux/compat.h include/trace/syscall.h kernel/trace/trace.h +1 more+86 -83 replies
7/14syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()include/linux/syscalls.h+38 -124 replies
8/14x86, compat: convert ia32 layer to usearch/x86/ia32/sys_ia32.c+53 -530 replies
9/14syscalls: add new COMPAT_SYSCALL_DEFINE#N() macroinclude/linux/syscalls.h+7 -00 replies
10/14compat: convert to use COMPAT_SYSCALL_DEFINE#N()kernel/compat.c+51 -550 replies
11/14compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macrosfs/compat.c+72 -750 replies
12/14tags: recognize compat syscallsscripts/tags.sh+6 -20 replies
13/14cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macroinclude/linux/syscalls.h+6 -80 replies
14/14tracing: make a "compat_syscalls" tracing subsysinclude/linux/syscalls.h+19 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] tracing: add compat syscall support v3

Hi,

Re-post to add infrastructure for compat syscall event tracing support. This patch series also adds x86_64 arch specific support as an example consumer of the new infrastructure.

Arches can request compat syscall tracing by setting:
__HAVE_ARCH_FTRACE_COMPAT_SYSCALLS, if CONFIG_COMPAT and CONFIG_FTRACE_SYSCALLS are set. Arches then need to implement the following interfaces:

1) int is_compat_task(void);
- most arches seem to have this already
2) unsigned long arch_compat_syscall_addr(int nr);
- returns a pointer to the compat syscall entry corresponding to syscall 'nr'
3) int NR_syscalls_compat;
- number of entries in the compat syscall table.

thanks,

-Jason

Changes in v3:

- create a separate "compat_syscalls" event subsystem
- ARCH_COMPAT_SYSCALL_DEFINE#N() tacks "sys32" to start of syscall name
- COMPAT_SYSCALL_DEFINE#N() tacks "compat_sys" to start of syscall name
- both above macros create perf events as: [enter|exit]_compat_sys_blah
- non-compat syscall naming changes to: [enter|exit]_sys_blah
- removes any unreferenced compat syscalls from debugfs

Heiko Carstens (1):
compat: have generic is_compat_task for !CONFIG_COMPAT

Jason Baron (13):
x86: add NR_syscalls_compat, make ia32 syscall table visible
x86: add arch_compat_syscall_addr()
tracing: remove syscall bitmaps in preparation for compat support
tracing: move __start_ftrace_events and __stop_ftrace_events to
header file
tracing: add tracing support for compat syscalls
syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
x86, compat: convert ia32 layer to use
syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro
compat: convert to use COMPAT_SYSCALL_DEFINE#N()
compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros
tags: recognize compat syscalls
cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro
tracing: make a "compat_syscalls" tracing subsys

 arch/s390/include/asm/compat.h  |    7 --
 arch/s390/kernel/ptrace.c       |    2 +-
 arch/s390/kernel/setup.c        |    2 +-
 arch/s390/mm/mmap.c             |    2 +-
 arch/x86/ia32/ia32entry.S       |    3 +
 arch/x86/ia32/sys_ia32.c        |  106 ++++++++++++++--------------
 arch/x86/include/asm/compat.h   |    2 +
 arch/x86/include/asm/syscall.h  |    5 ++
 arch/x86/kernel/ftrace.c        |    8 ++
 drivers/s390/block/dasd_eckd.c  |    2 +-
 drivers/s390/block/dasd_ioctl.c |    1 +
 drivers/s390/char/fs3270.c      |    1 +
 drivers/s390/char/vmcp.c        |    1 +
 drivers/s390/cio/chsc_sch.c     |    1 +
 drivers/s390/scsi/zfcp_cfdc.c   |    1 +
 fs/compat.c                     |  147 +++++++++++++++++++--------------------
 include/linux/compat.h          |    9 +++
 include/linux/ftrace_event.h    |    3 +
 include/linux/syscalls.h        |   91 +++++++++++++++++-------
 include/trace/syscall.h         |    8 ++
 kernel/compat.c                 |  106 ++++++++++++++---------------
 kernel/trace/trace.h            |    2 +
 kernel/trace/trace_events.c     |    3 -
 kernel/trace/trace_syscalls.c   |  124 +++++++++++++++++++++++++--------
 scripts/tags.sh                 |    8 ++-
 25 files changed, 392 insertions(+), 253 deletions(-)