Blame SOURCES/0134-PID-namespace-translation-support.patch

089393
From bf533b84fd7200399c9b0e68fdf10c6aaf8b1a7a Mon Sep 17 00:00:00 2001
089393
From: =?UTF-8?q?=C3=81kos=20Uzonyi?= <uzonyi.akos@gmail.com>
089393
Date: Mon, 8 Jun 2020 19:01:03 +0200
089393
Subject: [PATCH 134/138] PID namespace translation support
089393
089393
* defs.h (pidns_translation): New variable.
089393
(tcb): Add pid_ns field.
089393
(RVAL_MASK): Change value from 013 to 017.
089393
(RVAL_TID, RVAL_SID, RVAL_TGID, RVAL_PGID): New definitions.
089393
(pid_type): New enum.
089393
(pidns_init, translate_pid, get_proc_pid, printpid, printpid_tgid_pgid):
089393
New function declarations.
089393
* largefile_wrappers.h (fstat_fd): New macro.
089393
* pidns.c: New file.
089393
* trie.c: New file.
089393
* trie.h: New file.
089393
* Makefile.am (libstrace_a_SOURCES): Add trie.c, trie.h, pidns.c.
089393
* strace.c (pidns_translation): New variable.
089393
(init): Add --pidns-translation option.
089393
* syscall.c (syscall_exiting_trace): Handle RVAL_* return values.
089393
* NEWS: Mention this.
089393
* strace.1.in: Add description for new option.
089393
089393
Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
089393
089393
Conflicts:
089393
	NEWS
089393
---
089393
 Makefile.am          |   3 +
089393
 defs.h               |  56 ++++-
089393
 largefile_wrappers.h |   2 +
089393
 pidns.c              | 608 +++++++++++++++++++++++++++++++++++++++++++++++++++
089393
 strace.1.in          |   4 +
089393
 strace.c             |   9 +
089393
 syscall.c            |  15 ++
089393
 trie.c               | 290 ++++++++++++++++++++++++
089393
 trie.h               |  92 ++++++++
089393
 9 files changed, 1078 insertions(+), 1 deletion(-)
089393
 create mode 100644 pidns.c
089393
 create mode 100644 trie.c
089393
 create mode 100644 trie.h
089393
089393
Index: strace-5.7/Makefile.am
089393
===================================================================
089393
--- strace-5.7.orig/Makefile.am	2020-09-09 15:50:13.471900510 +0200
089393
+++ strace-5.7/Makefile.am	2020-09-09 15:52:09.159983257 +0200
089393
@@ -233,6 +233,7 @@
089393
 	personality.c	\
089393
 	pidfd_getfd.c	\
089393
 	pidfd_open.c	\
089393
+	pidns.c		\
089393
 	pkeys.c		\
089393
 	poll.c		\
089393
 	prctl.c		\
089393
@@ -344,6 +345,8 @@
089393
 	time.c		\
089393
 	times.c		\
089393
 	trace_event.h	\
089393
+	trie.c 		\
089393
+	trie.h 		\
089393
 	truncate.c	\
089393
 	ubi.c		\
089393
 	ucopy.c		\
089393
Index: strace-5.7/defs.h
089393
===================================================================
089393
--- strace-5.7.orig/defs.h	2020-09-09 15:50:13.473900511 +0200
089393
+++ strace-5.7/defs.h	2020-09-09 15:52:09.159983257 +0200
089393
@@ -280,6 +280,13 @@
089393
 	struct timespec etime;	/* Syscall entry time (CLOCK_MONOTONIC) */
089393
 	struct timespec delay_expiration_time; /* When does the delay end */
089393
 
089393
+	/*
089393
+	 * The ID of the PID namespace of this process
089393
+	 * (inode number of /proc/<pid>/ns/pid)
089393
+	 * (0: not initialized)
089393
+	 */
089393
+	unsigned int pid_ns;
089393
+
089393
 	struct mmap_cache_t *mmap_cache;
089393
 
089393
 	/*
089393
@@ -413,7 +420,11 @@
089393
 # define RVAL_HEX	001	/* hex format */
089393
 # define RVAL_OCTAL	002	/* octal format */
089393
 # define RVAL_FD		010	/* file descriptor */
089393
-# define RVAL_MASK	013	/* mask for these values */
089393
+# define RVAL_TID	011	/* task ID */
089393
+# define RVAL_SID	012	/* session ID */
089393
+# define RVAL_TGID	013	/* thread group ID */
089393
+# define RVAL_PGID	014	/* process group ID */
089393
+# define RVAL_MASK	017	/* mask for these values */
089393
 
089393
 # define RVAL_STR	020	/* Print `auxstr' field after return val */
089393
 # define RVAL_NONE	040	/* Print nothing */
089393
@@ -428,6 +439,16 @@
089393
 
089393
 # define indirect_ipccall(tcp) (tcp_sysent(tcp)->sys_flags & TRACE_INDIRECT_SUBCALL)
089393
 
089393
+enum pid_type {
089393
+	PT_TID,
089393
+	PT_TGID,
089393
+	PT_PGID,
089393
+	PT_SID,
089393
+
089393
+	PT_COUNT,
089393
+	PT_NONE = -1
089393
+};
089393
+
089393
 enum sock_proto {
089393
 	SOCK_PROTO_UNKNOWN,
089393
 	SOCK_PROTO_UNIX,
089393
@@ -469,6 +490,7 @@
089393
 extern int Tflag_width;
089393
 extern bool iflag;
089393
 extern bool count_wallclock;
089393
+extern unsigned int pidns_translation;
089393
 /* are we filtering traces based on paths? */
089393
 extern struct path_set {
089393
 	const char **paths_selected;
089393
@@ -984,6 +1006,29 @@
089393
 extern kernel_ulong_t *
089393
 fetch_indirect_syscall_args(struct tcb *, kernel_ulong_t addr, unsigned int n_args);
089393
 
089393
+extern void pidns_init(void);
089393
+
089393
+/**
089393
+ * Returns the pid of the tracee as present in /proc of the tracer (can be
089393
+ * different from tcp->pid if /proc and the tracer process are in different PID
089393
+ * namespaces).
089393
+ */
089393
+extern int get_proc_pid(struct tcb *);
089393
+
089393
+/**
089393
+ * Translates a pid from tracee's namespace to our namepace.
089393
+ *
089393
+ * @param tcp             The tcb of the tracee
089393
+ *                        (NULL: from_id is in strace's namespace. Useful for
089393
+ *                         getting the proc PID of from_id)
089393
+ * @param from_id         The id to be translated
089393
+ * @param type            The PID type of from_id
089393
+ * @param proc_pid_ptr    If not NULL, writes the proc PID to this location
089393
+ * @return                The translated id, or 0 if translation fails.
089393
+ */
089393
+extern int translate_pid(struct tcb *, int dest_id, enum pid_type type,
089393
+		    int *proc_pid_ptr);
089393
+
089393
 extern void
089393
 dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size);
089393
 
089393
@@ -1059,6 +1104,15 @@
089393
  * of the tracee the descriptor tcp).  This is a stub.
089393
  */
089393
 extern void printfd_pid_tracee_ns(struct tcb *tcp, pid_t pid, int fd);
089393
+
089393
+/** Prints a PID specified in the tracee's PID namespace */
089393
+extern void printpid(struct tcb *, int pid, enum pid_type type);
089393
+
089393
+/**
089393
+ * Prints pid as a TGID if positive, and PGID if negative
089393
+ * (like the first argument of kill).
089393
+ */
089393
+extern void printpid_tgid_pgid(struct tcb *, int pid);
089393
 extern void print_sockaddr(struct tcb *, const void *sa, int len);
089393
 extern bool
089393
 print_inet_addr(int af, const void *addr, unsigned int len, const char *var_name);
089393
Index: strace-5.7/largefile_wrappers.h
089393
===================================================================
089393
--- strace-5.7.orig/largefile_wrappers.h	2020-09-09 15:50:13.473900511 +0200
089393
+++ strace-5.7/largefile_wrappers.h	2020-09-09 15:50:18.017903762 +0200
089393
@@ -29,6 +29,7 @@
089393
 #  else
089393
 #   define fcntl_fd fcntl
089393
 #  endif
089393
+#  define fstat_fd fstat64
089393
 #  define strace_stat_t struct stat64
089393
 #  define stat_file stat64
