[RFC PATCH v3 00/14] [PIDNS] Use printpid in decoders

Ákos Uzonyi uzonyi.akos at gmail.com
Sat Jun 13 11:25:22 UTC 2020


From: Uzonyi Ákos <uzonyi.akos at gmail.com>

The patches before "PID namespace translation support" are preparations/fixes
to make this series working and passing the test suite. I consider these to be
ready for merging.

The last three patch modify the decoders to print PIDs using printpid.
I'm not sure if I found all places where PIDs are printed, so if you
know any that I missed, please tell me.

Changes in v3:
  - Reword some commit messages
  - Remove trailing comma from PRINT_FIELD_LEN
  - Rename B-tree to trie in comments and variable names too
  - Fix PID printing in tests/pidfd_send_signal.c
  - Implement PID translation in print_sockaddr and printsiginfo too
Changes in v2:
  - Provide rationale for a few commits
  - print_fields.h: remove "struct_t_" argument from PRINT_FIELD_LEN
  - pidns.c:translate_id_dir: use "%ld" for printing printing proc_pid in
  - kcmp.c: undo my mistake (KCMP_EPOLL_TFD)
  - tests/inject-nf.c: update comment
  - Fix tests/kcmp.c:
    - print fd decoding only if pid == getpid()
    - replace getppid() with -1

Ákos Uzonyi (14):
  kcmp.c: fix path decoding
  tests/inject-nf.test: replace getpid with geteuid
  Add *kill, pidfd_send_signal syscalls to %process class
  print_fields.h: add PRINT_FIELD_LEN macro
  Move ilog* functions from util.c to defs.h
  Do not use PIDs larger than INT_MAX in tests
  PID namespace translation support
  [squash] pidns.c: use long for strtol result
  [squash] pidns.c: print less error message
  [squash] Rename btree to trie
  [squash] Rename btree files
  Use printpid in decoders
  [squash] Use printpid in print_sockaddr and printsiginfo
  Add SYS_FUNC(tkill)

 Makefile.am                    |   3 +
 affinity.c                     |   6 +-
 block.c                        |   2 +-
 bpf.c                          |   2 +-
 capability.c                   |   4 +-
 clone.c                        |  14 +-
 defs.h                         |  92 ++++-
 fcntl.c                        |  16 +-
 get_robust_list.c              |   3 +-
 getpid.c                       |  44 +++
 ioprio.c                       |  26 +-
 kcmp.c                         |   7 +-
 linux/32/syscallent.h          |   6 +-
 linux/64/syscallent.h          |   6 +-
 linux/alpha/syscallent.h       |   8 +-
 linux/arm/syscallent.h         |   6 +-
 linux/avr32/syscallent.h       |   6 +-
 linux/bfin/syscallent.h        |   6 +-
 linux/dummy.h                  |   7 +-
 linux/hppa/syscallent.h        |   6 +-
 linux/i386/syscallent.h        |   6 +-
 linux/ia64/syscallent.h        |   6 +-
 linux/m68k/syscallent.h        |   6 +-
 linux/microblaze/syscallent.h  |   6 +-
 linux/mips/syscallent-compat.h |  10 +-
 linux/mips/syscallent-n32.h    |   6 +-
 linux/mips/syscallent-n64.h    |   6 +-
 linux/mips/syscallent-o32.h    |   6 +-
 linux/powerpc/syscallent.h     |   6 +-
 linux/powerpc64/syscallent.h   |   6 +-
 linux/s390/syscallent.h        |   6 +-
 linux/s390x/syscallent.h       |   6 +-
 linux/sh/syscallent.h          |   6 +-
 linux/sh64/syscallent.h        |   6 +-
 linux/sparc/syscallent.h       |   6 +-
 linux/sparc64/syscallent.h     |   6 +-
 linux/syscallent-common.h      |   2 +-
 linux/x32/syscallent.h         |   6 +-
 linux/x86_64/syscallent.h      |   6 +-
 linux/xtensa/syscallent.h      |   6 +-
 msghdr.c                       |   6 +-
 net.c                          |  90 +----
 netlink.c                      |   5 +-
 numa.c                         |   6 +-
 pidfd_open.c                   |   2 +-
 pidns.c                        | 634 +++++++++++++++++++++++++++++++++
 print_fields.h                 |  42 ++-
 print_group_req.c              |   2 +-
 printsiginfo.c                 |  28 +-
 printsiginfo.h                 |   2 +-
 process.c                      |   3 +-
 process_vm.c                   |   6 +-
 resource.c                     |  27 +-
 sched.c                        |  25 +-
 signal.c                       |  34 +-
 sock.c                         |  10 +-
 sockaddr.c                     |  35 +-
 strace.c                       |  10 +-
 syscall.c                      |  15 +
 tests/bpf.c                    |   8 +-
 tests/inject-nf.c              |  19 +-
 tests/inject-nf.test           |  11 +-
 tests/ioctl_block.c            |   2 +-
 tests/kcmp.c                   |  25 +-
 tests/pidfd_send_signal.c      |   4 +-
 trie.c                         | 344 ++++++++++++++++++
 trie.h                         |  90 +++++
 util.c                         |  82 +----
 wait.c                         |  35 +-
 69 files changed, 1621 insertions(+), 371 deletions(-)
 create mode 100644 getpid.c
 create mode 100644 pidns.c
 create mode 100644 trie.c
 create mode 100644 trie.h

--
2.27.0



More information about the Strace-devel mailing list