|
|
|
@ -102,9 +102,14 @@ class ProfilingManager {
|
|
|
|
|
// @return Status The status code returned
|
|
|
|
|
Status GetTracingNode(const std::string &name, std::shared_ptr<Tracing> *node);
|
|
|
|
|
|
|
|
|
|
// If profiling is enabled.
|
|
|
|
|
// return true if env variable has profiling enabled and enabled_ is set to true.
|
|
|
|
|
bool IsProfilingEnable() const;
|
|
|
|
|
|
|
|
|
|
// Calling this would disable Profiling functionality for the entire duration of ExecutionTree. It cannot be
|
|
|
|
|
// re-enabled. Each execution_tree is associated with a unique profiling_manager which will start when tree is
|
|
|
|
|
// launched. This is the master off switch, once called, it won't start profiler even if env variable says so.
|
|
|
|
|
void DisableProfiling() { enabled_ = false; }
|
|
|
|
|
|
|
|
|
|
const std::unordered_map<std::string, std::shared_ptr<Sampling>> &GetSamplingNodes() { return sampling_nodes_; }
|
|
|
|
|
|
|
|
|
|
// Launch monitoring thread.
|
|
|
|
@ -114,6 +119,7 @@ class ProfilingManager {
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::unique_ptr<Monitor> perf_monitor_;
|
|
|
|
|
bool enabled_;
|
|
|
|
|
std::unordered_map<std::string, std::shared_ptr<Tracing>> tracing_nodes_;
|
|
|
|
|
|
|
|
|
|
std::unordered_map<std::string, std::shared_ptr<Sampling>> sampling_nodes_;
|
|
|
|
@ -128,9 +134,9 @@ class ProfilingManager {
|
|
|
|
|
// @return Status The status code returned
|
|
|
|
|
Status RegisterSamplingNode(std::shared_ptr<Sampling> node);
|
|
|
|
|
|
|
|
|
|
ExecutionTree *tree_ = nullptr; // ExecutionTree pointer
|
|
|
|
|
std::string dir_path_; // where to create profiling file
|
|
|
|
|
std::string device_id_; // used when create profiling file,filename_deviceid.suffix
|
|
|
|
|
ExecutionTree *tree_; // ExecutionTree pointer
|
|
|
|
|
std::string dir_path_; // where to create profiling file
|
|
|
|
|
std::string device_id_; // used when create profiling file,filename_device_id.suffix
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum ProfilingType { TIME, CONNECTOR_DEPTH };
|
|
|
|
|