089393
 #  define struct_dirent struct dirent64
089393
@@ -39,6 +40,7 @@
089393
 #  define open_file open
089393
 #  define fopen_stream fopen
089393
 #  define fcntl_fd fcntl
089393
+#  define fstat_fd fstat
089393
 #  define strace_stat_t struct stat
089393
 #  define stat_file stat
089393
 #  define struct_dirent struct dirent
089393
Index: strace-5.7/pidns.c
089393
===================================================================
089393
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
089393
+++ strace-5.7/pidns.c	2020-09-09 15:50:18.018903762 +0200
089393
@@ -0,0 +1,608 @@
089393
+/*
089393
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
089393
+ * All rights reserved.
089393
+ *
089393
+ * SPDX-License-Identifier: LGPL-2.1-or-later
089393
+ */
089393
+
089393
+#include "defs.h"
089393
+
089393
+
089393
+#include <dirent.h>
089393
+#include <fcntl.h>
089393
+#include <stdint.h>
089393
+#include <string.h>
089393
+#include <unistd.h>
089393
+
089393
+#include <asm/unistd.h>
089393
+
089393
+#include <sys/ioctl.h>
089393
+#include <sys/param.h>
089393
+#include <sys/types.h>
089393
+#include <sys/stat.h>
089393
+
089393
+#include "largefile_wrappers.h"
089393
+#include "trie.h"
089393
+#include "nsfs.h"
089393
+#include "xmalloc.h"
089393
+#include "xstring.h"
089393
+
089393
+/**
089393
+ * Key:   PID NS ID
089393
+ * Value: a btree:
089393
+ *           Key:   a process PID in NS
089393
+ *           Value: the process's PID as present in /proc
089393
+ */
089393
+static struct trie *ns_pid_to_proc_pid[PT_COUNT];
089393
+
089393
+/**
089393
+ * Key:   Proc PID
089393
+ * Value: struct proc_data
089393
+ */
089393
+static struct trie *proc_data_cache;
089393
+
089393
+static bool ns_get_parent_enotty = false;
089393
+
089393
+static const char tid_str[]  = "NSpid:\t";
089393
+static const char tgid_str[] = "NStgid:\t";
089393
+static const char pgid_str[] = "NSpgid:\t";
089393
+static const char sid_str[]  = "NSsid:\t";
089393
+
089393
+static const struct {
089393
+	const char *str;
089393
+	size_t size;
089393
+} id_strs[PT_COUNT] = {
089393
+	[PT_TID] =  { tid_str,  sizeof(tid_str)  - 1 },
089393
+	[PT_TGID] = { tgid_str, sizeof(tgid_str) - 1 },
089393
+	[PT_PGID] = { pgid_str, sizeof(pgid_str) - 1 },
089393
+	[PT_SID] =  { sid_str,  sizeof(sid_str)  - 1 },
089393
+};
089393
+
089393
+
089393
+/**
089393
+ * Limit on PID NS hierarchy depth, imposed since Linux 3.7. NS traversal
089393
+ * is not possible before Linux 4.9, so we consider this limit pretty universal.
089393
+ */
089393
+#define MAX_NS_DEPTH 32
089393
+
089393
+static const size_t ns_id_size = sizeof(unsigned int) * 8;
089393
+static const uint8_t ptr_sz_lg = (sizeof(void *) == 8 ? 6 : 5);
089393
+
089393
+static int pid_max;
089393
+static uint8_t pid_max_size, pid_max_size_lg;
089393
+
089393
+struct proc_data {
089393
+	int proc_pid;
089393
+	int ns_count;
089393
+	unsigned int ns_hierarchy[MAX_NS_DEPTH];
089393
+	int id_count[PT_COUNT];
089393
+	int id_hierarchy[PT_COUNT][MAX_NS_DEPTH];
089393
+};
089393
+
089393
+/**
089393
+ * Helper function for creating a trie.
089393
+ *
089393
+ * For node_key_bits and data_block_key_bits 4 is used (so trie height is 32 / 4
089393
+ * = 8, and node sizes are 8 byte * 2^4 = 128 bytes), which seems to be a good
089393
+ * tradeoff between memory usage and lookup time. It should not be too large,
089393
+ * since there can be large holes between PIDs, and it would be just a waste of
089393
+ * memory having large nodes with lot of NULL pointers in them.
089393
+ */
089393
+static struct trie *
089393
+create_trie_4(uint8_t key_size, uint8_t item_size_lg, uint64_t empty_value)
089393
+{
089393
+	struct trie *t = trie_create(key_size, item_size_lg, 4, 4, empty_value);
089393
+	if (!t)
089393
+		error_msg_and_die("creating trie failed");
089393
+
089393
+	return t;
089393
+}
089393
+
089393
+void
089393
+pidns_init(void)
089393
+{
089393
+	if (proc_data_cache)
089393
+		return;
089393
+
089393
+	pid_max = INT_MAX;
089393
+	if (read_int_from_file("/proc/sys/kernel/pid_max", &pid_max) < 0)
089393
+		debug_func_perror_msg("reading /proc/sys/kernel/pid_max");
089393
+	pid_max_size = ilog2_32(pid_max - 1) + 1;
089393
+	pid_max_size_lg = ilog2_32(pid_max_size - 1) + 1;
089393
+
089393
+	for (int i = 0; i < PT_COUNT; i++)
089393
+		ns_pid_to_proc_pid[i] = create_trie_4(ns_id_size, ptr_sz_lg, 0);
089393
+
089393
+	proc_data_cache = create_trie_4(pid_max_size, ptr_sz_lg, 0);
089393
+}
089393
+
089393
+static void
089393
+put_proc_pid(unsigned int ns, int ns_pid, enum pid_type type, int proc_pid)
089393
+{
089393
+	struct trie *b = (struct trie *) (uintptr_t) trie_get(ns_pid_to_proc_pid[type], ns);
089393
+	if (!b) {
089393
+		b = create_trie_4(pid_max_size, pid_max_size_lg, 0);
089393
+		trie_set(ns_pid_to_proc_pid[type], ns, (uint64_t) (uintptr_t) b);
089393
+	}
089393
+	trie_set(b, ns_pid, proc_pid);
089393
+}
089393
+
089393
+static int
089393
+get_cached_proc_pid(unsigned int ns, int ns_pid, enum pid_type type)
089393
+{
089393
+	struct trie *b = (struct trie *) (uintptr_t)
089393
+		trie_get(ns_pid_to_proc_pid[type], ns);
089393
+	if (!b)
089393
+		return 0;
089393
+
089393
+	return trie_get(b, ns_pid);
089393
+}
089393
+
089393
+/**
089393
+ * Helper function, converts pid to string, or to "self" for pid == 0.
089393
+ * Uses static buffer for operation.
089393
+ */
089393
+static const char *
089393
+pid_to_str(pid_t pid)
089393
+{
089393
+	if (!pid)
089393
+		return "self";
089393
+
089393
+	static char buf[sizeof("-2147483648")];
089393
+	xsprintf(buf, "%d", pid);
089393
+	return buf;
089393
+}
089393
+
089393
+/**
089393
+ * Returns a list of PID NS IDs for the specified PID.
089393
+ *
089393
+ * @param proc_pid PID (as present in /proc) to get information for.
089393
+ * @param ns_buf   Pointer to buffer that is able to contain at least
089393
+ *                 ns_buf_size items.
089393
+ * @return         Amount of NS in list. 0 indicates error.
089393
+ */
089393
+static size_t
089393
+get_ns_hierarchy(int proc_pid, unsigned int *ns_buf, size_t ns_buf_size)
089393
+{
089393
+	char path[PATH_MAX + 1];
089393
+	xsprintf(path, "/proc/%s/ns/pid", pid_to_str(proc_pid));
089393
+
089393
+	int fd = open_file(path, O_RDONLY);
089393
+	if (fd < 0)
089393
+		return 0;
089393
+
089393
+	size_t n = 0;
089393
+	while (n < ns_buf_size) {
089393
+		strace_stat_t st;
089393
+		if (fstat_fd(fd, &st))
089393
+			break;
089393
+
089393
+		ns_buf[n++] = st.st_ino;
089393
+		if (n >= ns_buf_size)
089393
+			break;
089393
+
089393
+		if (ns_get_parent_enotty)
089393
+			break;
089393
+
089393
+		int parent_fd = ioctl(fd, NS_GET_PARENT);
089393
+		if (parent_fd < 0) {
089393
+			switch (errno) {
089393
+			case EPERM:
089393
+				break;
089393
+
089393
+			case ENOTTY:
089393
+				ns_get_parent_enotty = true;
089393
+				error_msg("NS_* ioctl commands are not "
089393
+					  "supported by the kernel");
089393
+				break;
089393
+
089393
+			default:
089393
+				perror_func_msg("ioctl(NS_GET_PARENT)");
089393
+				break;
089393
+			}
089393
+
089393
+			break;
089393
+		}
089393
+
089393
+		close(fd);
089393
+		fd = parent_fd;
089393
+	}
089393
+
089393
+	close(fd);
089393
+
089393
+	return n;
089393
+}
089393
+
089393
+/**
089393
+ * Get list of IDs present in NS* proc status record. IDs are placed as they are
089393
+ * stored in /proc (from top to bottom of NS hierarchy).
089393
+ *
089393
+ * @param proc_pid    PID (as present in /proc) to get information for.
089393
+ * @param id_buf      Pointer to buffer that is able to contain at least
089393
+ *                    MAX_NS_DEPTH items. Can be NULL.
089393
+ * @param type        Type of ID requested.
089393
+ * @return            Number of items stored in id_list. 0 indicates error.
089393
+ */
089393
+static size_t
089393
+get_id_list(int proc_pid, int *id_buf, enum pid_type type)
089393
+{
089393
+	const char *ns_str = id_strs[type].str;
089393
+	size_t ns_str_size = id_strs[type].size;
089393
+
089393
+	size_t n = 0;
089393
+
089393
+	char status_path[PATH_MAX + 1];
089393
+	xsprintf(status_path, "/proc/%s/status", pid_to_str(proc_pid));
089393
+	FILE *f = fopen_stream(status_path, "r");
089393
+	if (!f)
089393
+		return 0;
089393
+
089393
+	char *line = NULL;
089393
+	size_t linesize = 0;
089393
+	char *p = NULL;
089393
+
089393
+	while (getline(&line, &linesize, f) > 0) {
089393
+		if (strncmp(line, ns_str, ns_str_size) == 0) {
089393
+			p = line + ns_str_size;
089393
+			break;
089393
+		}
089393
+	}
089393
+
089393
+	while (p) {
089393
+		errno = 0;
089393
+		long id = strtol(p, NULL, 10);
089393
+
089393
+		if (id < 0 || id > INT_MAX || errno) {
089393
+			perror_func_msg("converting pid (%ld) to int", id);
089393
+			break;
089393
+		}
089393
+
089393
+		if (id_buf)
089393
+			id_buf[n] = (int) id;
089393
+
089393
+		n++;
089393
+		strsep(&p, "\t");
089393
+	}
089393
+
089393
+	free(line);
089393
+	fclose(f);
089393
+
089393
+	return n;
089393
+}
089393
+
089393
+/**
089393
+ * Returns whether the /proc filesystem's PID namespace is the same as strace's.
089393
+ */
089393
+static bool
089393
+is_proc_ours(void)
089393
+{
089393
+	static int cached_val = -1;
089393
+
089393
+	if (cached_val < 0)
089393
+		cached_val = get_id_list(0, NULL, PT_TID) <= 1;
089393
+
089393
+	return cached_val;
089393
+}
089393
+
089393
+/**
089393
+ * Returns the PID namespace of the tracee
089393
+ */
089393
+static unsigned int
089393
+get_ns(struct tcb *tcp)
089393
+{
089393
+	if (!tcp->pid_ns) {
089393
+		int proc_pid = 0;
089393
+		translate_pid(NULL, tcp->pid, PT_TID, &proc_pid);
089393
+
089393
+		if (proc_pid)
089393
+			get_ns_hierarchy(proc_pid, &tcp->pid_ns, 1);
089393
+	}
089393
+
089393
+	return tcp->pid_ns;
089393
+}
089393
+
089393
+/**
089393
+ * Returns the PID namespace of strace
089393
+ */
089393
+static unsigned int
089393
+get_our_ns(void)
089393
+{
089393
+	static unsigned int our_ns = 0;
089393
+	static bool our_ns_initialised = false;
089393
+
089393
+	if (!our_ns_initialised) {
089393
+		get_ns_hierarchy(0, &our_ns, 1);
089393
+		our_ns_initialised = true;
089393
+	}
089393
+
089393
+	return our_ns;
089393
+}
089393
+
089393
+/**
089393
+ * Returns the cached proc_data struct associated with proc_pid.
089393
+ * If none found, allocates a new proc_data.
089393
+ */
089393
+static struct proc_data *
089393
+get_or_create_proc_data(int proc_pid)
089393
+{
089393
+	struct proc_data *pd = (struct proc_data *) (uintptr_t)
089393
+		trie_get(proc_data_cache, proc_pid);
089393
+
089393
+	if (!pd) {
089393
+		pd = calloc(1, sizeof(*pd));
089393
+		if (!pd)
089393
+			return NULL;
089393
+
089393
+		pd->proc_pid = proc_pid;
089393
+		trie_set(proc_data_cache, proc_pid, (uint64_t) (uintptr_t) pd);
089393
+	}
089393
+
089393
+	return pd;
089393
+}
089393
+
089393
+/**
089393
+ * Updates the proc_data from /proc
089393
+ * If the process does not exists, returns false, and frees the proc_data
089393
+ */
089393
+static bool
089393
+update_proc_data(struct proc_data *pd, enum pid_type type)
089393
+{
089393
+	pd->ns_count = get_ns_hierarchy(pd->proc_pid,
089393
+		pd->ns_hierarchy, MAX_NS_DEPTH);
089393
+	if (!pd->ns_count)
089393
+		goto fail;
089393
+
089393
+	pd->id_count[type] = get_id_list(pd->proc_pid,
089393
+		pd->id_hierarchy[type], type);
089393
+	if (!pd->id_count[type])
089393
+		goto fail;
089393
+
089393
+	return true;
089393
+
089393
+fail:
089393
+	trie_set(proc_data_cache, pd->proc_pid, (uint64_t) (uintptr_t) NULL);
089393
+	free(pd);
089393
+	return false;
089393
+}
089393
+
089393
+/**
089393
+ * Paramters for id translation
089393
+ */
089393
+struct translate_id_params {
089393
+	/* The result (output) */
089393
+	int result_id;
089393
+	/* The proc data of the process (output) */
089393
+	struct proc_data *pd;
089393
+
089393
+	/* The namespace to be translated from */
089393
+	unsigned int from_ns;
089393
+	/* The id to be translated */
089393
+	int from_id;
089393
+	/* The type of the id */
089393
+	enum pid_type type;
089393
+};
089393
+
089393
+/**
089393
+ * Translates an id to our namespace, given the proc_pid of the process,
089393
+ * by reading files in /proc.
089393
+ *
089393
+ * @param tip      The parameters
089393
+ * @param proc_pid The proc pid of the process.
089393
+ *                 If 0, use the cached values in tip->pd.
089393
+ */
089393
+static void
089393
+translate_id_proc_pid(struct translate_id_params *tip, int proc_pid)
089393
+{
089393
+	struct proc_data *pd = proc_pid ?
089393
+		get_or_create_proc_data(proc_pid) :
089393
+		tip->pd;
089393
+
089393
+	tip->result_id = 0;
089393
+	tip->pd = NULL;
089393
+
089393
+	if (!pd)
089393
+		return;
089393
+
089393
+	if (proc_pid && !update_proc_data(pd, tip->type))
089393
+		return;
089393
+
089393
+	if (!pd->ns_count || pd->id_count[tip->type] < pd->ns_count)
089393
+		return;
089393
+
089393
+	int *id_hierarchy = pd->id_hierarchy[tip->type];
089393
+	int id_count = pd->id_count[tip->type];
089393
+
089393
+	for (int i = 0; i < pd->ns_count; i++) {
089393
+		unsigned int ns = pd->ns_hierarchy[i];
089393
+		int ns_id = id_hierarchy[id_count - i - 1];
089393
+		int our_id = id_hierarchy[id_count - pd->ns_count];
089393
+
089393
+		if (ns != tip->from_ns)
089393
+			continue;
089393
+
089393
+		if (ns_id != tip->from_id)
089393
+			return;
089393
+
089393
+		tip->result_id = our_id;
089393
+		tip->pd = pd;
089393
+		return;
089393
+	}
089393
+}
089393
+
089393
+/**
089393
+ * Translates an id to our namespace by reading all proc entries in a directory.
089393
+ * The directory is either /proc or /proc/<pid>/task.
089393
+ *
089393
+ *
089393
+ * @param tip            The parameters
089393
+ * @param path           The path of the directory to be read.
089393
+ * @param read_task_dir  Whether recurse to "task" subdirectory.
089393
+ */
089393
+static void
089393
+translate_id_dir(struct translate_id_params *tip, const char *path,
089393
+                 bool read_task_dir)
089393
+{
089393
+	DIR *dir = opendir(path);
089393
+	if (!dir) {
089393
+		debug_func_perror_msg("opening dir: %s", path);
089393
+		return;
089393
+	}
089393
+
089393
+	while (!tip->result_id) {
089393
+		errno = 0;
089393
+		struct_dirent *entry = read_dir(dir);
089393
+		if (!entry) {
089393
+			if (errno)
089393
+				perror_func_msg("readdir");
089393
+
089393
+			break;
089393
+		}
089393
+
089393
+		if (entry->d_type != DT_DIR)
089393
+			continue;
089393
+
089393
+		errno = 0;
089393
+		long proc_pid = strtol(entry->d_name, NULL, 10);
089393
+		if (proc_pid < 1 || proc_pid > INT_MAX || errno)
089393
+			continue;
089393
+
089393
+		if (read_task_dir) {
089393
+			char task_dir_path[PATH_MAX + 1];
089393
+			xsprintf(task_dir_path, "/proc/%ld/task", proc_pid);
089393
+			translate_id_dir(tip, task_dir_path, false);
089393
+		}
089393
+
089393
+		if (tip->result_id)
089393
+			break;
089393
+
089393
+		translate_id_proc_pid(tip, proc_pid);
089393
+	}
089393
+
089393
+	closedir(dir);
089393
+}
089393
+
089393
+/**
089393
+ * Iterator function of the proc_data_cache for id translation.
089393
+ * If the cache contains the id we are looking for, reads the corresponding
089393
+ * directory in /proc, and if cache is valid, saves the result.
089393
+ */
089393
+static void
089393
+proc_data_cache_iterator_fn(void* fn_data, uint64_t key, uint64_t val)
089393
+{
089393
+	struct translate_id_params *tip = (struct translate_id_params *)fn_data;
089393
+	struct proc_data *pd = (struct proc_data *) (uintptr_t) val;
089393
+
089393
+	if (!pd)
089393
+		return;
089393
+
089393
+	/* Result already found in an earlier iteration */
089393
+	if (tip->result_id)
089393
+		return;
089393
+
089393
+	/* Translate from cache */
089393
+	tip->pd = pd;
089393
+	translate_id_proc_pid(tip, 0);
089393
+	if (!tip->result_id)
089393
+		return;
089393
+
089393
+	/* Now translate from actual data in /proc, to check cache validity */
089393
+	translate_id_proc_pid(tip, pd->proc_pid);
089393
+}
089393
+
089393
+int
089393
+translate_pid(struct tcb *tcp, int from_id, enum pid_type type,
089393
+              int *proc_pid_ptr)
089393
+{
089393
+	if (from_id <= 0 || type < 0 || type >= PT_COUNT)
089393
+		return 0;
089393
+
089393
+	/* If translation is trivial */
089393
+	if ((!tcp || get_ns(tcp) == get_our_ns()) &&
089393
+	    (!proc_pid_ptr || is_proc_ours())) {
089393
+		if (proc_pid_ptr)
089393
+			*proc_pid_ptr = from_id;
089393
+
089393
+		return from_id;
089393
+	}
089393
+
089393
+	struct translate_id_params tip = {
089393
+		.result_id = 0,
089393
+		.pd = NULL,
089393
+		.from_ns = tcp ? get_ns(tcp) : get_our_ns(),
089393
+		.from_id = from_id,
089393
+		.type = type,
089393
+	};
089393
+
089393
+	if (!tip.from_ns)
089393
+		return 0;
089393
+
089393
+	if (ns_get_parent_enotty)
089393
+		return 0;
089393
+
089393
+	/* Look for a cached proc_pid for this (from_ns, from_id) pair */
089393
+	int cached_proc_pid = get_cached_proc_pid(tip.from_ns, tip.from_id,
089393
+		tip.type);
089393
+	if (cached_proc_pid) {
089393
+		translate_id_proc_pid(&tip, cached_proc_pid);
089393
+		if (tip.result_id)
089393
+			goto exit;
089393
+	}
089393
+
089393
+	/* Iterate through the cache, find potential proc_data */
089393
+	trie_iterate_keys(proc_data_cache, 0, pid_max - 1,
089393
+		proc_data_cache_iterator_fn, &tip;;
089393
+	/* (proc_data_cache_iterator_fn takes care about updating proc_data) */
089393
+	if (tip.result_id)
089393
+		goto exit;
089393
+
089393
+	/* No cache helped, read all entries in /proc */
089393
+	translate_id_dir(&tip, "/proc", true);
089393
+
089393
+exit:
089393
+	if (tip.pd) {
089393
+		if (tip.pd->proc_pid)
089393
+			put_proc_pid(tip.from_ns, tip.from_id, tip.type,
089393
+				tip.pd->proc_pid);
089393
+
089393
+		if (proc_pid_ptr)
089393
+			*proc_pid_ptr = tip.pd->proc_pid;
089393
+	}
089393
+
089393
+	return tip.result_id;
089393
+}
089393
+
089393
+int
089393
+get_proc_pid(struct tcb *tcp)
089393
+{
089393
+	int proc_pid = 0;
089393
+	translate_pid(NULL, tcp->pid, PT_TID, &proc_pid);
089393
+	return proc_pid;
089393
+}
089393
+
089393
+static void
089393
+printpid_translation(struct tcb *tcp, int pid, enum pid_type type)
089393
+{
089393
+	if (!pidns_translation)
089393
+		return;
089393
+
089393
+	int strace_pid = translate_pid(tcp, pid, type, NULL);
089393
+	if (strace_pid && strace_pid != pid)
089393
+		tprintf_comment("%d in strace's PID NS", strace_pid);
089393
+}
089393
+
089393
+void
089393
+printpid(struct tcb *tcp, int pid, enum pid_type type)
089393
+{
089393
+	tprintf("%d", pid);
089393
+	printpid_translation(tcp, pid, type);
089393
+}
089393
+
089393
+void
089393
+printpid_tgid_pgid(struct tcb *tcp, int pid)
089393
+{
089393
+	tprintf("%d", pid);
089393
+	if (pid > 0)
089393
+		printpid_translation(tcp,  pid, PT_TGID);
089393
+	else if (pid < -1)
089393
+		printpid_translation(tcp, -pid, PT_PGID);
089393
+}
089393
Index: strace-5.7/strace.1.in
089393
===================================================================
089393
--- strace-5.7.orig/strace.1.in	2020-09-09 15:50:13.475900513 +0200
089393
+++ strace-5.7/strace.1.in	2020-09-09 15:50:18.018903762 +0200
089393
@@ -1075,6 +1075,10 @@
089393
 protocol-specific information associated with socket file descriptors,
089393
 block/character device number associated with device file descriptors,
089393
 and PIDs asociated with pidfd file descriptors.
089393
+.TP
089393
+.B \-\-pidns\-translation
089393
+If strace and tracee are in different PID namespaces, print PIDs in
089393
+strace's namespace, too.
089393
 .SS Statistics
089393
 .TP 12
089393
 .B \-c
089393
Index: strace-5.7/strace.c
089393
===================================================================
089393
--- strace-5.7.orig/strace.c	2020-09-09 15:50:13.476900514 +0200
089393
+++ strace-5.7/strace.c	2020-09-09 15:52:08.646982890 +0200
089393
@@ -133,6 +133,8 @@
089393
 static int post_attach_sigstop = TCB_IGNORE_ONE_SIGSTOP;
089393
 #define use_seize (post_attach_sigstop == 0)
089393
 
089393
+unsigned int pidns_translation;
089393
+
089393
 static bool detach_on_execve;
089393
 
089393
 static int exit_code;
089393
@@ -1998,6 +2000,8 @@
089393
 
089393
 	os_release = get_os_release();
089393
 
089393
+	pidns_init();
089393
+
089393
 	shared_log = stderr;
089393
 	set_sortby(DEFAULT_SORTBY);
089393
 	set_personality(DEFAULT_PERSONALITY);
089393
@@ -2022,6 +2026,7 @@
089393
 		GETOPT_FOLLOWFORKS,
089393
 		GETOPT_OUTPUT_SEPARATELY,
089393
 		GETOPT_TS,
089393
+		GETOPT_PIDNS_TRANSLATION,
089393
 
089393
 		GETOPT_QUAL_TRACE,
089393
 		GETOPT_QUAL_ABBREV,
089393
@@ -2072,6 +2077,7 @@
089393
 		{ "summary-wall-clock", no_argument,	   0, 'w' },
089393
 		{ "strings-in-hex",	optional_argument, 0, GETOPT_HEX_STR },
089393
 		{ "const-print-style",	required_argument, 0, 'X' },
089393
+		{ "pidns-translation",	no_argument      , 0, GETOPT_PIDNS_TRANSLATION },
089393
 		{ "successful-only",	no_argument,	   0, 'z' },
089393
 		{ "failed-only",	no_argument,	   0, 'Z' },
089393
 		{ "failing-only",	no_argument,	   0, 'Z' },
089393
@@ -2285,6 +2291,9 @@
089393
 		case 'y':
089393
 			yflag_short++;
089393
 			break;
089393
+		case GETOPT_PIDNS_TRANSLATION:
089393
+			pidns_translation++;
089393
+			break;
089393
 		case 'z':
089393
 			clear_number_set_array(status_set, 1);
089393
 			add_number_to_set(STATUS_SUCCESSFUL, status_set);
089393
Index: strace-5.7/syscall.c
089393
===================================================================
089393
--- strace-5.7.orig/syscall.c	2020-09-09 15:50:13.477900514 +0200
089393
+++ strace-5.7/syscall.c	2020-09-09 15:50:18.019903763 +0200
089393
@@ -930,6 +930,21 @@
089393
 					tprintf("= %" PRI_kld, tcp->u_rval);
089393
 				}
