-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgprofCommands
68 lines (54 loc) · 3.7 KB
/
gprofCommands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
There are three kind of parameters in gprof parameter arsenal:
1) Output format parameters.
2) Analysis parameters.
3) Miscellaneous parameters.
1. Output format parameters modify the output produced by gprof. They are discussed bellow:
Parameters Description
---------- -----------
-A --annotated-source=[symspec] Display source code of all functions, or only of the matching symbols if [symspec] is given.
-b --brief Don't display verbose output explaining the analysis field.
-C --exec-counts=[symspec] Print total tally of all functions, or only the function specified by [symspec] if it's set.
-i --file-info Display summary information about the profile data file.
-I --directory-path=[dirs] Specify directory to search souce code.
-J --no-annotated-source=[symspec] Don't print annotated source code. However if [symspec] is set, don't print annotated source code only for functions specified by symspec.
-L --print-path Display full pathname of source files.
-p --flat-profile=[symspec] Display flat profiles for all functions or only the functions specified by [symspec] if it's set.
-P --no-flat-profile=[symspec] Don't display flat profile for any function, or just the function specified by [symspec] if it's set.
-q --graph=[symspec] Print the call graph analysis. Do it only for [symspec] functions if it's set.
-Q --no-graph=[symspec] Don't display call graph analysis.
-y --seperate-files Generate annotated source code in seperate output file.
-Z --no-exec-counts=[symspecs] Don't display total tally function and number of times called. Or if [symspec] is set, don't display only the specified function.
-r --function-ordering Print a suggested function ordering based on profiling data including paging, cache behavior etc.
-R --file-ordering [map-file] Print suggested object file ordering based on profiling datai to [map-file].
-T --traditional Display output in traditional BSD style.
-w --width=[W] Set width of output lines to [W].
-x --all-lines Every line in annotated source code is displayed within a function.
--demangle/--no-demangle Demange C/C++ symbols.
2. Analytical parameters modify the way gprof analyze. Some of the parameters are discribed bellow:
Parameters Description
---------- -----------
-a --no-static Don't analyze information about statically declared functions (private functions).
-c --static-call-graph Analyze information on child functions that were never called in the program.
-D --ignore-non-functions Ignore symbols that are not known to be function.
-k [from/to] Delete any arc from the call graph with symbols matching symspec "from" to those matchin symspec "to".
-l --line Analyze the program by line instead of function.
-m --min-count=[num] Analyze only functions called more than a specific number of time.
-n --time [symspec] Analyze time only for functions specified by [symspec].
-N --no-time [symspec] Don't analyze time for [symspec] functions.
-z --display-unused-functions Mention all funtions in the flat profile, even those that aren't called.
3. Miscellaneous paremeter:
Parameters Description
---------- -----------
-d --debug=[num] Put gprof in debug mode specifying debug level with [num].
-O --file-formate=[name] Specify the format of the profile data file.
-s --sum Just summarize the data in profile data file.
-h --help Print gprof help text and exit.
-v --version Print gprof version information and exit.
Files produced by gprof:
1. a.out
The namelist and text space.
2. gmon.out
Dynamic call graph and profile.
3. gmon.sum
Summarize the dynamic call grpah and profile.
To analyze a program with gprof, it must be compiled with "-pg" option.