Automatic date update in version.in
[binutils-gdb.git] / gprofng / README
1 What is gprofng?
2
3 Gprofng is the GNU Next Generation profiler for analyzing the performance
4 of Linux applications. Gprofng allows you to:
5 - Profile C / C++ / Java / Scala applications without needing to recompile
6 - Profile multi-threaded applications
7 - Analyze and compare multiple experiments
8 - Use time-based sampling and / or hardware event counters
9
10 Building gprofng
11
12 Gprofng is distributed with binutils. To build gprofng, you build binutils.
13 Overview:
14 1. Set paths
15 2. Verify prerequisites
16 3. Git clone
17 4. Configure, make, and make install
18 Details follow for each of these.
19
20 1. Set paths
21
22 If you are configuring binutils for the default location, it will use:
23 /usr/local
24 In your shell initialization procedure, set your paths using commands
25 similar to these:
26 export PATH=/usr/local/bin:$PATH
27 export MANPATH=/usr/local/share/man:$MANPATH
28 export INFOPATH=/usr/local/share/info/:$INFOPATH
29
30 2. Verify prerequisites
31
32 To build a recent version of binutils, it is useful to have a developer
33 system with the most recent compilers, libraries, and operating system.
34 Development systems will typically already include most of these:
35
36 bison bison-devel bzip2 elfutils-debuginfod-client-devel
37 expat-devel flex gcc gcc-c++ git-core git-core-doc gmp-devel
38 help2man libbabeltrace-devel libipt-devel m4 make mpfr-devel
39 ncurses-devel perl-Data-Dumper tar texinfo xz zlib-devel
40 java-17-openjdk-devel
41
42 CAUTION: The list of prerequisites changes depending on your operating system
43 and changes as binutils evolves. The list above is a snapshot of the useful
44 packages in early 2022 for Red Hat Enterprise Linux and Oracle Linux.
45
46 Your system may use other packages; for example, you may be able to use a
47 different version of Java than shown above. If there are failures, you may
48 need to search for other packages as described in the "Hints" section below.
49
50 3. Git clone
51
52 Select a binutils repository and a branch that you would like
53 to start from. For example, to clone from the master at
54 sourceware.org, you could say:
55 git clone http://sourceware.org/git/binutils-gdb.git CloneDir
56
57 4. Configure, make, and install
58
59 There are many options for configure (see: configure --help). For example,
60 --prefix sets the destination, as described in the "Hints" section below.
61 If the default destination /usr/local is acceptable for your needs, then
62 after the clone operation finishes, you can simply say:
63
64 mkdir build
65 cd build
66 ../CloneDir/configure
67 make
68 sudo make install
69
70 Getting started
71
72 To start using gprofng, see the tutorial available by saying:
73 info gprofng
74
75 Hints and tips for building binutils
76
77 - Use the script(1) command to write a log of your build.
78
79 - If you run multiple commands at once (for example: make --jobs=10) then you
80 should also use make option:
81 --output-sync
82 Without --output-sync, the log would be difficult to interpret.
83
84 - Search the log for errors and warnings, for example:
85 configure: WARNING: <package> is missing or unusable; some features
86 may be unavailable.
87 The above message suggests that <package> may be needed on your system.
88
89 - Sometimes the above message is not sufficiently specific to guide you to
90 the right package. In the directory where the failure happens, config.log
91 may identify a specific missing file, and your package manager may allow
92 you to search for it. For example, if build/gprofng/config.log shows that
93 javac is missing, and if your package manager is dnf, you could try:
94 dnf --repo='*' whatprovides '*/javac'
95
96 - You can set a custom destination directory using configure --prefix.
97 This is useful if you prefer not to change /usr/local, or if you are not
98 allowed to do so. If you set a custom prefix, be sure to change all three
99 paths mentioned in the PATH section above.
100