089393
 				break;
089393
+			case RVAL_TID:
089393
+			case RVAL_SID:
089393
+			case RVAL_TGID:
089393
+			case RVAL_PGID: {
089393
+				#define _(_t) [RVAL_##_t - RVAL_TID] = PT_##_t
089393
+				static const enum pid_type types[] = {
089393
+					_(TID), _(SID), _(TGID), _(PGID),
089393
+				};
089393
+				#undef _
089393
+
089393
+				tprints("= ");
089393
+				printpid(tcp, tcp->u_rval,
089393
+					 types[(sys_res & RVAL_MASK) - RVAL_TID]);
089393
+				break;
089393
+			}
089393
 			default:
089393
 				error_msg("invalid rval format");
089393
 				break;
089393
Index: strace-5.7/trie.c
089393
===================================================================
089393
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
089393
+++ strace-5.7/trie.c	2020-09-09 15:50:18.019903763 +0200
089393
@@ -0,0 +1,290 @@
089393
+/*
089393
+ * Simple trie implementation for key-value mapping storage
089393
+ *
089393
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
089393
+ * All rights reserved.
089393
+ *
089393
+ * SPDX-License-Identifier: LGPL-2.1-or-later
089393
+ */
089393
+
089393
+#ifdef HAVE_CONFIG_H
089393
+# include "config.h"
089393
+#endif
089393
+
089393
+#include <stdlib.h>
089393
+#include <stdio.h>
089393
+
089393
+#include "trie.h"
089393
+#include "xmalloc.h"
089393
+
089393
+static const uint8_t ptr_sz_lg = (sizeof(void *) == 8 ? 6 : 5);
089393
+
089393
+/**
089393
+ * Returns lg2 of node size in bits for the specific level of the trie.
089393
+ */
089393
+static uint8_t
089393
+trie_get_node_size(struct trie *t, uint8_t depth)
089393
+{
089393
+	/* Last level contains data and we allow it having a different size */
089393
+	if (depth == t->max_depth)
089393
+		return t->data_block_key_bits + t->item_size_lg;
089393
+	/* Last level of the tree can be smaller */
089393
+	if (depth == t->max_depth - 1)
089393
+		return (t->key_size - t->data_block_key_bits - 1) %
089393
+		t->node_key_bits + 1 + ptr_sz_lg;
089393
+
089393
+	return t->node_key_bits + ptr_sz_lg;
089393
+}
089393
+
089393
+/**
089393
+ * Provides starting offset of bits in key corresponding to the node index
089393
+ * at the specific level.
089393
+ */
089393
+static uint8_t
089393
+trie_get_node_bit_offs(struct trie *t, uint8_t depth)
089393
+{
089393
+	uint8_t offs;
089393
+
089393
+	if (depth == t->max_depth)
089393
+		return 0;
089393
+
089393
+	offs = t->data_block_key_bits;
089393
+
089393
+	if (depth == t->max_depth - 1)
089393
+		return offs;
089393
+
089393
+	/* data_block_size + remainder */
089393
+	offs += trie_get_node_size(t, t->max_depth - 1) - ptr_sz_lg;
089393
+	offs += (t->max_depth - depth - 2) * t->node_key_bits;
089393
+
089393
+	return offs;
089393
+}
089393
+
089393
+struct trie *
089393
+trie_create(uint8_t key_size, uint8_t item_size_lg, uint8_t node_key_bits,
089393
+            uint8_t data_block_key_bits, uint64_t empty_value)
089393
+{
089393
+	if (item_size_lg > 6)
089393
+		return NULL;
089393
+	if (key_size > 64)
089393
+		return NULL;
089393
+	if (node_key_bits < 1)
089393
+		return NULL;
089393
+	if (data_block_key_bits < 1 || data_block_key_bits > key_size)
089393
+		return NULL;
089393
+
089393
+	struct trie *t = malloc(sizeof(*t));
089393
+	if (!t)
089393
+		return NULL;
089393
+
089393
+	t->empty_value = empty_value;
089393
+	t->data = NULL;
089393
+	t->item_size_lg = item_size_lg;
089393
+	t->node_key_bits = node_key_bits;
089393
+	t->data_block_key_bits = data_block_key_bits;
089393
+	t->key_size = key_size;
089393
+	t->max_depth = (key_size - data_block_key_bits + node_key_bits - 1)
089393
+		/ t->node_key_bits;
089393
+
089393
+	if (item_size_lg != 6)
089393
+		t->empty_value &= (((uint64_t) 1 << (1 << t->item_size_lg)) - 1);
089393
+
089393
+	return t;
089393
+}
089393
+
089393
+static void *
089393
+trie_create_data_block(struct trie *t)
089393
+{
089393
+	uint64_t fill_value = t->empty_value;
089393
+	for (int i = 1; i < 1 << (6 - t->item_size_lg); i++) {
089393
+		fill_value <<= (1 << t->item_size_lg);
089393
+		fill_value |= t->empty_value;
089393
+	}
089393
+
089393
+	uint8_t sz = t->data_block_key_bits + t->item_size_lg;
089393
+	if (sz < 6)
089393
+		sz = 6;
089393
+
089393
+	size_t count = 1 << (sz - 6);
089393
+	uint64_t *data_block = xcalloc(count, 8);
089393
+
089393
+	for (size_t i = 0; i < count; i++)
089393
+		data_block[i] = fill_value;
089393
+
089393
+	return data_block;
089393
+}
089393
+
089393
+static uint64_t *
089393
+trie_get_node(struct trie *t, uint64_t key, bool auto_create)
089393
+{
089393
+	void **cur_node = &(t->data);
089393
+
089393
+	if (t->key_size < 64 && key > (uint64_t) 1 << t->key_size)
089393
+		return NULL;
089393
+
089393
+	for (uint8_t cur_depth = 0; cur_depth <= t->max_depth; cur_depth++) {
089393
+		uint8_t offs = trie_get_node_bit_offs(t, cur_depth);
089393
+		uint8_t sz = trie_get_node_size(t, cur_depth);
089393
+
089393
+		if (!*cur_node) {
089393
+			if (!auto_create)
089393
+				return NULL;
089393
+
089393
+			if (cur_depth == t->max_depth)
089393
+				*cur_node = trie_create_data_block(t);
089393
+			else
089393
+				*cur_node = xcalloc(1 << sz, 1);
089393
+		}
089393
+
089393
+		if (cur_depth == t->max_depth)
089393
+			break;
089393
+
089393
+		size_t pos = (key >> offs) & ((1 << (sz - ptr_sz_lg)) - 1);
089393
+		cur_node = (((void **) (*cur_node)) + pos);
089393
+	}
089393
+
089393
+	return (uint64_t *) (*cur_node);
089393
+}
089393
+
089393
+static void
089393
+trie_data_block_calc_pos(struct trie *t, uint64_t key,
089393
+                         uint64_t *pos, uint64_t *mask, uint64_t *offs)
089393
+{
089393
+	uint64_t key_mask;
089393
+
089393
+	key_mask = (1 << t->data_block_key_bits) - 1;
089393
+	*pos = (key & key_mask) >> (6 - t->item_size_lg);
089393
+
089393
+	if (t->item_size_lg == 6) {
089393
+		*offs = 0;
089393
+		*mask = -1;
089393
+		return;
089393
+	}
089393
+
089393
+	key_mask = (1 << (6 - t->item_size_lg)) - 1;
089393
+	*offs = (key & key_mask) * (1 << t->item_size_lg);
089393
+
089393
+	*mask = (((uint64_t) 1 << (1 << t->item_size_lg)) - 1) << *offs;
089393
+}
089393
+
089393
+bool
089393
+trie_set(struct trie *t, uint64_t key, uint64_t val)
089393
+{
089393
+	uint64_t *data = trie_get_node(t, key, true);
089393
+	if (!data)
089393
+		return false;
089393
+
089393
+	uint64_t pos, mask, offs;
089393
+	trie_data_block_calc_pos(t, key, &pos, &mask, &offs);
089393
+
089393
+	data[pos] &= ~mask;
089393
+	data[pos] |= (val << offs) & mask;
089393
+
089393
+	return true;
089393
+}
089393
+
089393
+static uint64_t
089393
+trie_data_block_get(struct trie *t, uint64_t *data, uint64_t key)
089393
+{
089393
+	if (!data)
089393
+		return t->empty_value;
089393
+
089393
+	uint64_t pos, mask, offs;
089393
+	trie_data_block_calc_pos(t, key, &pos, &mask, &offs);
089393
+
089393
+	return (data[pos] & mask) >> offs;
089393
+}
089393
+
089393
+uint64_t
089393
+trie_get(struct trie *b, uint64_t key)
089393
+{
089393
+	return trie_data_block_get(b, trie_get_node(b, key, false), key);
089393
+}
089393
+
089393
+static uint64_t
089393
+trie_iterate_keys_node(struct trie *t,
089393
+                       trie_iterate_fn fn, void *fn_data,
089393
+                       void *node, uint64_t start, uint64_t end,
089393
+                       uint8_t depth)
089393
+{
089393
+	if (start > end || !node)
089393
+		return 0;
089393
+
089393
+	if (t->key_size < 64) {
089393
+		uint64_t key_max = ((uint64_t) 1 << t->key_size) - 1;
089393
+		if (end > key_max)
089393
+			end = key_max;
089393
+	}
089393
+
089393
+	if (depth == t->max_depth) {
089393
+		for (uint64_t i = start; i <= end; i++)
089393
+			fn(fn_data, i, trie_data_block_get(t,
089393
+				(uint64_t *) node, i));
089393
+
089393
+		return end - start + 1;
089393
+	}
089393
+
089393
+	uint8_t parent_node_bit_off = depth == 0 ?
089393
+		t->key_size :
089393
+		trie_get_node_bit_offs(t, depth - 1);
089393
+
089393
+	uint64_t first_key_in_node = start &
089393
+		(uint64_t) -1 << parent_node_bit_off;
089393
+
089393
+	uint8_t node_bit_off = trie_get_node_bit_offs(t, depth);
089393
+	uint8_t node_key_bits = parent_node_bit_off - node_bit_off;
089393
+	uint64_t mask = ((uint64_t) 1 << (node_key_bits)) - 1;
089393
+	uint64_t start_index = (start >> node_bit_off) & mask;
089393
+	uint64_t end_index = (end >> node_bit_off) & mask;
089393
+	uint64_t child_key_count = (uint64_t) 1 << node_bit_off;
089393
+
089393
+	uint64_t count = 0;
089393
+
089393
+	for (uint64_t i = start_index; i <= end_index; i++) {
089393
+		uint64_t child_start = first_key_in_node + i * child_key_count;
089393
+		uint64_t child_end = first_key_in_node +
089393
+			(i + 1) * child_key_count - 1;
089393
+
089393
+		if (child_start < start)
089393
+			child_start = start;
089393
+		if (child_end > end)
089393
+			child_end = end;
089393
+
089393
+		count += trie_iterate_keys_node(t, fn, fn_data,
089393
+			((void **) node)[i], child_start, child_end,
089393
+			depth + 1);
089393
+	}
089393
+
089393
+	return count;
089393
+}
089393
+
089393
+uint64_t trie_iterate_keys(struct trie *t, uint64_t start, uint64_t end,
089393
+                           trie_iterate_fn fn, void *fn_data)
089393
+{
089393
+	return trie_iterate_keys_node(t, fn, fn_data, t->data,
089393
+		start, end, 0);
089393
+}
089393
+
089393
+static void
089393
+trie_free_node(struct trie *t, void *node, uint8_t depth)
089393
+{
089393
+	if (!node)
089393
+		return;
089393
+
089393
+	if (depth >= t->max_depth)
089393
+		goto free_node;
089393
+
089393
+	size_t sz = 1 << (trie_get_node_size(t, depth) - ptr_sz_lg);
089393
+	for (size_t i = 0; i < sz; i++)
089393
+		trie_free_node(t, ((void **) node)[i], depth + 1);
089393
+
089393
+free_node:
089393
+	free(node);
089393
+}
089393
+
089393
+void
089393
+trie_free(struct trie *t)
089393
+{
089393
+	trie_free_node(t, t->data, 0);
089393
+	free(t);
089393
+}
089393
Index: strace-5.7/trie.h
089393
===================================================================
089393
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
089393
+++ strace-5.7/trie.h	2020-09-09 15:50:18.019903763 +0200
089393
@@ -0,0 +1,92 @@
089393
+/*
089393
+ * Simple trie interface
089393
+ *
089393
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
089393
+ * All rights reserved.
089393
+ *
089393
+ * SPDX-License-Identifier: LGPL-2.1-or-later
089393
+ */
089393
+
089393
+#ifndef STRACE_TRIE_H
089393
+#define STRACE_TRIE_H
089393
+
089393
+#include <stdbool.h>
089393
+#include <stdint.h>
089393
+
089393
+/**
089393
+ * Trie control structure.
089393
+ * Trie implemented here has the following properties:
089393
+ *  * It allows storing values of the same size, the size can vary from 1 bit to
089393
+ *    64 bit values (only power of 2 sizes are allowed).
089393
+ *  * The key can be up to 64 bits in size.
089393
+ *  * It has separate configuration for node size and data block size.
089393
+ *
089393
+ * How bits of key are used for different node levels:
089393
+ *
089393
+ *   highest bits                                                  lowest bits
089393
+ *  | node_key_bits | node_key_bits | ... | <remainder> | data_block_key_bits |
089393
+ *  \_________________________________________________________________________/
089393
+ *                                 key_size
089393
+ *
089393
+ * So, the remainder is used on the lowest non-data node level.
089393
+ *
089393
+ * As of now, it doesn't implement any mechanisms for resizing/changing key
089393
+ * size.  De-fragmentation is also unsupported currently.
089393
+ */
089393
+struct trie {
089393
+	/** Return value of trie_get if key is not found */
089393
+	uint64_t empty_value;
089393
+
089393
+	/** Pointer to root node */
089393
+	void *data;
089393
+
089393
+	/** Key size in bits (0..64). */
089393
+	uint8_t key_size;
089393
+
089393
+	/**
089393
+	 * Size of the stored values in log2 bits (0..6).
089393
+	 * (6: 64 bit values, 5: 32 bit values, ...)
089393
+	 */
089393
+	uint8_t item_size_lg;
089393
+
089393
+	/**
089393
+	 * Number of bits in the key that make a symbol for a node.
089393
+	 * (equals to log2 of the child count of the node)
089393
+	 */
089393
+	uint8_t node_key_bits;
089393
+
089393
+	/**
089393
+	 * Number of bits in the key that make a symbol for the data block (leaf).
089393
+	 * (equals to log2 of the value count stored in a data block)
089393
+	 */
089393
+	uint8_t data_block_key_bits;
089393
+
089393
+	/** The depth of the data block. Calculated from the values above */
089393
+	uint8_t max_depth;
089393
+};
089393
+
089393
+struct trie* trie_create(uint8_t key_size, uint8_t item_size_lg,
089393
+			uint8_t node_key_bits, uint8_t data_block_key_bits,
089393
+			uint64_t empty_value);
089393
+
089393
+bool trie_set(struct trie *t, uint64_t key, uint64_t val);
089393
+uint64_t trie_get(struct trie *t, uint64_t key);
089393
+
089393
+typedef void (*trie_iterate_fn)(void *data, uint64_t key, uint64_t val);
089393
+
089393
+/**
089393
+ * Calls trie_iterate_fn for each key-value pair where
089393
+ * key is inside the [start, end] interval (inclusive).
089393
+ *
089393
+ * @param t        The trie.
089393
+ * @param start    The start of the key interval (inclusive).
089393
+ * @param end      The end of the key interval (inclusive).
089393
+ * @param fn       The function to be called.
089393
+ * @param fn_data  The value to be passed to fn.
089393
+ */
089393
+uint64_t trie_iterate_keys(struct trie *t, uint64_t start, uint64_t end,
089393
+			    trie_iterate_fn fn, void *fn_data);
089393
+
089393
+void trie_free(struct trie *t);
089393
+
089393
+#endif /* !STRACE_TRIE_H */
089393
Index: strace-5.7/Makefile.in
089393
===================================================================
089393
--- strace-5.7.orig/Makefile.in	2020-09-09 15:50:13.484900519 +0200
089393
+++ strace-5.7/Makefile.in	2020-09-09 15:54:59.569105143 +0200
089393
@@ -344,8 +344,8 @@
089393
 	nlattr.c nlattr.h nsfs.c nsfs.h nsig.h numa.c number_set.c \
