User Tools

Site Tools


realtime:documentation:howto:tools:hwlat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
realtime:documentation:howto:tools:hwlat [2018/07/11 14:55]
ebugden Add description of hwlat tool
realtime:documentation:howto:tools:hwlat [2018/07/26 13:38]
ebugden Tracing is already enabled on boot
Line 1: Line 1:
 ====== Ftrace - hwlat tracer ====== ====== Ftrace - hwlat tracer ======
  
-hwlat is an Ftrace tracer designed to detect latencies caused by a system'​s firmware or hardware. The tracer was originally intended for detecting SMIs, but it can detect other low level latencies as well. More details about this tracer can be found in the kernel documentation for Ftrace and for the hardware latency detector.+hwlat is an Ftrace tracer designed to detect latencies caused by a system'​s firmware or hardware. The tracer was originally intended for [[realtime:​documentation:​howto:​debugging:​smi-latency:​start|detecting SMIs]], but it can detect other low level latencies as well. More details about this tracer can be found in the kernel documentation for Ftrace and for the hardware latency detector.
  
 ===== Setup ===== ===== Setup =====
Line 25: Line 25:
 ===== Tracing ===== ===== Tracing =====
  
-If the tracer is available, hwlat can be activated manually via tracefs in the same way as any other Ftrace tracer. The following ​few commands ​are written as if they are being run from the root of tracefs (the tracing folder). The '#'​ symbol is used to indicate that the commands must be run as root or with sudo. Here is an example of how to select the hwlat tracer:+If the tracer is available, hwlat can be activated manually via tracefs in the same way as any other Ftrace tracer. The '​[tracing]'​ before the following commands ​is to indicate that they are being run from the root of tracefs (the tracing folder). The '#'​ symbol is used to indicate that the commands must be run as root or with sudo. Here is an example of how to select the hwlat tracer:
  
 <​code>​ <​code>​
Line 31: Line 31:
 </​code>​ </​code>​
  
-If this is the first time that the user selects ​a tracer ​using the current_tracer file since the system was booted, then tracing will automatically be enabled afterwords. Tracing can also be enabled by writing 1 to the tracing_on file or disabled by writing a 0 to the tracing_on file. The files current_tracer and tracing_on can be read to verify that the tracer was selected correctly and that tracing is enabled.+By default, tracing ​is already enabled when the system starts. So, if the user has not disabled tracing since booting they just need to select ​a tracer ​(other than "​nop"​) to start collecting data. Tracing can also be enabled by writing 1 to the tracing_on file or disabled by writing a 0 to the tracing_on file. The files current_tracer and tracing_on can be read to verify that the tracer was selected correctly and that tracing is enabled.
  
 Before consulting the trace results for analysis, make sure that only one instance of hwlat is running. The program //top// can be used for this. If more than one instance is running, restart the system, and trace the latencies again with only one instance of hwlat. Before consulting the trace results for analysis, make sure that only one instance of hwlat is running. The program //top// can be used for this. If more than one instance is running, restart the system, and trace the latencies again with only one instance of hwlat.
  
-<WRAP center round alert 60%>+<WRAP center round important ​60%>
 **Bug:** Do not write 1 to the tracing_on file when tracing is already enabled. This will start another instance of hwlat. **Bug:** Do not write 1 to the tracing_on file when tracing is already enabled. This will start another instance of hwlat.
 </​WRAP>​ </​WRAP>​
Line 49: Line 49:
 </​code>​ </​code>​
  
-If another trace is to be taken, the previous ​trace results can be cleared by selecting ​the nop tracer:+If another trace is to be taken, the previous results can be cleared by writing into the trace file:
  
 <​code>​ <​code>​
-[tracing]# echo nop current_tracer+[tracing]# echo > trace
 </​code> ​ </​code> ​
  
Line 58: Line 58:
  
 The kernel documentation for Ftrace and for the hardware latency detector contain details about how to interpret the resulting traces. The kernel documentation for Ftrace and for the hardware latency detector contain details about how to interpret the resulting traces.
 +
 +<WRAP center round todo 60%>
 +Explain how to read the results because the kernel documentation is confusing and/or improve kernel documentation?​
 +</​WRAP>​
 +
realtime/documentation/howto/tools/hwlat.txt ยท Last modified: 2018/08/24 09:48 by ebugden