README 3.9 KB

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