perf

linux perf record: difference between count (-c) and frequency (-F) options

杀马特。学长 韩版系。学妹 提交于 2020-08-07 09:14:12
问题 I'm trying to understand what the -c and -F options of perf record really do but I cannot explain what I'm seeing. I'm running these commands: perf record -a -F <frequency> sleep 1 and perf record -a -c <count> sleep 1 trying different values of frequency and count . The results I get are the following In the first table I set the frequency and in the second one the count. How do frequency and count affect the number of events? I thought the number of events was independent on the frequency

Can perf-stat results be generated from a perf.data file?

痞子三分冷 提交于 2020-08-02 07:20:14
问题 When I want to generate performance reports using perf-stat and perf-report from the Linux tool suite perf, I run: $ perf record -o my.perf.data myCmd $ perf report -i my.perf.data And: $ perf stat myCmd But that means I run 'myCmd' a second time, which takes several minutes. Instead, I was hoping for: $ perf stat -i my.perf.data But unlike most of the tools in the perf suite, I don't see a -i option for perf-stat. Is there another tool for this, or a way to get perf-report to generate

Can perf-stat results be generated from a perf.data file?

只谈情不闲聊 提交于 2020-08-02 07:19:45
问题 When I want to generate performance reports using perf-stat and perf-report from the Linux tool suite perf, I run: $ perf record -o my.perf.data myCmd $ perf report -i my.perf.data And: $ perf stat myCmd But that means I run 'myCmd' a second time, which takes several minutes. Instead, I was hoping for: $ perf stat -i my.perf.data But unlike most of the tools in the perf suite, I don't see a -i option for perf-stat. Is there another tool for this, or a way to get perf-report to generate

Can perf-stat results be generated from a perf.data file?

孤人 提交于 2020-08-02 07:19:44
问题 When I want to generate performance reports using perf-stat and perf-report from the Linux tool suite perf, I run: $ perf record -o my.perf.data myCmd $ perf report -i my.perf.data And: $ perf stat myCmd But that means I run 'myCmd' a second time, which takes several minutes. Instead, I was hoping for: $ perf stat -i my.perf.data But unlike most of the tools in the perf suite, I don't see a -i option for perf-stat. Is there another tool for this, or a way to get perf-report to generate

Using perf to monitor raw event counters

走远了吗. 提交于 2020-07-17 06:48:54
问题 I am trying to measure certain hardware events on a (Intel Xeon) machine with multiple (physical) processors. Specifically, I wish to know how many requests are issued for reading 'offcore' data. I found the OFFCORE_REQUESTS hardware event in Intels documentation and it gives the event descriptor 0xB0 and for data demands, the additional mask 0x01. Would it then be correct to tell perf to record the event 0xB1 (i.e. 0xB0 | 0x01 ) and to call it as: perf record -e r0B1 ./mytestapp someargs Or

PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE concurrent monitoring

只谈情不闲聊 提交于 2020-06-14 06:57:32
问题 I'm working on a custom implementation on top of perf_event_open syscall. The implementation aims to support various of PERF_TYPE_HARDWARE , PERF_TYPE_SOFTWARE and PERF_TYPE_HW_CACHE events for specific threads on any core . In Intel® 64 and IA-32 Architectures Software Developer’s Manual vol 3B I see the following for my testing CPU (Kaby Lake): To my understanding so far, one can monitor (theoretically) unlimited PERF_TYPE_SOFTWARE events concurrently but limited (without multiplexing) PERF

PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE concurrent monitoring

梦想的初衷 提交于 2020-06-14 06:57:00
问题 I'm working on a custom implementation on top of perf_event_open syscall. The implementation aims to support various of PERF_TYPE_HARDWARE , PERF_TYPE_SOFTWARE and PERF_TYPE_HW_CACHE events for specific threads on any core . In Intel® 64 and IA-32 Architectures Software Developer’s Manual vol 3B I see the following for my testing CPU (Kaby Lake): To my understanding so far, one can monitor (theoretically) unlimited PERF_TYPE_SOFTWARE events concurrently but limited (without multiplexing) PERF

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

perf_event_open Overflow Signal

怎甘沉沦 提交于 2020-05-24 16:10:55
问题 I want to count the (more or less) exact amount of instructions for some piece of code. Additionally, I want to receive a Signal after a specific amount of instructions passed. For this purpose, I use the overflow signal behaviour provided by perf_event_open. I'm using the second way the manpage proposes to achieve overflow signals: Signal overflow Events can be set to deliver a signal when a threshold is crossed. The signal handler is set up using the poll(2), select(2), epoll(2) and fcntl(2

How to let perf stat support hardware event like “branches”, “branch-misses” in KVM

一个人想着一个人 提交于 2020-05-09 07:32:07
问题 I want to evaluate the performance of one process by "branch-misses" hardware event. But when I used perf stat to get "branch-misses" data, it always return 0 just because my os is in KVM. Because it's trouble for me to get one real machine to do the test. So I want to know that is there any method to get "branch-misses" by "perf stat" when I am in KVM. I'm really need your help. Thanks a lot. 来源: https://stackoverflow.com/questions/60810494/how-to-let-perf-stat-support-hardware-event-like