profiling

perf.data file has no samples

不羁岁月 提交于 2019-12-21 07:28:24
问题 I am using perf 3.0.4 on ubuntu 11.10. Its record command works well and displays on terminal 256 samples collected. But when I make use of perf report , it gives me the following error: perf.data file has no samples I searched a lot for the solution but no success yet. 回答1: This thread has some useful information: http://www.spinics.net/lists/linux-perf-users/msg01436.html It seems that if you are running in a VM that does not expose the PMU to the guest, the default collection ( -e cycles )

gprof produces empty output

时间秒杀一切 提交于 2019-12-21 06:54:01
问题 I'm running Ubuntu 16.10 and trying to profile a program using gprof. I compile with the flag -pg and the program is single-threaded. The actual compile commands are: g++ -I. -std=c++11 -Wall -Wextra -O3 -pg -fPIC -Wno-unused-parameter -c -o build/obj/performance/stencil_application.o test/performance/stencil_application.cpp g++ -I. -std=c++11 -Wall -Wextra -O3 -pg -Wno-unused-parameter build/obj/performance/stencil_application.o -o build/test/performance/stencil_application The program takes

gprof produces empty output

本秂侑毒 提交于 2019-12-21 06:53:07
问题 I'm running Ubuntu 16.10 and trying to profile a program using gprof. I compile with the flag -pg and the program is single-threaded. The actual compile commands are: g++ -I. -std=c++11 -Wall -Wextra -O3 -pg -fPIC -Wno-unused-parameter -c -o build/obj/performance/stencil_application.o test/performance/stencil_application.cpp g++ -I. -std=c++11 -Wall -Wextra -O3 -pg -Wno-unused-parameter build/obj/performance/stencil_application.o -o build/test/performance/stencil_application The program takes

C++ - detect out-of-range access

大兔子大兔子 提交于 2019-12-21 06:07:49
问题 I would like to analyse my C++ code to find bad access in vectors and arrays (out of range access), is there a tool for that ? thanks in advance 回答1: You can compile with _GLIBCXX_DEBUG and _GLIBXX_DEBUG_PEDANTIC defined if your are using gcc. This will enable glibc assertions to be raised if out of bounds access is requested. Testing with valgrind::memcheck will also reveal bad memory reads 回答2: Yes: Valgrind. And many others: http://en.wikipedia.org/wiki/Memory_debugger. Note also that most

Custom prolog/epilog functions for profiling

隐身守侯 提交于 2019-12-21 05:45:12
问题 Is it possible, with Visual Studio compilers, to write 2 functions that get called before calling into other functions and after the functions have executed? In gcc you could do that with __cyg_profile_func_*() functions: void __cyg_profile_func_enter(void *func_address, void *call_site ) __attribute__ ((no_instrument_function)); void __cyg_profile_func_exit (void *func_address, void *call_site ) __attribute__ ((no_instrument_function)); I need a solution that works for kernel mode software.

Obtaining global roots from .NET programs

喜你入骨 提交于 2019-12-21 05:32:11
问题 I recently started using the ANTS profiling tools for production work. Aside from being amazed by their awesomeness, I couldn't help but wonder how they work. For example, one of the most useful features lets you visualize the global roots of a running program complete with the number of references to values of different types. How does this tool get hold of that information? 回答1: (Full disclosure: I'm on the Visual Studio Profiler team, but the below information is public) You can do this by

Why is garbage collector not doing a more aggressive garbage collection sooner than single digit heap free %?

痴心易碎 提交于 2019-12-21 05:31:12
问题 These are my Sun Hotspot 1.6 JVM heap settings in WebLogic 11g: -Xms10g -Xmx10g -XX:MaxPermSize=256m -XX:+UseParNewGC -XX:ParallelGCThreads=2 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:ConcGCThreads=2 What I'm seeing in the JVM heap free % graph for 24 hours is basically heap free % goes down at a slow rate until we hit about 9% (takes about 24 hours). Then the system is running what looks like a full gc and gets back to 97%. Is there some setting I should add/modify that will

Code Profiling in Visual Studio 2005

非 Y 不嫁゛ 提交于 2019-12-21 05:09:52
问题 I have a Visual Studio 2005 Solution workspace which in turn has 8 projects included in it. I want to profile the complete code(all the projects) and get some measure about the absolute cycles taken by each function to execute, or at least percentage cycle consumptions. I checked out help for VS 2005, and also the project setiings options but could not find any pointers on hwo to get the profile info. Any help regarding this would be beneficial. -AD. 回答1: If your application is not

Hotspot in a for loop

扶醉桌前 提交于 2019-12-21 04:56:09
问题 I am trying to optimize this code. static lvh_distance levenshtein_distance( const std::string & s1, const std::string & s2 ) { const size_t len1 = s1.size(), len2 = s2.size(); std::vector<unsigned int> col( len2+1 ), prevCol( len2+1 ); const size_t prevColSize = prevCol.size(); for( unsigned int i = 0; i < prevColSize; i++ ) prevCol[i] = i; for( unsigned int i = 0, j; i < len1; ++i ) { col[0] = i+1; const char s1i = s1[i]; for( j = 0; j < len2; ++j ) { const auto minPrev = 1 + std::min( col

how to perform profiling for a website?

萝らか妹 提交于 2019-12-21 04:46:19
问题 I currently have a django site, and it's kind of slow, so I want to understand what's going on. How can I profile it so to differentiate between: effect of the network effect of the hosting I'm using effect of the javascript effect of the server side execution (python code) and sql access. any other effect I am not considering due to the massive headache I happen to have tonight. Of course, for some of them I can use firebug, but some effects are correlated (e.g. javascript could appear slow