Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
1eb21063
Commit
1eb21063
authored
9 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Document callgraph analysis code
parent
f8a51068
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/HACKING
+17
-0
17 additions, 0 deletions
doc/HACKING
scripts/maint/generate_callgraph.sh
+2
-1
2 additions, 1 deletion
scripts/maint/generate_callgraph.sh
with
19 additions
and
1 deletion
doc/HACKING
+
17
−
0
View file @
1eb21063
...
...
@@ -265,6 +265,23 @@ Here are some basic instructions
* "opreport -l that_dir/*"
- Profit
Generating and analyzing a callgraph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Run ./scripts/maint/generate_callgraph.sh . This will generate a
bunch of files in a new ./callgraph directory.
2. Run ./scripts/maint/analyze_callgraph.py callgraph/src/*/* . This
will do a lot of graph operations and then dump out a new
"callgraph.pkl" file, containing data in Python's "pickle" format.
3. Run ./scripts/maint/display_callgraph.py . It will display:
- the number of functions reachable from each function.
- all strongly-connnected components in the Tor callgraph
- the largest bottlenecks in the largest SCC in the Tor callgraph.
Note that currently the callgraph generator can't detect calls that pass
through function pointers.
Coding conventions
------------------
...
...
This diff is collapsed.
Click to expand it.
scripts/maint/generate_callgraph.sh
+
2
−
1
View file @
1eb21063
...
...
@@ -8,6 +8,7 @@ mkdir -p callgraph/src/or
mkdir
-p
callgraph/src/tools
for
fn
in
$C_FILES
;
do
echo
$fn
clang
$CFLAGS
-S
-emit-llvm
-fno-inline
-o
-
$fn
|
\
opt
-analyze
-print-callgraph
2>
"callgraph/
${
fn
}
allgraph"
opt
-analyze
-print-callgraph
>
/dev/null
2>
"callgraph/
${
fn
}
allgraph"
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment