Skip to content

Commit

Permalink
catch keyboard interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivagman committed Dec 26, 2019
1 parent 4defbd5 commit 649b19f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tracee/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,12 +991,12 @@ def monitor_events(self):
# loop with callback to handle_event
self.bpf["events"].open_perf_buffer(self.handle_event, page_cnt=self.buf_pages, lost_cb=self.lost_event)
while self.do_trace:
# It would have been better to parse the events in a "consumer" thread
# As python threading is not efficient - parse here
for event in self.event_bufs:
self.parse_event(event)
self.event_bufs = list()
try:
# It would have been better to parse the events in a "consumer" thread
# As python threading is not efficient - parse here
for event in self.event_bufs:
self.parse_event(event)
self.event_bufs = list()
self.bpf.perf_buffer_poll(1000)
except KeyboardInterrupt:
exit()

0 comments on commit 649b19f

Please sign in to comment.