MCPcopy Create free account
hub / github.com/apache/brpc / show_prof_and_rm

Function show_prof_and_rm

test/iobuf_unittest.cpp:99–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void show_prof_and_rm(const char* bin_name, const char* filename, size_t topn) {
100 char cmd[1024];
101 if (topn != 0) {
102 snprintf(cmd, sizeof(cmd), "if [ -e %s ] ; then CPUPROFILE_FREQUENCY=1000 ./pprof --text %s %s | head -%lu; rm -f %s; fi", filename, bin_name, filename, topn+1, filename);
103 } else {
104 snprintf(cmd, sizeof(cmd), "if [ -e %s ] ; then CPUPROFILE_FREQUENCY=1000 ./pprof --text %s %s; rm -f %s; fi", filename, bin_name, filename, filename);
105 }
106 ASSERT_EQ(0, system(cmd));
107}
108
109static void check_memory_leak() {
110 if (is_debug_allocator_enabled()) {

Callers 1

TEST_FFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected