summaryrefslogtreecommitdiff
path: root/simpleperf/IOEventLoop.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-07-28 12:55:41 -0700
committerYabin Cui <yabinc@google.com>2016-07-28 14:38:53 -0700
commitdbbda3020c483a8da2e9ce985c1e9d8b7bcc8ec0 (patch)
tree0d7fc1d8dbe816283ee159c3656759585310fc9e /simpleperf/IOEventLoop.h
parent43b194dc1522b0a40aa50408635b5ccde459a909 (diff)
downloadextras-dbbda3020c483a8da2e9ce985c1e9d8b7bcc8ec0.tar.gz
simpleperf: use libevent in record command.
Support read Event in IOEventLoop, test it, and use it in record command. Format related code and clean up some comments. Bug: http://b/30405638 Change-Id: I3b07d50b0374be3f3e7ee9fa4d0c0ccc8ae21a2b Test: run simpleperf_unit_test.
Diffstat (limited to 'simpleperf/IOEventLoop.h')
-rw-r--r--simpleperf/IOEventLoop.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/simpleperf/IOEventLoop.h b/simpleperf/IOEventLoop.h
index 3f75b5aa..4ae906ac 100644
--- a/simpleperf/IOEventLoop.h
+++ b/simpleperf/IOEventLoop.h
@@ -34,6 +34,10 @@ class IOEventLoop {
IOEventLoop();
~IOEventLoop();
+ // Register a read Event, so [callback] is called when [fd] can be read
+ // without blocking.
+ bool AddReadEvent(int fd, const std::function<bool()>& callback);
+
// Register a signal Event, so [callback] is called each time signal [sig]
// happens.
bool AddSignalEvent(int sig, const std::function<bool()>& callback);