Skip to content

Commit

Permalink
Add regression test for bcc resolve symbol names
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehamel authored and yonghong-song committed Mar 18, 2020
1 parent e1d53a3 commit 1cd3952
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/cc/test_usdt_probes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,11 @@ TEST_CASE("test probing running Ruby process in namespaces",

res = bpf.detach_usdt(u, ruby_pid);
REQUIRE(res.code() == 0);

struct bcc_symbol sym;
std::string pid_root= "/proc/" + std::to_string(ruby_pid) + "/root/";
std::string module = pid_root + "usr/local/bin/ruby";
REQUIRE(bcc_resolve_symname(module.c_str(), "rb_gc_mark", 0x0, ruby_pid, nullptr, &sym) == 0);
REQUIRE(std::string(sym.module).find(pid_root, 1) == std::string::npos);
}
}

0 comments on commit 1cd3952

Please sign in to comment.