1 / 7

Quick Updates - Profiling

Quick Updates - Profiling. Hprof ( java ) Adventures in gprof. Hprof. To get options as well as if its there: Java –Xrunhprof:help. Hprof – how to run. Java –Xrunhprof:cpu=samples execfilename < input file > output file

trudy
Download Presentation

Quick Updates - Profiling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quick Updates - Profiling Hprof ( java ) Adventures in gprof

  2. Hprof • To get options as well as if its there: Java –Xrunhprof:help

  3. Hprof – how to run Java –Xrunhprof:cpu=samples execfilename < input file > output file Profiling output turns up in a textedit form in a file called java.hprof.txt Bottom of file looks like this: Command used: javac -J-agentlib:hprof=cpu=samples Hello.java CPU SAMPLES BEGIN (total = 126) Fri Oct 22 12:12:14 2004 rank self accum count trace method 1 53.17% 53.17% 67 300027 java.util.zip.ZipFile.getEntry 2 17.46% 70.63% 22 300135 java.util.zip.ZipFile.getNextEntry 3 5.56% 76.19% 7 300111 java.lang.ClassLoader.defineClass2 4 3.97% 80.16% 5 300140 java.io.UnixFileSystem.list 5 2.38% 82.54% 3 300149 java.lang.Shutdown.halt0 6 1.59% 84.13% 2 300136 java.util.zip.ZipEntry.initFields 7 1.59% 85.71% 2 300138 java.lang.String.substring 8 1.59% 87.30% 2 300026 java.util.zip.ZipFile.open 9 0.79% 88.10% 1 300118 com.sun.tools.javac.code.Type$ErrorType.<init> 10 0.79% 88.89% 1 300134 java.util.zip.ZipFile.ensureOpen

  4. Hprof – Questions? • Source: Beginning Algorithms by Harris and Ross Isbn 139780764596742

  5. Quick Updates: gprof • Modify the makefile • CXXFLAGS entry was –ggdb • Now is –ggdb –pg • Then compile and run code…..

  6. gprof • Then run code…. Lcs –F test3 • And in the directory you will find: Gmon.out

  7. gprof • But how to view? gprof –b lcs gmon.out Mine was 8 pages in length double sided.

More Related