31 #ifndef SWRI_PROFILER_TOOLS_PROFILE_H_ 32 #define SWRI_PROFILER_TOOLS_PROFILE_H_ 37 #include <unordered_map> 41 #include <QStringList> 46 class ProfileDatabase;
69 cumulative_call_count(0),
70 cumulative_inclusive_duration_ns(0),
71 incremental_inclusive_duration_ns(0),
72 cumulative_exclusive_duration_ns(0),
73 incremental_exclusive_duration_ns(0),
74 incremental_max_duration_ns(0)
129 bool isValid()
const {
return node_key_ >= 0; }
131 const QString&
name()
const {
return name_; }
132 const QString&
path()
const {
return path_; }
134 const std::deque<ProfileEntry>&
data()
const {
return data_; }
135 int depth()
const {
return depth_; }
137 const std::vector<int>&
childKeys()
const {
return children_; }
170 std::unordered_map<int, ProfileNode>
nodes_;
182 void initialize(
int profile_key,
const QString &name);
184 void expandTimeline(
const uint64_t sec);
185 void addDataToAllNodes(
const bool back,
const size_t count);
187 bool touchNode(
const QString &path);
189 void storeItemData(std::set<uint64_t> &modified_times,
193 size_t indexFromSec(
const uint64_t secs)
const {
return secs - min_time_s_; }
194 uint64_t
secFromIndex(
const uint64_t index)
const {
return index + min_time_s_; }
196 void rebuildIndices();
197 void rebuildFlatIndex();
198 void rebuildTreeIndex();
200 void updateDerivedData(
size_t index);
201 void updateDerivedDataInternal(
ProfileNode& node,
size_t index);
208 bool isValid()
const {
return profile_key_ >= 0; }
211 const QString&
name()
const {
return name_; }
212 void setName(
const QString &name);
217 const std::vector<int>& nodeKeys()
const;
221 void profileModified(
int profile_key);
222 void nodesAdded(
int profile_key);
223 void dataAdded(
int profile_key);
226 #endif // SWRI_PROFILER_TOOLS_PROFILE_H_
ROSCONSOLE_DECL void initialize()
uint64_t cumulative_exclusive_duration_ns
uint64_t incremental_exclusive_duration_ns
uint64_t cumulative_inclusive_duration_ns
uint64_t incremental_max_duration_ns
uint64_t incremental_inclusive_duration_ns
uint64_t cumulative_call_count