089393
 	number_set.h oldstat.c open.c open_tree.c or1k_atomic.c \
089393
 	pathtrace.c perf.c perf_event_struct.h perf_ioctl.c \
089393
-	personality.c pidfd_getfd.c pidfd_open.c pkeys.c poll.c \
089393
-	prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \
089393
+	personality.c pidfd_getfd.c pidfd_open.c pidns.c pkeys.c \
089393
+	poll.c prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \
089393
 	print_group_req.c print_ifindex.c print_instruction_pointer.c \
089393
 	print_kernel_version.c print_mac.c print_mq_attr.c \
089393
 	print_msgbuf.c print_sg_req_info.c print_sigevent.c \
089393
@@ -369,10 +369,10 @@
089393
 	string_to_uint.h swapon.c sync_file_range.c sync_file_range2.c \
089393
 	syscall.c sysctl.c sysent.h sysent_shorthand_defs.h \
089393
 	sysent_shorthand_undefs.h sysinfo.c syslog.c sysmips.c term.c \
089393
-	time.c times.c trace_event.h truncate.c ubi.c ucopy.c uid.c \
089393
-	uid16.c umask.c umount.c uname.c upeek.c upoke.c userfaultfd.c \
089393
-	ustat.c util.c utime.c utimes.c v4l2.c wait.c wait.h \
089393
-	watchdog_ioctl.c xattr.c xfs_quota_stat.h xgetdents.c \
089393
+	time.c times.c trace_event.h trie.c trie.h truncate.c ubi.c \
089393
+	ucopy.c uid.c uid16.c umask.c umount.c uname.c upeek.c upoke.c \
089393
+	userfaultfd.c ustat.c util.c utime.c utimes.c v4l2.c wait.c \
089393
+	wait.h watchdog_ioctl.c xattr.c xfs_quota_stat.h xgetdents.c \
089393
 	xgetdents.h xlat.c xlat.h xmalloc.c xmalloc.h xstring.h \
