Tuesday, February 21, 2017

Fedora 25: The perf linux tool.

If you want a good tool to test your performance under Fedora 25 distro or linux then the perf tool is great.
You can read a full tutorial from perf wiki and that will give a good impression on this utility.
The main problem come when you need to understand why we have to use this utility in linux.Intro
A trivial use the top command will show you the necessary information about your Linux.
If you look closely you will notice that :
load average: 0.09, 0.05, 0.01
The three numbers represent averages over progressively longer periods of time (one, five, and fifteen minute averages).
This means for us: that lower numbers are better and the higher numbers represent a problem or an overloaded machine.
Now about multicore and multiprocessor the rule is simple: the total number of cores is what matters, regardless of how many physical processors those cores are spread across.
Let's use this command:
First I will record some data about my CPU:

You can see the perf tool working with root account and result is owned by deafult user.
Let's show this data using the default user - mythcat and perf tool:[mythcat@localhost ~]$ perf report
The result of this command:
You can use the full list events by using this command:

Let's see one event from this list and that will told us how Fedora working:

[root@localhost mythcat]# perf top -e minor-faults -ns comm

Is use the comm (keys are available: pid, comm, dso, symbol, parent, cpu, socket, srcline,
weight, local_weight) and the -ns args see the manual of perf command.
The result of this command is:
This is most simple way to see how is start and close some pids and how they interact in real-time with the operating system.
Another way to deal with the perf command is how to analyze most scheduler properties from within 'perf sched'
alone using the perf sched with the five sub-commands currently: