Measuring CPU Utilization in Linux
This topic describes two methods, the ftrace
and top
tools, for measuring CPU utilization of workloads that run in NVIDIA DRIVE® OS Linux.
Guidelines
These are the guidelines:
- Workload should be executed for a minimum of 60 seconds when you collect utilization data.
- It is important to collect idle system utilization for the duration of
experiment and use it as a baseline for comparison.
- Total idle utilization should be subtracted from the workload utilization for precise results.
- For runtime CPU utilization measurements, begin the trace collection/measurement tool after the initialization is complete and stop the tracing before the application has exited.
Tool Comparison
This table summarizes the benefits and drawbacks of each method based on the tool used.
Tool | Benefits | Drawbacks |
---|---|---|
ftrace (Recommended) |
|
|
top |
|
|
Note: You can also consider the
mpstat
and
tegrastats
tools; however, both tools provide processor-level
reports, which are not useful for fine-grained, thread-level utilization.