Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabienarcellier/perfug-deep-into-your-application
Start to profile any applications on your linux system that you being either dev or ops
https://github.com/fabienarcellier/perfug-deep-into-your-application
Last synced: 25 days ago
JSON representation
Start to profile any applications on your linux system that you being either dev or ops
- Host: GitHub
- URL: https://github.com/fabienarcellier/perfug-deep-into-your-application
- Owner: FabienArcellier
- Created: 2015-09-19T09:50:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-10T09:22:58.000Z (about 9 years ago)
- Last Synced: 2023-03-10T21:48:01.999Z (almost 2 years ago)
- Language: CSS
- Homepage: http://fabienarcellier.github.io/Perfug-Deep-into-your-application
- Size: 3.17 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Introduction
=============Codes & slides for the presentation done to the 24th performance user group
at Paris the 17/09/2015.# [Slides](http://fabienarcellier.github.io/Perfug-Deep-into-your-application/slides/index.html)
I recommand looking at the [presentation](http://fabienarcellier.github.io/Perfug-Deep-into-your-application/slides/index.html) first before playing with commands
below.[Link to the website](http://fabienarcellier.github.io/Perfug-Deep-into-your-application)
Notes
=====Example - Calculus on simple matrix
------------------------------------cd src/02-matrix
make build
time valgrind --tool=callgrind --simulate-cache=yes --dump-instr=yes --collect-jumps=yes ./app 100 100Look at symbol table
--------------------cd src/00-empty
make build
readelf -s ./app;
readelf -s /lib/x86_64-linux-gnu/libc.so.6 | grep malloc# Strip effect on the symbol table
strip ./app
readelf -s ./app;Profiling Callgrind
---------------------cd src/02-matrix
make build# Profiling with callgrind for 100 * 100 matrix
time valgrind --tool=callgrind --simulate-cache=yes --dump-instr=yes --collect-jumps=yes ./app 100 100# Perf impact of callgrind
time ./app 100 100Thread dump on Native application - Gstack
--------------------------------------------cd ~/sources/memcached
sudo -s
Bash function to generate thread dump for native application as you
can do with jstackgstack() {
tmp=$(tempfile)
echo thread apply all bt >"$tmp"
gdb -batch -nx -q -x "$tmp" -p "$1"
rm -f "$tmp"
}Use it
./memcached &
while sleep 1; do gstack @pid@ ; done
Perf - Some commands
---------------------Get a list of avaible counters.
perf list
Get an overview of counters for an application
perf stat ./app
Perf - Impact on performance
-----------------------------time ./app 500 500
time perf record -g ./app 500 500Memcached - Symbol table
--------------------------cd ~/sources/memcached
readelf -s ./memcachedGenerate flamegraph from gdb stacktraces
------------------------------------------cd ~/sources/memcached
./memcached &php src/03-memcache-php/memcache-set.php
while sleep 0.1; do gstack 8748; done > stack.txt
cat stack.txt | stackcollapse-gdb.pl | flamegraph.pl > gdb_graph.svgMEMCACHE - PROFILING WITH PERF
-------------------------------cd ~/sources/memcached
perf record -g ./memcached
php src/03-memcache-php/memcache-set.php
perf reportWarning to /proc/sys/kernel/kptr_restrict
MEMCACHED - PROFILING CPU CYCLE WITH PERF - WITH KERNEL STACKTRACE
-------------------------------------------------------------------./memcached &
sudo perf record -a -g -p @pid@php src/03-memcache-php/memcache-set.php
perf report