diff options
Diffstat (limited to 'simpleperf/profcollect.cpp')
-rw-r--r-- | simpleperf/profcollect.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/simpleperf/profcollect.cpp b/simpleperf/profcollect.cpp index 724111e8..15d213c2 100644 --- a/simpleperf/profcollect.cpp +++ b/simpleperf/profcollect.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include <wakelock/wakelock.h> #include <include/simpleperf_profcollect.hpp> #include "ETMRecorder.h" @@ -25,14 +24,8 @@ using namespace simpleperf; -bool HasDriverSupport() { - return ETMRecorder::GetInstance().IsETMDriverAvailable(); -} - -bool HasDeviceSupport() { - auto result = ETMRecorder::GetInstance().CheckEtmSupport(); - if (!result.ok()) { - LOG(DEBUG) << result.error(); +bool HasSupport() { + if (!ETMRecorder::GetInstance().CheckEtmSupport()) { return false; } const EventType* type = FindEventTypeByName("cs-etm", false); @@ -43,13 +36,6 @@ bool HasDeviceSupport() { } bool Record(const char* event_name, const char* output, float duration) { - // The kernel may panic when trying to hibernate or hotplug CPUs while collecting - // ETM data. So get wakelock to keep the CPUs on. - auto wakelock = android::wakelock::WakeLock::tryGet("profcollectd"); - if (!wakelock) { - LOG(ERROR) << "Failed to request wakelock."; - return false; - } auto recordCmd = CreateCommandInstance("record"); std::vector<std::string> args; args.push_back("-a"); @@ -59,14 +45,11 @@ bool Record(const char* event_name, const char* output, float duration) { return recordCmd->Run(args); } -bool Inject(const char* traceInput, const char* profileOutput, const char* binary_filter) { +bool Inject(const char* traceInput, const char* profileOutput) { auto injectCmd = CreateCommandInstance("inject"); std::vector<std::string> args; args.insert(args.end(), {"-i", traceInput}); args.insert(args.end(), {"-o", profileOutput}); - if (binary_filter) { - args.insert(args.end(), {"--binary", binary_filter}); - } args.insert(args.end(), {"--output", "branch-list"}); args.emplace_back("--exclude-perf"); return injectCmd->Run(args); |