Embedded system product development often encounter performance bottlenecks, then need to use external forces, that is, a variety of tools to find out the problem point and timely solution. Some of the tools provided by the system are listed below:
1. Top
One of the most common tools for individuals. The top command displays the actual process activity state, which collects the most CPU-intensive process information and outputs it by default within 5 seconds. The default refresh time can be changed by the-D parameter, as
Top-d1
Refreshes the list once every 1 seconds. Top has more than one shortcut key after execution, the following are important:
H: Show Thread state
R: Execute renice command to adjust process priority
K: Kill the specified process by executing the KILL command
2. Vmstat
Vmstat provides status of process state, memory usage, paging, block I/O, and CPU activity, Vmstat can provide average or real-time sampling of each data. Vmstat after the number, which means that data is refreshed every n seconds.
3. PS & Pstree
One of the most common tools of the individual, but also one of the most basic commands of system analysis. PS Lists the processes that exist in the system and, unlike top, PS lists more detailed information. On a system running Java, because the amount of data is too large, the output of the PS command is easily overwritten, so you can use the Pstree command to output process and subprocess information in a tree shape.
4. Free
Common tools that list system memory usage. Unfortunately, free list is the total, can not truly reflect the use of memory, for memory fragmentation and other information, is not available. To get this fragmentation information, you can
$cat/proc/buddyinfo, the real usage of system memory is judged by the output of buddy Distributor.
5. Iostat
Used to count the average CPU usage time and disk system performance data. The parameter-k-m allows you to specify whether the unit of measurement for disk IO is KB or MB, followed by a number indicating the Iostat refresh interval.
6. Mpstat
CPU State Statistics tool for multi-core systems.
7. Pmap
View memory usage information, so loading information, and so on for the specified (-D <pid>) process.
8. Netstat
Network Information
9. Tcpdump/ethereal
Network grab bag and analysis tools, commonly used, but more parameters, do not elaborate.
Strace
One of the most common tools for personal use, check the best tools for system calls. It used to be half a day to find out what others had been doing for a few months. There are several parameters that are more useful:
-O: Output to File
-r: Output The relative time span between each system call, note that the time per line is the last time the system call was executed by the system call, not the one that the call took
-p:attach to the process that specifies the PID.
Here, each command has a large number of parameters and various instructions, you can see manual or online to check.