089393
 	types/cryptouser.h types/evdev.h types/io_uring.h \
089393
 	types/openat2.h types/rtnl_link.h types/rtnl_mdb.h \
089393
@@ -487,8 +487,9 @@
089393
 	libstrace_a-perf_ioctl.$(OBJEXT) \
089393
 	libstrace_a-personality.$(OBJEXT) \
089393
 	libstrace_a-pidfd_getfd.$(OBJEXT) \
089393
-	libstrace_a-pidfd_open.$(OBJEXT) libstrace_a-pkeys.$(OBJEXT) \
089393
-	libstrace_a-poll.$(OBJEXT) libstrace_a-prctl.$(OBJEXT) \
089393
+	libstrace_a-pidfd_open.$(OBJEXT) libstrace_a-pidns.$(OBJEXT) \
089393
+	libstrace_a-pkeys.$(OBJEXT) libstrace_a-poll.$(OBJEXT) \
089393
+	libstrace_a-prctl.$(OBJEXT) \
089393
 	libstrace_a-print_aio_sigset.$(OBJEXT) \
089393
 	libstrace_a-print_dev_t.$(OBJEXT) \
089393
 	libstrace_a-print_group_req.$(OBJEXT) \
089393
@@ -553,15 +554,15 @@
089393
 	libstrace_a-sysinfo.$(OBJEXT) libstrace_a-syslog.$(OBJEXT) \
