profiling

Linux perf events profiling in Google Compute Engine not working

雨燕双飞 提交于 2020-06-12 09:07:23
问题 I'm new to using Google Compute Engine. I'd like to use the Linux perf tool to do some various perf events measurements of my application and eventually sample profiling. I've installed the linux perf tool on my Ubuntu 16.04 LTS VM. However even basic events like cycles show up as "not supported". I'm guessing that the underlying KVM hypervisor does not have virtual PMU support enabled, although I believe KVM does support this with a non-default flag setting. Is there any way to get this

`gprof` time spent in particular lines of code

会有一股神秘感。 提交于 2020-06-09 18:00:48
问题 I've been using the gprof profiler in conjunction with g++ . I have a function in my code which encapsulates several sections of behaviour which are related enough to the primary function that it would not make sense to split them off into their own functions. I'd like to know how much time is spent in each of these areas of code. So, if you imagine the code looks like function(){ A A A B B B C C C } where A, B, and C represent particular sections of code I'm interested in, is there a way to

How to modify a C program so that gprof can profile it?

廉价感情. 提交于 2020-05-26 04:57:33
问题 When I run gprof on my C program it says no time accumulated for my program and shows 0 time for all function calls. However it does count the function calls. How do I modify my program so that gprof will be able to count how much time something takes to run? 回答1: Did you specify -pg when compiling? http://sourceware.org/binutils/docs-2.20/gprof/Compiling.html#Compiling Once it is compiled, you run the program and then run gprof on the binary. E.g.: test.c: #include <stdio.h> int main () {

How to modify a C program so that gprof can profile it?

こ雲淡風輕ζ 提交于 2020-05-26 04:55:16
问题 When I run gprof on my C program it says no time accumulated for my program and shows 0 time for all function calls. However it does count the function calls. How do I modify my program so that gprof will be able to count how much time something takes to run? 回答1: Did you specify -pg when compiling? http://sourceware.org/binutils/docs-2.20/gprof/Compiling.html#Compiling Once it is compiled, you run the program and then run gprof on the binary. E.g.: test.c: #include <stdio.h> int main () {

Does OpenJDK 1.8 support JFR?

≡放荡痞女 提交于 2020-05-15 01:14:02
问题 I'm not sure if OpenJDK 1.8 supports JFR (java flight recorder). I know it was requested on the OpenJDK bugs forum. Using OpenJDK on Linux and executing the following from a terminal: jcmd `<pid>` JFR.start returns java.lang.IllegalArgumentException: Unknown diagnostic command 回答1: The OpenJDK 8 source code does not include the Java Flight Recorder implementation. That feature has been targeted to become part of OpenJDK source code with JDK 11, per http://openjdk.java.net/projects/jdk/11/ .

Does OpenJDK 1.8 support JFR?

自古美人都是妖i 提交于 2020-05-15 01:13:51
问题 I'm not sure if OpenJDK 1.8 supports JFR (java flight recorder). I know it was requested on the OpenJDK bugs forum. Using OpenJDK on Linux and executing the following from a terminal: jcmd `<pid>` JFR.start returns java.lang.IllegalArgumentException: Unknown diagnostic command 回答1: The OpenJDK 8 source code does not include the Java Flight Recorder implementation. That feature has been targeted to become part of OpenJDK source code with JDK 11, per http://openjdk.java.net/projects/jdk/11/ .

saving cProfile results to readable external file

╄→гoц情女王★ 提交于 2020-05-12 15:43:54
问题 I am using cProfile try to profile my codes: pr = cProfile.Profile() pr.enable() my_func() # the code I want to profile pr.disable() pr.print_stats() However, the results are too long and cannot be fully displayed in the Spyder terminal (the function calls which take the longest time to run cannot be seen...). I also tried saving the results using cProfile.run('my_func()','profile_results') but the output file is not in human readable format (tried with and without .txt suffix). So my

Alternatives to gprof [closed]

我们两清 提交于 2020-04-22 08:50:54
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What other programs do the same thing as gprof? 回答1: Valgrind has an instruction-count profiler with a very nice visualizer called

Alternatives to gprof [closed]

北城以北 提交于 2020-04-22 08:47:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What other programs do the same thing as gprof? 回答1: Valgrind has an instruction-count profiler with a very nice visualizer called

How to use google perf tools

隐身守侯 提交于 2020-03-17 05:21:07
问题 I just started using google performance tools ( google-perftools and libgoogle-perftools4 packages in ubuntu), I swear that I'm googling for around a day and I didn't find an answer!! The problem is that I do not get the result for ALL of my functions with CPU profiling. This is my code: #include "gperftools/profiler.h" #include <iostream> #include <math.h> using namespace std; void bar() { int a,b,c,d,j,k; a=0; int z=0; b = 1000; while(z < b) { while (a < b) { d = sin(a); c = cos(a); j = tan