[RFC] Add support for tracing memory related syscalls

Namhyung Kim namhyung.kim at lge.com
Thu Oct 18 08:25:27 UTC 2012


Hi,

When I was debugging a memory related problem, I really want to see
only those syscalls but it wans't suppport by strace.  Hence I decided
to create a patch.  I guess others may want this too.

This patch was made mostly by following script:

  $ cat convert-tm.cmd
  s/TD,\t(sys_old_mmap)/TD|TM,\t\1/
  s/TD,\t(sys_mmap)/TD|TM,\t\1/
  s/0,\t(sys_mprotect)/TM,\t\1/
  s/0,\t(sys_munmap)/TM,\t\1/
  s/0,\t(sys_brk)/TM,\t\1/
  s/0,\t(sys_mremap)/TM,\t\1/
  s/0,\t(sys_msync)/TM,\t\1/
  s/0,\t(sys_mincore)/TM,\t\1/
  s/0,\t(sys_madvise)/TM,\t\1/
  s/0,\t(sys_mlock)/TM,\t\1/
  s/0,\t(sys_munlock)/TM,\t\1/
  s/0,\t(sys_mlockall)/TM,\t\1/
  s/0,\t(sys_munlockall)/TM,\t\1/
  s/0,\t(sys_remap_file_pages)/TM,\t\1/
  s/0,\t(sys_mbind)/TM,\t\1/
  s/0,\t(sys_set_mempolicy)/TM,\t\1/
  s/0,\t(sys_get_mempolicy)/TM,\t\1/
  s/0,\t(sys_migrate_pages)/TM,\t\1/
  s/TD\t(sys_vmsplice)/TD|TM,\t\1/
  s/0,\t(sys_move_pages)/TM,\t\1/
  
  $ for F in $(find linux/ -name syscallent.h); do sed -r -f convert-tm.cmd -i $F; done

Tested on my Fedora 17 x86_64 box.

Thanks,
Namhyung


 defs.h                        |  3 +-
 linux/alpha/syscallent.h      | 30 +++++++-------
 linux/arm/syscallent.h        | 38 ++++++++---------
 linux/avr32/syscallent.h      | 26 ++++++------
 linux/bfin/syscallent.h       | 38 ++++++++---------
 linux/hppa/syscallent.h       | 30 +++++++-------
 linux/i386/syscallent.h       | 40 +++++++++---------
 linux/ia64/syscallent.h       | 36 ++++++++---------
 linux/m68k/syscallent.h       | 40 +++++++++---------
 linux/microblaze/syscallent.h | 40 +++++++++---------
 linux/mips/syscallent.h       | 94 +++++++++++++++++++++----------------------
 linux/powerpc/syscallent.h    | 40 +++++++++---------
 linux/s390/syscallent.h       | 38 ++++++++---------
 linux/s390x/syscallent.h      | 36 ++++++++---------
 linux/sh/syscallent.h         | 40 +++++++++---------
 linux/sh64/syscallent.h       | 40 +++++++++---------
 linux/sparc/syscallent.h      | 38 ++++++++---------
 linux/tile/syscallent.h       | 34 ++++++++--------
 linux/x32/syscallent.h        | 36 ++++++++---------
 linux/x86_64/syscallent.h     | 36 ++++++++---------
 strace.1                      |  3 ++
 syscall.c                     |  3 ++
 22 files changed, 383 insertions(+), 376 deletions(-)

-- 
1.7.11.7





More information about the Strace-devel mailing list