How To Profile QML App on Embedded Device

From Qt Wiki
Revision as of 15:47, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to profile QML app on embedded device

Information on profiling QML app is scattered in places so I thought of putting it together in one place.

Prerequisite

NOTE: Assumption is that Linux PC is used as development environment

  • Qt for host PC is installed. This is required to launch QtCreator
  • Make sure that option “-no-declarative-debug” was NOT specified when configuring Qt for target device
  • if Qt for target was configured with -prefix <installation-path> then make sure that same installation path exists on target
    e.g. -prefix /usr/local/qt-48x-emb is specified then copy contents of /usr/local/qt-48x-emb from host to target at /usr/local/qt-48x-emb
  • Make sure Qt for target was built using same toolchain that will be used to build the app
  • Host PC (which will be running QtCreator) and target should be on same network
    NOTE:

Profiling

At high level, to profile a QML app one will require to carry out following steps,

  1. Build the QML app to be profiled for target device
  2. Launch QML Profiler (external) from QtCreator on host
  3. Launch QML app on target with commandline options to enable remote profiling

Steps for building app

  1. Make sure that following options are added to the application’s .pro file
  2. Ensure QTDIR refers to the installation path of QT for target as specified in -prefix
  3. Ensure PATH contains path of bin folder from installation path of Qt for target
  4. Generate make file using the .pro
  5. Build the app
  6. Transfer the app binaries and necessary app files to the target

Launch QML Profiler (external) on host

  1. Launch QtCreator on host PC
  2. From the menu bar in QtCreator, select menu item Analyze -> QML Profiler (External); this will popup a small dialog
  3. Note the port value. It will be passed on as command line option when launching the app
  4. Detail instructions on profiling and interpreting the results can be found here [qt.io]
  5. Hit the OK button after you launch the app on target

Launch the app to be profiled on the target

  1. Start the app on the target as,
  • Port value shall be same as that in the QML Profiler (External) Dialog
  • the app is run against eglfs platform plugin but it could run against any other platform plugin if that is tested to be run on the target.

Troubleshooting

Qt libraries not found

  • Make sure Qt libraries are copied on the target
  • export LD_LIBRARY_PATH to refer to the path where Qt libraries are copied

Remote debugger plugin NOT found

  • Confirm if following libraries were built for target,
  • On target, these libraries should be present in /usr/local/qt-48x-emb/plugins/qmltooling
  • export LD_LIBRARY_PATH to refer to the path where Qt plugin libraries are copied

Cannot capture the logs on host in QML profiler

  • Make sure you synchronize launching of the app on target and starting the profiling on host PC.
  • This could be achieved by adding some piece of code that starts the app on target after few seconds or on key press.

Categories: