stack trace at this moment only for main thread
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
#include <unordered_map>
|
||||
#include <deque>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
static const int method_name_print_len = 15;
|
||||
static const int print_top_methods = 15;
|
||||
@@ -13,7 +16,9 @@ static const int call_stack_max_methods = 10;
|
||||
class MlPerfMon {
|
||||
|
||||
private:
|
||||
MlPerfMon() : perfOn(false) {};
|
||||
MlPerfMon() : perfOn(false) {
|
||||
main_thread_id = std::this_thread::get_id();
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -36,4 +41,5 @@ private:
|
||||
std::unordered_map<std::string, long> calls_counter;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> start_time;
|
||||
std::deque<std::string> call_stack;
|
||||
std::thread::id main_thread_id;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user