OSDN Git Service

ANRdaemon: move trace result from /sdcard to /data am: d93aa41807
[android-x86/system-extras.git] / simpleperf / event_selection_set.cpp
index df731f1..fad8b1e 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "event_selection_set.h"
 
+#include <poll.h>
+
 #include <android-base/logging.h>
 #include <android-base/stringprintf.h>
 
@@ -43,7 +45,7 @@ bool IsDwarfCallChainSamplingSupported() {
   perf_event_attr attr = CreateDefaultPerfEventAttr(*type);
   attr.sample_type |= PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER;
   attr.exclude_callchain_user = 1;
-  attr.sample_regs_user = GetSupportedRegMask();
+  attr.sample_regs_user = GetSupportedRegMask(GetBuildArch());
   attr.sample_stack_user = 8192;
   return IsEventAttrSupportedByKernel(attr);
 }
@@ -164,7 +166,7 @@ bool EventSelectionSet::EnableDwarfCallChainSampling(uint32_t dump_stack_size) {
     selection.event_attr.sample_type |=
         PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER;
     selection.event_attr.exclude_callchain_user = 1;
-    selection.event_attr.sample_regs_user = GetSupportedRegMask();
+    selection.event_attr.sample_regs_user = GetSupportedRegMask(GetBuildArch());
     selection.event_attr.sample_stack_user = dump_stack_size;
   }
   return true;