diff --git a/paddle/fluid/platform/device_tracer.cc b/paddle/fluid/platform/device_tracer.cc index 696ed61981f8a3c876b0d2d6040df5c05546e559..90ab85905d5e00e61d8fa91cb61ce919b497ebfb 100644 --- a/paddle/fluid/platform/device_tracer.cc +++ b/paddle/fluid/platform/device_tracer.cc @@ -276,15 +276,12 @@ class DeviceTracerImpl : public DeviceTracer { std::string kernel_name; for (const KernelRecord &r : kernel_records_) { if (correlations_.find(r.correlation_id) == correlations_.end()) { - // fprintf(stderr, "cannot relate a kernel activity\n"); - // continue; - kernel_name = "Unknown"; - } else { - kernel_name = correlations_.at(r.correlation_id); + fprintf(stderr, "cannot relate a kernel activity\n"); + continue; } auto *event = profile_pb.add_events(); event->set_type(proto::Event::GPUKernel); - event->set_name(kernel_name); + event->set_name(correlations_.at(r.correlation_id)); event->set_start_ns(r.start_ns); event->set_end_ns(r.end_ns); event->set_sub_device_id(r.stream_id);