File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
source/lib/omnitrace/library Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,16 @@ create_cpu_cid_entry(int64_t _tid)
151151 auto_lock_t _p_lk{ _p_mtx, std::defer_lock };
152152 if (!_p_lk.owns_lock ()) _p_lk.lock ();
153153
154- auto && _cid = get_cpu_cid ()++;
155- auto && _parent_cid = get_cpu_cid_stack (_p_idx)->back ();
154+ auto && _cid = get_cpu_cid ()++;
155+ // auto&& _parent_cid = get_cpu_cid_stack(_p_idx)->back();
156+ uint64_t _parent_cid = 0 ;
157+ auto & cid_stack = get_cpu_cid_stack (_p_idx);
158+
159+ if (!cid_stack->empty ())
160+ {
161+ _parent_cid = cid_stack->back ();
162+ }
163+
156164 uint32_t && _depth = get_cpu_cid_stack (_p_idx)->size () - ((_p_idx == _tid) ? 1 : 0 );
157165
158166 get_cpu_cid_parents (_tid)->emplace (_cid, std::make_tuple (_parent_cid, _depth));
You can’t perform that action at this time.
0 commit comments