call-graph

How can I generate call graphs for Perl modules and scripts?

落爺英雄遲暮 提交于 2019-12-06 13:04:30
I have a bunch of Perl scripts and Perl modules given to me by someone. I have a driver program that tests all these scripts and modules. I want to generate a call graph and see the flow. Is there something available for Perl for doing this? I'd like something like pycallgraph (for python). I am running all this in AIX. Simon Cozens tells you how to do it in Profiling Perl on Perl.com . He uses a combination of Devel::DProf and GraphViz . 来源: https://stackoverflow.com/questions/1270477/how-can-i-generate-call-graphs-for-perl-modules-and-scripts

Why do I see edges in the call graph that don't exist using gperftools?

£可爱£侵袭症+ 提交于 2019-12-06 11:15:15
Given the following code that either calls f or g #include <stdlib.h> #include <stdio.h> int f() { return 0; } int g() { return 1; } int main() { long sum = 0; for(int i = 0; i < 1000*1000*1000; i++) { int result; if(rand() % 2 == 0) { result = f(); } else { result = g(); } sum += result; } printf("%ld\n", sum); } I compile with g++ test.c -o doom -lprofiler -lunwind And run with CPUPROFILE=./test.txt ./test And then generate a gif with pprof --gif ./test ./test.txt > output.gif I get the following However, I have edges going from f to g, and f to itself, and g to itself. There are no

how to make gcc spit out a mapping from flow graphs to source code line numbers

眉间皱痕 提交于 2019-12-04 11:11:44
问题 Can gcc spit out, given a C file, a list of the all function calls that occur, with filename and line number both for the call itself and for the function's declaration? I know gcc somehow retains this information with -g (debuggers rely on it) and that it can dump control flow graphs with -dr (but without filenames or line numbers); but is there a ready-to-use tool that takes gcc output and does what I want? The reason I want such a tool to use gcc is that this will allow me to use it with

Generating call graph for C code [closed]

孤街醉人 提交于 2019-12-04 05:21:01
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm writing a tool and I need to generate the callgraph for some C projects. I was able to generate the callgraph of one file using clang, but I was not able to find out how to generate the call graph across the whole project which

Print complete control flow through gdb including values of variables

北城余情 提交于 2019-12-03 20:26:09
The idea is that given a specific input to the program, somehow I want to automatically step-in through the complete program and dump its control flow along with all the data being used like classes and their variables. Is their a straightforward way to do this? Or can this be done by some scripting over gdb or does it require modification in gdb? Ok the reason for this question is because of an idea regarding a debugging tool. What it does is this. Given two different inputs to a program, one causing an incorrect output and the other a correct one, it will tell what part of the control flow

Call graph generation from matlab src code

核能气质少年 提交于 2019-12-03 19:05:04
问题 I am trying to create a function call graph for around 500 matlab src files. I am unable to find any tools which could help me do the same for multiple src files. Is anyone familiar with any tools or plugins? In case any such tools are not available, any suggestions on reading 6000 lines of matlab code without documentation is welcome. 回答1: Let me suggest M2HTML, a tool to automatically generate HTML documentation of your MATLAB m-files. Among its feature list: Finds dependencies between

Static call graph generation for the Linux kernel

夙愿已清 提交于 2019-12-03 08:56:11
问题 I'm looking for a tool to statically generate a call graph of the Linux kernel (for a given kernel configuration). The generated call graph should be "complete", in the sense that all calls are included, including potential indirect ones which we can assume are only done through the use of function pointers in the case of the Linux kernel. For instance, this could be done by analyzing the function pointer types: this approach would lead to superfluous edges in the graph, but that's ok for me.

How to generate call graph from android APK?

那年仲夏 提交于 2019-12-03 08:17:27
I have downloaded a few Android applications from Google Play. I have got Smali code through reverse engineering tool apktool .I want to generate call graphs for these applications. I have seen many links on stack overflow and Google, most of the suggested tools are either for c/c++ or if they are for Java , they need source code which I don't have, of course. Is there any way to generate call graphs automatically? Thanks. apkinspector - http://code.google.com/p/apkinspector/ The goal of this project is to aide analysts and reverse engineers to visualize compiled Android packages and their

Create a call graph for a file with clang

泄露秘密 提交于 2019-12-03 05:12:04
问题 Is there a way to create a call graph with clang that can reasonably fit on a page? i.e. given: #include<iostream> using namespace std; int main() { int a; cin>>a; cout<<a; cout<<a; return 0; } I current get by using: $ clang++ main.cpp -S -emit-llvm -o - | opt -analyze -std-link-opts -dot-callgraph $ cat callgraph.dot | c++filt | sed 's,>,\\>,g; s,-\\>,->,g; s,<,\\<,g' | gawk '/external node/{id=$1}$1!=id' | dot -Tpng -ocallgraph.png (which seems like a lot of effort to do something that I

Static call graph generation for the Linux kernel

无人久伴 提交于 2019-12-02 22:48:02
I'm looking for a tool to statically generate a call graph of the Linux kernel (for a given kernel configuration). The generated call graph should be "complete", in the sense that all calls are included, including potential indirect ones which we can assume are only done through the use of function pointers in the case of the Linux kernel. For instance, this could be done by analyzing the function pointer types: this approach would lead to superfluous edges in the graph, but that's ok for me. ncc seems to implement this idea, however I didn't succeed in making it work on the 3.0 kernel. Any