diff options
Diffstat (limited to 'simpleperf/event_attr.cpp')
-rw-r--r-- | simpleperf/event_attr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/simpleperf/event_attr.cpp b/simpleperf/event_attr.cpp index 19364489..7c58081e 100644 --- a/simpleperf/event_attr.cpp +++ b/simpleperf/event_attr.cpp @@ -23,6 +23,7 @@ #include <android-base/logging.h> +#include "environment.h" #include "event_type.h" #include "utils.h" @@ -92,7 +93,9 @@ perf_event_attr CreateDefaultPerfEventAttr(const EventType& event_type) { if (attr.type == PERF_TYPE_TRACEPOINT) { // Tracepoint information are stored in raw data in sample records. - attr.sample_type |= PERF_SAMPLE_RAW; + if (CanRecordRawData()) { + attr.sample_type |= PERF_SAMPLE_RAW; + } } return attr; } |