089393
 	libstrace_a-sysmips.$(OBJEXT) libstrace_a-term.$(OBJEXT) \
089393
 	libstrace_a-time.$(OBJEXT) libstrace_a-times.$(OBJEXT) \
089393
-	libstrace_a-truncate.$(OBJEXT) libstrace_a-ubi.$(OBJEXT) \
089393
-	libstrace_a-ucopy.$(OBJEXT) libstrace_a-uid.$(OBJEXT) \
089393
-	libstrace_a-uid16.$(OBJEXT) libstrace_a-umask.$(OBJEXT) \
089393
-	libstrace_a-umount.$(OBJEXT) libstrace_a-uname.$(OBJEXT) \
089393
-	libstrace_a-upeek.$(OBJEXT) libstrace_a-upoke.$(OBJEXT) \
089393
-	libstrace_a-userfaultfd.$(OBJEXT) libstrace_a-ustat.$(OBJEXT) \
089393
-	libstrace_a-util.$(OBJEXT) libstrace_a-utime.$(OBJEXT) \
089393
-	libstrace_a-utimes.$(OBJEXT) libstrace_a-v4l2.$(OBJEXT) \
089393
-	libstrace_a-wait.$(OBJEXT) \
089393
+	libstrace_a-trie.$(OBJEXT) libstrace_a-truncate.$(OBJEXT) \
089393
+	libstrace_a-ubi.$(OBJEXT) libstrace_a-ucopy.$(OBJEXT) \
089393
+	libstrace_a-uid.$(OBJEXT) libstrace_a-uid16.$(OBJEXT) \
089393
+	libstrace_a-umask.$(OBJEXT) libstrace_a-umount.$(OBJEXT) \
089393
+	libstrace_a-uname.$(OBJEXT) libstrace_a-upeek.$(OBJEXT) \
089393
+	libstrace_a-upoke.$(OBJEXT) libstrace_a-userfaultfd.$(OBJEXT) \
089393
+	libstrace_a-ustat.$(OBJEXT) libstrace_a-util.$(OBJEXT) \
089393
+	libstrace_a-utime.$(OBJEXT) libstrace_a-utimes.$(OBJEXT) \
089393
+	libstrace_a-v4l2.$(OBJEXT) libstrace_a-wait.$(OBJEXT) \
089393
 	libstrace_a-watchdog_ioctl.$(OBJEXT) \
