Python 版的 PinkTrace 示例 pink-fork-linux.py,,pink-fork-li
Python 版的 PinkTrace 示例 pink-fork-linux.py,,pink-fork-li
pink-fork-linux.py
#!/usr/bin/env python# coding: utf-8# vim: set sw=4 ts=4 sts=4 et :"""An example demonstrating the tracing fork on Linux."""from __future__ import print_functionimport os, signalimport pinktrace.eventimport pinktrace.tracepid = os.fork()if not pid: # Prepare for tracing. pinktrace.trace.me() # Stop to give the parent a chance to resume execution after setting options. os.kill(os.getpid(), signal.SIGSTOP) print("hello world")else: # parent pid, status = os.waitpid(pid, 0) event = pinktrace.event.decide(status) assert event == pinktrace.event.EVENT_STOP, "%#x" % status # Set tracing options pinktrace.trace.setup(pid) # Let the child resume its execution. pinktrace.trace.resume(pid) # Wait for the child to exit. os.waitpid(pid, 0)
相关内容
- 支持GAE本地运行的Unit test基类,gaeunit,GaeTestCase#
- 显示距离下班还有多长时间的Python版,多长时间python
- 各种排序方法,排序方法,最近找工作,很是郁闷,回
- python编写的一个通过多线程扫描端口的代码,python多线
- 用wxpython开发的批量在图片上生成水印文字的可视化小
- 打印日历,,python代码#-*-
- GAE/python中利用memcache代替Session实现用户登录验,gaeme
- 获得图片的Base64编码,,python代码#!/u
- python修改操作系统时间的代码,python操作系统,#-*- cod
- python 抓去指定网页以及该网页上所有链接,python指定
评论关闭