Fix nullptr when doing nested profileing

shanyi15-patch-2
Xin Pan 7 years ago
parent ea4e6c7af7
commit f10152df78

@ -192,6 +192,12 @@ class DeviceTracerImpl : public DeviceTracer {
}
void AddCPURecords(const char *anno, uint64_t start_ns, uint64_t end_ns) {
if (!anno) {
// TODO(panyx0718): Currently, it doesn't support nested situation
// Up-level can be cleared by low-level and therefore get nullptr
// here.
return;
}
std::lock_guard<std::mutex> l(trace_mu_);
cpu_records_.push_back(
CPURecord{anno, start_ns, end_ns,

Loading…
Cancel
Save