From 209fcdad91f4d18b87e19787a6c6919fc4c2c191 Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Fri, 20 Oct 2017 23:14:29 +0530 Subject: [PATCH 1/3] perf: add page (#1556) --- pages/linux/perf.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/linux/perf.md diff --git a/pages/linux/perf.md b/pages/linux/perf.md new file mode 100644 index 000000000..02b44e31e --- /dev/null +++ b/pages/linux/perf.md @@ -0,0 +1,19 @@ +# perf + +> Framework for linux performance counter measurements. + +- Gather basic performance counter stats for a command: + +`perf stat {{command}}` + +- Display system-wide real time performance counter profile: + +`sudo perf top` + +- Run a command and record its profile into perf.data: + +`sudo perf record {{command}}` + +- Read perf.data (created by perf record) and display the profile: + +`sudo perf report` From 84bcef29a17d817f7a4f14cbd3ee1447ff702a8f Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Sat, 21 Oct 2017 16:07:00 +0530 Subject: [PATCH 2/3] perf: resolve review comments --- pages/linux/perf.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/linux/perf.md b/pages/linux/perf.md index 02b44e31e..7a4ef194c 100644 --- a/pages/linux/perf.md +++ b/pages/linux/perf.md @@ -2,18 +2,18 @@ > Framework for linux performance counter measurements. -- Gather basic performance counter stats for a command: +- Display basic performance counter stats for a command `gcc -c -O3 hello.c`: -`perf stat {{command}}` +`perf stat {{gcc -c -O3 hello.c}}` - Display system-wide real time performance counter profile: `sudo perf top` -- Run a command and record its profile into perf.data: +- Run a command and record its profile into "perf.data": `sudo perf record {{command}}` -- Read perf.data (created by perf record) and display the profile: +- Read "perf.data" (created by `perf record`) and display the profile: `sudo perf report` From 741fcf1b5821d694868586051630fe2582675bb0 Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Sat, 21 Oct 2017 18:35:17 +0530 Subject: [PATCH 3/3] perf: make the example simpler --- pages/linux/perf.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/linux/perf.md b/pages/linux/perf.md index 7a4ef194c..4ea729365 100644 --- a/pages/linux/perf.md +++ b/pages/linux/perf.md @@ -2,9 +2,9 @@ > Framework for linux performance counter measurements. -- Display basic performance counter stats for a command `gcc -c -O3 hello.c`: +- Display basic performance counter stats for a command: -`perf stat {{gcc -c -O3 hello.c}}` +`perf stat {{gcc hello.c}}` - Display system-wide real time performance counter profile: