From 0ba15075fc5f621e21fc68634816468d97bda5f1 Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Fri, 21 Jul 2017 22:13:20 -0700 Subject: permit multiple pids attaching to the same probe Currently, if more than one pid-associated USDT attaching to the same probe, usdt readarg code will be generated twice and the compiler will complain. This patch solves issue by preventing code duplication if a previous context with the same mnt point and exec binary has generated the code for the same probe. The event name is also changed to have pid embedded so different pid-associated uprobe event will have different names. This patch introduces an internal uprobe event name discrepency. It is a good idea to have event name generation in libbpf so that both C++ API and Python API will have consistent name conventions. This will be addressed in a subsequent commit as it is largely a different issue. Signed-off-by: Yonghong Song --- src/cc/ns_guard.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cc/ns_guard.h') diff --git a/src/cc/ns_guard.h b/src/cc/ns_guard.h index 7b33c62f..65acd65c 100644 --- a/src/cc/ns_guard.h +++ b/src/cc/ns_guard.h @@ -32,10 +32,12 @@ class ProcMountNS { explicit ProcMountNS(int pid); int self() const { return self_fd_; } int target() const { return target_fd_; } + ino_t target_ino() const { return target_ino_; } private: ebpf::FileDesc self_fd_; ebpf::FileDesc target_fd_; + ino_t target_ino_; }; // ProcMountNSGuard switches to the target mount namespace and restores the -- cgit v1.2.3