GoogleCloudPlatform / GoogleCloudPlatform/cloud-profiler-python

Use PyFrame_GetLineNumber to get line numbers

Abierto
#8 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
32
Forks
35
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.