permit multiple pids attaching to the same probe
authorYonghong Song <yhs@fb.com>
Sat, 22 Jul 2017 05:13:20 +0000 (22:13 -0700)
committerYonghong Song <yhs@fb.com>
Thu, 27 Jul 2017 05:31:14 +0000 (22:31 -0700)
commit0ba15075fc5f621e21fc68634816468d97bda5f1
tree69b9070211f9de60678595ebb9140c58af25a746
parentb58a0d7eb0c9b15c091483fdcdd619b692aa0c3f
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>
src/cc/bcc_usdt.h
src/cc/ns_guard.cc
src/cc/ns_guard.h
src/cc/usdt.cc
src/cc/usdt.h
src/python/bcc/__init__.py
src/python/bcc/libbcc.py
src/python/bcc/usdt.py
tests/python/CMakeLists.txt
tests/python/test_usdt2.py [new file with mode: 0755]