Yes, we are trying to modify PyPy to meet the need.
Our plans are:
1. Find a similar function as "PyEval_EvalFrameEx()" in PyPy, and add a
function logFunction() inside it.
2. In logFunction(), analyze the frame/callstack. If it is a function call
from "Class A" to external function, log the function call. If it is
possible, we might only need to log the same function call only once to
minimize the perfomrance overhead.

The problem is we've no ideas on which function in PyPy is similar to
"PyEval_EvalFrameEx()" in Python.
Or do you have any alternative good ideas to do this?

On Tue, May 26, 2015 at 6:01 PM, Amaury Forgeot d'Arc <amaur...@gmail.com>
wrote:

> Did you consider the trace module?
>
> https://docs.python.org/2/library/trace.html
>
> 2015-05-26 11:45 GMT+02:00 Yicong Huang <hengha....@gmail.com>:
>
>> We would like to monitor and log all external function calls from a
>> class: when there the function call happen, we capture and log the frame.
>>
>> In python, there is the function PyEval_EvalFrameEx() we might add a
>> callback inside.
>> Is there a similar function in PyPy that would be called when the
>> function call happens?
>>
>>
>>
>>
>> _______________________________________________
>> pypy-dev mailing list
>> pypy-dev@python.org
>> https://mail.python.org/mailman/listinfo/pypy-dev
>>
>>
>
>
> --
> Amaury Forgeot d'Arc
>
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to