예제 #1
0
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()
예제 #2
0
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()
예제 #3
0
파일: cli.py 프로젝트: 0x4d4e/python-dtrace
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()
예제 #4
0
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()