24 Ocak 2021 Pazar

perf komutu

Giriş
Açıklaması şöyle
perf is a powerful Linux profiling tool, refined and upgraded by Linux kernel developers. In addition to common features such as analyzing Performance Monitoring Unit (PMU) hardware events and kernel events, perf has the following subcomponents:

- sched: Analyzes scheduler actions and latencies.
- timechart: Visualizes system behaviors based on the workload.
- c2c: Detects the potential for false sharing. Red Hat once tested the c2c prototype on a number of Linux applications and found many cases of false sharing and cache lines on hotspots.
- trace: Traces system calls with acceptable overheads. It performs only 1.36 times slower with workloads specified in the dd command.
Kurulum
Şöyle yaparız
sudo apt install linux-kernel-tools
perf.conf Dosyası
kernel.perf_event_paranoid Alanı
Açıklaması şöyle
By default, Perf uses an event level of 4 which is fine for any system as it is not too invasive on the host. Therefore, only a minority of all important events can be detected by Perf. We need to get as much information as possible for development purposes by sacrificing security considerations. Consequently, we want to set the ‘perf_event_paranoia’ to -1
Şöyle yaparız
sudo /etc/sysctl.d/perf.conf > kernel.perf_event_paranoid = -1
trace seçeneği
Örnek
200 milisaniyeden daha fazla süren sistem çağrılarını görmek için şöyle yaparız
perf trace --duration 200 

Hiç yorum yok:

Yorum Gönder