089393
 	libstrace_a-xattr.$(OBJEXT) libstrace_a-xgetdents.$(OBJEXT) \
089393
 	libstrace_a-xlat.$(OBJEXT) libstrace_a-xmalloc.$(OBJEXT) \
089393
@@ -834,6 +835,7 @@
089393
 	./$(DEPDIR)/libstrace_a-personality.Po \
089393
 	./$(DEPDIR)/libstrace_a-pidfd_getfd.Po \
089393
 	./$(DEPDIR)/libstrace_a-pidfd_open.Po \
089393
+	./$(DEPDIR)/libstrace_a-pidns.Po \
089393
 	./$(DEPDIR)/libstrace_a-pkeys.Po \
089393
 	./$(DEPDIR)/libstrace_a-poll.Po \
089393
 	./$(DEPDIR)/libstrace_a-prctl.Po \
089393
@@ -924,6 +926,7 @@
089393
 	./$(DEPDIR)/libstrace_a-term.Po \
089393
 	./$(DEPDIR)/libstrace_a-time.Po \
089393
 	./$(DEPDIR)/libstrace_a-times.Po \
089393
+	./$(DEPDIR)/libstrace_a-trie.Po \
089393
 	./$(DEPDIR)/libstrace_a-truncate.Po \
089393
 	./$(DEPDIR)/libstrace_a-ubi.Po \
