def main(): ''' Run DTrace... ''' thr = DTraceConsumerThread(SCRIPT, walk_func=my_walk, sleep=1) thr.start() # we will stop the thread after some time... time.sleep(5) # stop and wait for join... thr.stop() thr.join()
def run_dtrace(script): ''' Run DTrace till Ctrl+C is pressed... ''' thr = DTraceConsumerThread(script, False, walk_func=pretty_print) thr.start() brendan() try: while True: pass except (KeyboardInterrupt, SystemExit): thr.stop() thr.join()
def main(): """ Run DTrace... """ thr = DTraceConsumerThread(SCRIPT, walk_func=my_walk, sleep=1) thr.start() # we will stop the thread after some time... time.sleep(5) # stop and wait for join... thr.stop() thr.join()
def main(): ''' Run DTrace... ''' thr = DTraceConsumerThread(SCRIPT) thr.start() # we will stop the thread after some time... time.sleep(5) # stop and wait for join... thr.stop() thr.join()