[rocprofiler-sdk] ROCpd GOTCHA Fix (#720)
* Update GOTCHA submodule - public API for gotcha_init - switch repo to ROCm/gotcha * rocpd interop GOTCHA updates - fix issues wrapping dlopen/dlsym
This commit is contained in:
committed by
GitHub
szülő
68cd123b0f
commit
9278770b89
+1
-1
@@ -49,7 +49,7 @@
|
|||||||
url = https://github.com/pybind/pybind11.git
|
url = https://github.com/pybind/pybind11.git
|
||||||
[submodule "projects/rocprofiler-sdk/external/gotcha"]
|
[submodule "projects/rocprofiler-sdk/external/gotcha"]
|
||||||
path = projects/rocprofiler-sdk/external/gotcha
|
path = projects/rocprofiler-sdk/external/gotcha
|
||||||
url = https://jrmadsen@github.com/jrmadsen/GOTCHA
|
url = https://github.com/ROCm/GOTCHA
|
||||||
[submodule "projects/rocprofiler-systems/external/timemory"]
|
[submodule "projects/rocprofiler-systems/external/timemory"]
|
||||||
path = projects/rocprofiler-systems/external/timemory
|
path = projects/rocprofiler-systems/external/timemory
|
||||||
url = https://github.com/ROCm/timemory.git
|
url = https://github.com/ROCm/timemory.git
|
||||||
|
|||||||
+1
-1
Submodule projects/rocprofiler-sdk/external/gotcha updated: 9afbaf0ae5...b944da10ff
@@ -32,6 +32,13 @@ try:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
|
sqlite3.connect(":memory:") # Test if sqlite3 is available
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
from . import libpyrocpd
|
from . import libpyrocpd
|
||||||
from .importer import RocpdImportData
|
from .importer import RocpdImportData
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,22 @@ auto bindings = std::array<gotcha_binding_t, 4>{
|
|||||||
void
|
void
|
||||||
activate_gotcha_bindings()
|
activate_gotcha_bindings()
|
||||||
{
|
{
|
||||||
|
#if defined(GOTCHA_INIT) && GOTCHA_INIT > 0
|
||||||
|
// initialize gotcha
|
||||||
|
gotcha_init_config_t gotcha_cfg = {
|
||||||
|
.size = sizeof(gotcha_init_config_t), .dl_open_bind = 0, .dl_sym_bind = 0};
|
||||||
|
gotcha_init(&gotcha_cfg);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// this ensures that the sqlite3 module is imported and the sqlite3_open_v2 and sqlite3_close_v2
|
||||||
|
// in lib-dynload/_sqlite3.cpython-*.so are remapped to the gotcha bindings.
|
||||||
|
// this is needed to ensure that the sqlite3 connections are captured by gotcha
|
||||||
|
{
|
||||||
|
auto sqlite3_mod = py::module_::import("sqlite3");
|
||||||
|
auto ret = sqlite3_mod.attr("connect")(":memory:");
|
||||||
|
ret.attr("close")();
|
||||||
|
}
|
||||||
|
|
||||||
// activate the gotcha wrappers
|
// activate the gotcha wrappers
|
||||||
auto _err = gotcha_wrap(bindings.data(), bindings.size(), "rocpd.sqlite3");
|
auto _err = gotcha_wrap(bindings.data(), bindings.size(), "rocpd.sqlite3");
|
||||||
ROCP_WARNING_IF(_err != GOTCHA_SUCCESS) << "gotcha error for rocpd.sqlite3";
|
ROCP_WARNING_IF(_err != GOTCHA_SUCCESS) << "gotcha error for rocpd.sqlite3";
|
||||||
|
|||||||
Reference in New Issue
Block a user