Difference between revisions of "How to monitor the display framerate"

[unchecked revision] [quality revision]
m
 
m
 




When an animation is running on the display, the related framerate can be monitored from the display driver level thanks to the command:

Board $> (while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &

The display framerate is then periodically output in the user console in "fps" (frames per second):

display 50fps
display 50fps
display 50fps

Notes:

  • Stop monitoring the framerate with the command "kill -9 `ps -o ppid= -C sleep`".
  • Adjust the framerate update period by modifying the "sleep" value (4 seconds in the example).
  • Use the command "dmesg -n8" to mix both user and kernel console outputs.
  • Debugfs configuration needs to be enabled.
<noinclude>

{{ArticleMainWriter | PhilippeC }}
{{ReviewersList | YannickF, HuguesF}}
{{ArticleApprovedVersion | PhilippeC | YannickF, HuguesF | No previous approved version | AlainF - 06Dec'18 - 9899 | 06Dec'18}}

[[Category:How to trace and debug]]
[[Category:DRM /KMS]]</noinclude>


When an animation is running on the display, the related framerate can be monitored from the [[DRM /KMS _overview | display driver]] level thanks to the command:
 {{Board$}} (while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &

The display framerate is then periodically output in the user console in "fps" ('''f'''rames '''p'''er '''s'''econd):<pre>

display 50fps
display 50fps
display 50fps</pre>


Notes:
* Stop monitoring the framerate with the command "kill -9 `ps -o ppid= -C sleep`".
* Adjust the framerate update period by modifying the "sleep" value (4 seconds in the example).
* Use the command "dmesg -n8" to mix both user and kernel console outputs.
* [[Debugfs]] configuration needs to be enabled.
Line 5: Line 5:
   
 
[[Category:How to trace and debug]]
 
[[Category:How to trace and debug]]
[[Category:DRM/KMS]]
+
[[Category:DRM KMS]]
 
</noinclude>
 
</noinclude>
   
When an animation is running on the display, the related framerate can be monitored from the [[DRM/KMS_overview | display driver]] level thanks to the command:
+
When an animation is running on the display, the related framerate can be monitored from the [[DRM KMS overview | display driver]] level thanks to the command:
 
  {{Board$}} (while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &
 
  {{Board$}} (while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &
   

Attachments

Discussions