perf

ubuntu 12.10 perf stat <not supported> cycles

旧时模样 提交于 2019-12-04 09:37:39
问题 The system I use is ubuntu-12.10-desktop-amd64 I install perf through apt-get install linux-tools linux-tools-common linux-tools-3.5.0-40 when I use perf list , it list all the events as expected. But when I use perf stat , the result seems abnormal perf stat ls the result is: Performance counter stats for 'ls': 3.988508 task-clock # 0.678 CPUs utilized 172 context-switches # 0.043 M/sec 0 CPU-migrations # 0.000 K/sec 276 page-faults # 0.069 M/sec <not supported> cycles <not supported>

Event-based sampling with the perf userland tool and PEBS

为君一笑 提交于 2019-12-04 09:35:32
I'm doing event-based sampling with the perf userland tool: the objective being trying to find out where certain performance-impacting events like branch misses and cache misses are occurring on a larger system I'm working on. Now, something like perf record -a -e branch-misses:pp -- sleep 5 works perfectly: the PEBS counting mode trigerred by the 'pp' modifier is really accurate when collecting the IP in the samples. Unfortunately, when I try to do the same for cache-misses, i.e. perf record -a -e cache-misses:pp -- sleep 5 # [1] I get Error: sys_perf_event_open() syscall returned with 22

Is there a way to set kptr_restrict to 0?

☆樱花仙子☆ 提交于 2019-12-04 09:08:38
问题 I am currently having trouble running linux perf, mostly because /proc/sys/kernel/kptr_restrict is currently set to 1. However, if I try to /proc/sys/kernel/kptr_restrict by echoing 0 to it as follows... echo 0 > /proc/sys/kernel/kptr_restrict I get a permission denied error. I don't think I can change permissions on it either. Is there a way to set this directly somehow? I am super user. I don't think perf will function acceptably without this being set. 回答1: In your example, echo is running

perf cannot find external module symbols

谁说我不能喝 提交于 2019-12-04 08:25:32
When running perf it finds the kernel symbols and symbols of my program but it does not find external module symbols. I have written a kernel module which I load using insmod how can I tell perf to find its symbols as well? I am running a 2.6.37.6 kernel (can't upgrade), my perf does not yet support the dwarf option but I think its a symbol issue. I have compiled everything with -g -fno-omit-frame-pointer I had to make it a kernel module, then perf could find its symbols: IN_TREE_DIR=/lib/modules/`uname -r`/kernel/modulename mkdir -p $IN_TREE_DIR cp modulename.ko $IN_TREE_DIR depmod -a 来源:

is it possible to run linux perf tool inside docker container

大兔子大兔子 提交于 2019-12-04 07:37:38
I tried giving the below command from container and found the below issue, may be because of "-moby" kernel version. Can't we get a docker image without word "-moby" coming in linux kernel version. I tried installing linux perf tool on VM having ubuntu and it worked. #docker run -t -i ubuntu:14.04 /bin/bash root@214daea94f4f:/# perf WARNING: perf not found for kernel 4.9.41 You may need to install the following packages for this specific kernel: linux-tools-4.9.41-moby linux-cloud-tools-4.9.41-moby You may also want to install one of the following packages to keep up to date: linux-tools-moby

perf.data file has no samples

青春壹個敷衍的年華 提交于 2019-12-04 02:29:04
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. 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 ) won't work. Try running with -e cpu-clock . According to that thread, the OP had the same problem also in a

https://pingcap.com/blog-cn/flame-graph/

和自甴很熟 提交于 2019-12-04 01:22:34
https://pingcap.com/blog-cn/flame-graph/ 因为 TiKV 是自己内部使用了 jemalloc,并没有用系统的 malloc,所以我们不能直接用 perf 来探查系统的 malloc 函数。幸运的是,perf 能支持动态添加探针,我们将 TiKV 的 malloc 加入: perf probe -x /deploy/bin/tikv-server -a malloc 来源: https://www.cnblogs.com/yuanjiangw/p/11826771.html

Can I get the python call stack with the linux perf?

自作多情 提交于 2019-12-03 22:11:05
For example, def test(): print "test" I used perf record -g -p $pid , but the result was just all about PyEval_EvalFrameEx . How can I get the real name "test" or if can not by using perf? As of 2018, perf simply doesn't have support for reading the Python stack frames (cf. a 2014 Python mailinglist discussion ). Python 3.6 has some support for Dtrace and Systemtap . An alternative to this is Pyflame, a stochastic profiler for Python that samples python call stacks via ptrace() . In contrast to Dtrace/Systemtap you don't need extra permissions and it also works with Python versions that are

how to change perf_event_open max sample rate

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 21:23:47
问题 I'm using perf_event_open to get samples. I try to get everyone hit of point. But perf_event_open is not fast enough. I try to change the sample rate using below command: echo 10000000 > /proc/sys/kernel/perf_event_max_sample_rate But it looks like the value I set was too large. After running my code, perf_event_max_sample_rate is change back to a lower value such as 12500. And when I try to change bigger value,for example 20000000,50000000 and so on, the sample speed is not increased as

Using perf probe to monitor performance stats during a particular function

百般思念 提交于 2019-12-03 21:22:04
问题 I'm trying to monitor performance stats during a particular function using linux perf tool. I was following the instructions given at https://perf.wiki.kernel.org/index.php/Jolsa_Features_Togle_Event#Example_-_using_u.28ret.29probes I tried to get instruction count of a simple C program. (As shown below) 1) My simple C code #include<stdio.h> int sum=0; int i=0; void func(void) { for(i=0;i<100;i++) { sum=sum+i; } } int main(void) { func(); return 0; } 2) Compiling and adding probes root