[Baypiggies] Fwd: Tools/libraries to determine the call graph(call flow) of an python program (module/package)

ashish makani ashish.makani at gmail.com
Tue Jan 12 12:52:28 EST 2016


Thanks a ton Josh.

I meant the flow of X starts with some function in x.py which in turn calls
some fuction in y.py( not using exec, using imports & simple function
calls), etc etc

Did you mean you have used pycallgraph but it took some massaging the
intermediate date before getting the pretty labelled call flow
graph/diagram ?

Thanks & happy tuesday ! :),
ashish

sent from mobile device ;
excuse typos & auto-correct errors
On Jan 12, 2016 19:59, "Joshua Rodman" <jrodman at splunk.com> wrote:

> On Tue, Jan 12, 2016 at 02:36:31PM +0530, ashish makani wrote:
> > Hi Folks,
> >
> > I am trying to do the following.
> >
> > I have a moderately complex python module/application X, whose source
> code
> > i have access to.
> >
> > I run X with the following command
> >
> > python x.py <arg1> <arg2> ... <argn>
> >
> >
> > Internally, x.py callls y.py, which in turn calls z.py, etc etc
> >
> > x.py ---> y.py ---> z.py ---> u.py ---> v.py
>
> Do you mean that x imports y and runs code in it, or do you mean that
> x creates a new process by running exec(["python", "y.py"]) ?
>
> > Is there a python library/tool/module , to which i give input the start
> > point of X, x.py
> > and the input arguments, arg1, arg2, ..., argn
> >
> > and which can come up with the call graph of X
> >
> > I have tried looking at pycallgraph[0], but havent had much luck with it.
> > 0. https://pypi.python.org/pypi/pycallgraph
> >
> > Any suggestions,advice, pointers welcome.
>
> if you're just looking to get a cross-module callgraph of a single
> python program, I have used this exact tool successfully, though it
> took some work editing the intermediate data to get a nicely labelled
> graph.
>
> if you're trying to map out the call flow cross-process, then I don't
> have any good ideas.
>
> -josh
> --
> Splunk. Here.  There.  Everywhere.
> JRodman.  Software Engineer.  Splunk Supportability Engineering
>                 o    .  o  .  o .  o  .  o  .  o
>            o     Transportin' the softwares.
>         .
>       .        ___
>      _n_n_n____i_i ________ ______________ _++++++++++++++_
>   *>(____________I I______I I____________I I______________I
>     /ooOOOO OOOOoo  oo oooo oo          oo ooo          ooo
> ------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20160112/a9f83506/attachment.html>


More information about the Baypiggies mailing list