aboutsummaryrefslogtreecommitdiff
path: root/src/cc/ns_guard.h
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2017-07-21 22:13:20 -0700
committerYonghong Song <yhs@fb.com>2017-07-26 22:31:14 -0700
commit0ba15075fc5f621e21fc68634816468d97bda5f1 (patch)
tree69b9070211f9de60678595ebb9140c58af25a746 /src/cc/ns_guard.h
parentb58a0d7eb0c9b15c091483fdcdd619b692aa0c3f (diff)
downloadbcc-0ba15075fc5f621e21fc68634816468d97bda5f1.tar.gz
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 <yhs@fb.com>
Diffstat (limited to 'src/cc/ns_guard.h')
-rw-r--r--src/cc/ns_guard.h2
1 files changed, 2 insertions, 0 deletions
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