GoogleCloudPlatform / GoogleCloudPlatform/cloud-profiler-python

Use PyFrame_GetLineNumber to get line numbers

Đang mở
#8 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
32
Fork
35
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.