GoogleCloudPlatform / GoogleCloudPlatform/cloud-profiler-python

Use PyFrame_GetLineNumber to get line numbers

未关闭
#8 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
32
派生
35
PR 合并指标
30 天内没有已合并 PR

描述

The CPU profiler currently [uses `f_lineno`](https://github.com/GoogleCloudPlatform/cloud-profiler-python/blob/master/googlecloudprofiler/src/profiler.cc#L163) as the line associated with each sample. However, `f_lineno` points to the start of the frame. Looking at a source listing of these profiles in pprof results in all samples appearing to be from the function definition.

One can use [`PyFrame_GetLineNumber`](https://docs.python.org/3/c-api/reflection.html) (available in Python 2.7 as well) instead to get the currently-executing line from a frame. This can help understand where within a function the program is executing.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。