From 9e75999e017a209d582e98a92aa7ebb7c07f11da Mon Sep 17 00:00:00 2001 From: zhang_cuicui Date: Tue, 29 Aug 2023 21:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ftrace=5Fplugin=E5=85=B3?= =?UTF-8?q?=E9=97=ADbytrace=E4=BA=8B=E4=BB=B6=E5=BC=80=E5=85=B3=E6=97=B6?= =?UTF-8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6a7acd5211e6e97b618d292d4162c10223578bd6 Reviewed-on: http://10.20.23.240:8080/c/OHOS_STD/developtools_profiler/+/33221 Tested-by: Tested-by: Reviewed-by: --- device/plugins/ftrace_plugin/src/flow_controller.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/device/plugins/ftrace_plugin/src/flow_controller.cpp b/device/plugins/ftrace_plugin/src/flow_controller.cpp index 75762e5e3..4fae10774 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 -- Gitee