Great thanks!
I think you are right. We might kill the JIT perfomance by introducing such
work.
Another possible solution is we could do it at module level.

Is there a function smilar as " PyMODINIT_FUNC()" in Pypy?

Here is the plan:
1. When the code try to import an external module, we invoke an inserted
function doLog().
2. doLog() function record the module name and all module's public function.
In this way, I think we could greatly reduce the perfomance overhead.

On Tue, May 26, 2015 at 6:32 PM, Maciej Fijalkowski <fij...@gmail.com>
wrote:

> you will kill the JIT performance terribly if you do that. space.call
> or space.call_function (in pypy/objspace/std/objspace or
> pypy/interpreter/baseobjspace) are your candidates
>
> On Tue, May 26, 2015 at 12:31 PM, Yicong Huang <hengha....@gmail.com>
> wrote:
> > 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
> >
>
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to