MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / libpath

Function libpath

thread/test/test-lib-data.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49std::string libpath(uint64_t pid) {
50 auto path =
51 popen_read("cat /proc/" + std::to_string(pid) +
52 "/maps | grep libphoton | tr -s ' ' | cut -f 6 -d ' '"
53 " | head -n 1");
54 EXPECT_FALSE(path.empty());
55 char* tp = strdup(path.c_str());
56 path = dirname(tp);
57 puts(path.c_str());
58 free(tp);
59 return path;
60}
61
62TEST(static_lib, photon_thread_alloc) {
63#ifdef __linux__

Callers 1

TESTFunction · 0.85

Calls 4

popen_readFunction · 0.85
to_stringFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected