summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_stat.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-06-01 15:39:39 -0700
committerYabin Cui <yabinc@google.com>2016-06-01 15:46:07 -0700
commitebf79f3a65c81ef0f8cd7a3b875771be88157fcc (patch)
treecef9949781d2a3f07ff762412f8ca7e68217d853 /simpleperf/cmd_stat.cpp
parent85a3e6e14fd777b92199b2e39a3b80acd77a7a0f (diff)
downloadextras-ebf79f3a65c81ef0f8cd7a3b875771be88157fcc.tar.gz
simpleperf: check perf event limit.
The property security.perf_harden is added in https://android-review.googlesource.com/#/c/233736/5. And simpleperf needs to notice that. Bug: 29054680 Change-Id: I5f1593f5b389d182a56c4bf3bd438a1dc2b66686
Diffstat (limited to 'simpleperf/cmd_stat.cpp')
-rw-r--r--simpleperf/cmd_stat.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/simpleperf/cmd_stat.cpp b/simpleperf/cmd_stat.cpp
index f477abfd..dca7ed05 100644
--- a/simpleperf/cmd_stat.cpp
+++ b/simpleperf/cmd_stat.cpp
@@ -101,6 +101,10 @@ class StatCommand : public Command {
};
bool StatCommand::Run(const std::vector<std::string>& args) {
+ if (!CheckPerfEventLimit()) {
+ return false;
+ }
+
// 1. Parse options, and use default measured event types if not given.
std::vector<std::string> workload_args;
if (!ParseOptions(args, &workload_args)) {