089393
 	./$(DEPDIR)/libstrace_a-ucopy.Po \
089393
@@ -1829,8 +1832,8 @@
089393
 	nlattr.c nlattr.h nsfs.c nsfs.h nsig.h numa.c number_set.c \
089393
 	number_set.h oldstat.c open.c open_tree.c or1k_atomic.c \
089393
 	pathtrace.c perf.c perf_event_struct.h perf_ioctl.c \
089393
-	personality.c pidfd_getfd.c pidfd_open.c pkeys.c poll.c \
089393
-	prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \
089393
+	personality.c pidfd_getfd.c pidfd_open.c pidns.c pkeys.c \
089393
+	poll.c prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \
089393
 	print_group_req.c print_ifindex.c print_instruction_pointer.c \
089393
 	print_kernel_version.c print_mac.c print_mq_attr.c \
089393
 	print_msgbuf.c print_sg_req_info.c print_sigevent.c \
089393
@@ -1854,10 +1857,10 @@
089393
 	string_to_uint.h swapon.c sync_file_range.c sync_file_range2.c \
089393
 	syscall.c sysctl.c sysent.h sysent_shorthand_defs.h \
089393
 	sysent_shorthand_undefs.h sysinfo.c syslog.c sysmips.c term.c \
089393
-	time.c times.c trace_event.h truncate.c ubi.c ucopy.c uid.c \
089393
-	uid16.c umask.c umount.c uname.c upeek.c upoke.c userfaultfd.c \
089393
-	ustat.c util.c utime.c utimes.c v4l2.c wait.c wait.h \
089393
-	watchdog_ioctl.c xattr.c xfs_quota_stat.h xgetdents.c \
089393
+	time.c times.c trace_event.h trie.c trie.h truncate.c ubi.c \
089393
+	ucopy.c uid.c uid16.c umask.c umount.c uname.c upeek.c upoke.c \
089393
+	userfaultfd.c ustat.c util.c utime.c utimes.c v4l2.c wait.c \
089393
+	wait.h watchdog_ioctl.c xattr.c xfs_quota_stat.h xgetdents.c \
089393
 	xgetdents.h xlat.c xlat.h xmalloc.c xmalloc.h xstring.h \
089393
 	$(TYPES_HEADER_FILES) $(strace_SOURCES_check) $(am__append_1) \
089393
 	$(am__append_2) $(am__append_7)
089393
@@ -2899,6 +2902,7 @@
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-personality.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-pidfd_getfd.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-pidfd_open.Po@am__quote@ # am--include-marker
089393
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-pidns.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-pkeys.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-poll.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-prctl.Po@am__quote@ # am--include-marker
089393
@@ -2989,6 +2993,7 @@
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-term.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-time.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-times.Po@am__quote@ # am--include-marker
089393
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-trie.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-truncate.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ubi.Po@am__quote@ # am--include-marker
089393
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ucopy.Po@am__quote@ # am--include-marker
089393
@@ -6015,6 +6020,20 @@
089393
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-pidfd_open.obj `if test -f 'pidfd_open.c'; then $(CYGPATH_W) 'pidfd_open.c'; else $(CYGPATH_W) '$(srcdir)/pidfd_open.c'; fi`
089393
 
089393
+libstrace_a-pidns.o: pidns.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-pidns.o -MD -MP -MF $(DEPDIR)/libstrace_a-pidns.Tpo -c -o libstrace_a-pidns.o `test -f 'pidns.c' || echo '$(srcdir)/'`pidns.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-pidns.Tpo $(DEPDIR)/libstrace_a-pidns.Po
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='pidns.c' object='libstrace_a-pidns.o' libtool=no @AMDEPBACKSLASH@
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-pidns.o `test -f 'pidns.c' || echo '$(srcdir)/'`pidns.c
089393
+
089393
+libstrace_a-pidns.obj: pidns.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-pidns.obj -MD -MP -MF $(DEPDIR)/libstrace_a-pidns.Tpo -c -o libstrace_a-pidns.obj `if test -f 'pidns.c'; then $(CYGPATH_W) 'pidns.c'; else $(CYGPATH_W) '$(srcdir)/pidns.c'; fi`
089393
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-pidns.Tpo $(DEPDIR)/libstrace_a-pidns.Po
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='pidns.c' object='libstrace_a-pidns.obj' libtool=no @AMDEPBACKSLASH@
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-pidns.obj `if test -f 'pidns.c'; then $(CYGPATH_W) 'pidns.c'; else $(CYGPATH_W) '$(srcdir)/pidns.c'; fi`
089393
+
089393
 libstrace_a-pkeys.o: pkeys.c
089393
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-pkeys.o -MD -MP -MF $(DEPDIR)/libstrace_a-pkeys.Tpo -c -o libstrace_a-pkeys.o `test -f 'pkeys.c' || echo '$(srcdir)/'`pkeys.c
089393
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-pkeys.Tpo $(DEPDIR)/libstrace_a-pkeys.Po
089393
@@ -7275,6 +7294,20 @@
089393
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
089393
 
089393
+libstrace_a-trie.o: trie.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-trie.o -MD -MP -MF $(DEPDIR)/libstrace_a-trie.Tpo -c -o libstrace_a-trie.o `test -f 'trie.c' || echo '$(srcdir)/'`trie.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-trie.Tpo $(DEPDIR)/libstrace_a-trie.Po
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='trie.c' object='libstrace_a-trie.o' libtool=no @AMDEPBACKSLASH@
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-trie.o `test -f 'trie.c' || echo '$(srcdir)/'`trie.c
089393
+
089393
+libstrace_a-trie.obj: trie.c
089393
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-trie.obj -MD -MP -MF $(DEPDIR)/libstrace_a-trie.Tpo -c -o libstrace_a-trie.obj `if test -f 'trie.c'; then $(CYGPATH_W) 'trie.c'; else $(CYGPATH_W) '$(srcdir)/trie.c'; fi`
089393
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-trie.Tpo $(DEPDIR)/libstrace_a-trie.Po
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='trie.c' object='libstrace_a-trie.obj' libtool=no @AMDEPBACKSLASH@
089393
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
089393
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-trie.obj `if test -f 'trie.c'; then $(CYGPATH_W) 'trie.c'; else $(CYGPATH_W) '$(srcdir)/trie.c'; fi`
089393
+
089393
 libstrace_a-truncate.o: truncate.c
089393
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-truncate.o -MD -MP -MF $(DEPDIR)/libstrace_a-truncate.Tpo -c -o libstrace_a-truncate.o `test -f 'truncate.c' || echo '$(srcdir)/'`truncate.c
089393
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-truncate.Tpo $(DEPDIR)/libstrace_a-truncate.Po
089393
@@ -8411,6 +8444,7 @@
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-personality.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pidfd_getfd.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pidfd_open.Po
089393
+	-rm -f ./$(DEPDIR)/libstrace_a-pidns.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pkeys.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-poll.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-prctl.Po
089393
@@ -8501,6 +8535,7 @@
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-term.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-time.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-times.Po
089393
+	-rm -f ./$(DEPDIR)/libstrace_a-trie.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-truncate.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-ubi.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-ucopy.Po
089393
@@ -8796,6 +8831,7 @@
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-personality.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pidfd_getfd.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pidfd_open.Po
089393
+	-rm -f ./$(DEPDIR)/libstrace_a-pidns.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-pkeys.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-poll.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-prctl.Po
089393
@@ -8886,6 +8922,7 @@
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-term.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-time.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-times.Po
089393
+	-rm -f ./$(DEPDIR)/libstrace_a-trie.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-truncate.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-ubi.Po
089393
 	-rm -f ./$(DEPDIR)/libstrace_a-ucopy.Po