summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/cmd_list.cpp')
-rw-r--r--simpleperf/cmd_list.cpp47
1 files changed, 11 insertions, 36 deletions
diff --git a/simpleperf/cmd_list.cpp b/simpleperf/cmd_list.cpp
index 46bee30d..c87c05f5 100644
--- a/simpleperf/cmd_list.cpp
+++ b/simpleperf/cmd_list.cpp
@@ -24,14 +24,11 @@
#include "command.h"
#include "environment.h"
-#include "ETMRecorder.h"
#include "event_attr.h"
#include "event_fd.h"
#include "event_selection_set.h"
#include "event_type.h"
-using namespace simpleperf;
-
static bool IsEventTypeSupported(const EventType& event_type) {
if (event_type.type != PERF_TYPE_RAW) {
perf_event_attr attr = CreateDefaultPerfEventAttr(event_type);
@@ -48,7 +45,7 @@ static bool IsEventTypeSupported(const EventType& event_type) {
// We can't decide whether the raw event is supported by calling perf_event_open().
// Instead, we can check if it can collect some real number.
perf_event_attr attr = CreateDefaultPerfEventAttr(event_type);
- std::unique_ptr<EventFd> event_fd = EventFd::OpenEventFile(attr, gettid(), -1, nullptr, false);
+ std::unique_ptr<EventFd> event_fd = EventFd::OpenEventFile(attr, gettid(), -1, nullptr);
if (event_fd == nullptr) {
return false;
}
@@ -74,36 +71,19 @@ static bool IsEventTypeSupported(const EventType& event_type) {
static void PrintEventTypesOfType(uint32_t type, const std::string& type_name,
const std::set<EventType>& event_types) {
printf("List of %s:\n", type_name.c_str());
- if (GetBuildArch() == ARCH_ARM || GetBuildArch() == ARCH_ARM64) {
- if (type == PERF_TYPE_RAW) {
- printf(
- // clang-format off
-" # Please refer to \"PMU common architectural and microarchitectural event numbers\"\n"
-" # and \"ARM recommendations for IMPLEMENTATION DEFINED event numbers\" listed in\n"
-" # ARMv8 manual for details.\n"
-" # A possible link is https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile.\n"
- // clang-format on
- );
- } else if (type == PERF_TYPE_HW_CACHE) {
- printf(" # More cache events are available in `simpleperf list raw`.\n");
- }
+ if (type == PERF_TYPE_RAW && (GetBuildArch() == ARCH_ARM || GetBuildArch() == ARCH_ARM64)) {
+ printf(" # Please refer to PMU event numbers listed in ARMv8 manual for details.\n");
+ printf(" # A possible link is https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile.\n");
}
for (auto& event_type : event_types) {
if (event_type.type == type) {
- bool supported = IsEventTypeSupported(event_type);
- // For raw events, we may not be able to detect whether it is supported on device.
- // So always print them.
- if (!supported && type != PERF_TYPE_RAW) {
- continue;
- }
- printf(" %s", event_type.name.c_str());
- if (!supported) {
- printf(" (may not supported)");
+ if (IsEventTypeSupported(event_type)) {
+ printf(" %s", event_type.name.c_str());
+ if (!event_type.description.empty()) {
+ printf("\t\t# %s", event_type.description.c_str());
+ }
+ printf("\n");
}
- if (!event_type.description.empty()) {
- printf("\t\t# %s", event_type.description.c_str());
- }
- printf("\n");
}
}
printf("\n");
@@ -120,9 +100,8 @@ class ListCommand : public Command {
" hw hardware events\n"
" sw software events\n"
" cache hardware cache events\n"
-" raw raw cpu pmu events\n"
+" raw raw pmu events\n"
" tracepoint tracepoint events\n"
-" cs-etm coresight etm instruction tracing events\n"
"Options:\n"
"--show-features Show features supported on the device, including:\n"
" dwarf-based-call-graph\n"
@@ -149,7 +128,6 @@ bool ListCommand::Run(const std::vector<std::string>& args) {
{"raw", {PERF_TYPE_RAW, "raw events provided by cpu pmu"}},
{"tracepoint", {PERF_TYPE_TRACEPOINT, "tracepoint events"}},
{"user-space-sampler", {SIMPLEPERF_TYPE_USER_SPACE_SAMPLERS, "user-space samplers"}},
- {"cs-etm", {-1, "coresight etm events"}},
};
std::vector<std::string> names;
@@ -175,9 +153,6 @@ bool ListCommand::Run(const std::vector<std::string>& args) {
for (auto& name : names) {
auto it = type_map.find(name);
- if (name == "cs-etm") {
- it->second.first = ETMRecorder::GetInstance().GetEtmEventType();
- }
PrintEventTypesOfType(it->second.first, it->second.second, event_types);
}
return true;