summaryrefslogtreecommitdiff
path: root/simpleperf/ProbeEvents.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2020-10-19 14:50:54 -0700
committerYabin Cui <yabinc@google.com>2020-10-19 15:00:35 -0700
commit68534b9e796819477b0cc985491c9624ae50c5dc (patch)
tree52861efb7b89b963b58ddabffb24b90623115123 /simpleperf/ProbeEvents.h
parentbc8a4a3be6c779c01555858b641214eec80bad85 (diff)
downloadextras-68534b9e796819477b0cc985491c9624ae50c5dc.tar.gz
simpleperf: add shortcut for creating kprobe events.
When using a kprobe event without any arguments, a --kprobe option isn't needed. For example, when "-e kprobes:do_sys_open" is used without --kprobe, a default kprobe event is created at the entry of do_sys_open(). Bug: 160630060 Test: run simpleperf_unit_test. Change-Id: I62f5616c423ecb104d64a425fbd52e38e57e993e
Diffstat (limited to 'simpleperf/ProbeEvents.h')
-rw-r--r--simpleperf/ProbeEvents.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/simpleperf/ProbeEvents.h b/simpleperf/ProbeEvents.h
index 1f47acd9..39fa65f2 100644
--- a/simpleperf/ProbeEvents.h
+++ b/simpleperf/ProbeEvents.h
@@ -38,7 +38,9 @@ class ProbeEvents {
// Accept kprobe cmd as in <linux_kernel>/Documentation/trace/kprobetrace.rst.
bool AddKprobe(const std::string& kprobe_cmd);
-
+ bool IsProbeEvent(const std::string& event_name);
+ // If not exist, add a kprobe tracepoint at the function entry.
+ bool CreateProbeEventIfNotExist(const std::string& event_name);
bool IsEmpty() const { return kprobe_events_.empty(); }
void Clear();