cpu_reporter.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:stackimpact-python 作者: stackimpact 项目源码 文件源码
def setup(self):
        if self.agent.get_option('cpu_profiler_disabled'):
            return

        if runtime_info.OS_WIN:
            self.agent.log('CPU profiler is not available on Windows.')
            return

        def _sample(signum, signal_frame):
            if self.handler_active:
                return
            self.handler_active = True

            with self.profile_lock:
                try:
                    self.process_sample(signal_frame)
                    signal_frame = None
                except Exception:
                    self.agent.exception()

            self.handler_active = False

        self.prev_signal_handler = signal.signal(signal.SIGPROF, _sample)

        self.setup_done = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号