diff options
author | Yonghong Song <yhs@fb.com> | 2017-07-21 22:13:20 -0700 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2017-07-26 22:31:14 -0700 |
commit | 0ba15075fc5f621e21fc68634816468d97bda5f1 (patch) | |
tree | 69b9070211f9de60678595ebb9140c58af25a746 /src/cc/ns_guard.h | |
parent | b58a0d7eb0c9b15c091483fdcdd619b692aa0c3f (diff) | |
download | bcc-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.h | 2 |
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 |