diff --git a/device/plugins/ftrace_plugin/src/flow_controller.cpp b/device/plugins/ftrace_plugin/src/flow_controller.cpp index 75762e5e3827dc8b8c9725f6d251a2f325657b0a..4fae107747035d08e0f80ad6334dcb71c3f6c1fb 100644 --- a/device/plugins/ftrace_plugin/src/flow_controller.cpp +++ b/device/plugins/ftrace_plugin/src/flow_controller.cpp @@ -458,6 +458,11 @@ int FlowController::StopCapture(void) // disable ftrace event switches DisableTraceEvents(); + // disable userspace trace triggers + if (traceCategories_.size() > 0) { + traceOps_->DisableCategories(); + } + // stop ftrace event data polling thread keepRunning_ = false; if (pollThread_.joinable()) { @@ -483,12 +488,6 @@ int FlowController::StopCapture(void) tansporter_->Report(msgSize); } - // disable userspace trace triggers - // because trace cmd will read trace buffer, - // so we to this action after polling thread exit. - if (traceCategories_.size() > 0) { - traceOps_->DisableCategories(); - } tansporter_->Flush(); // release resources