Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.13 KB

profiler.rst

File metadata and controls

42 lines (28 loc) · 1.13 KB

Profiler

As the complexity of the application increases, performance issues such as low FPS and frequent cache misses causing lag may arise. LVGL has internally set up some hooks for performance measurement to help developers analyze and locate performance issues.

Porting

To enable profiler, set :cLV_USE_PROFILER in lv_conf.h and configure the following options:

  • :cLV_PROFILER_INCLUDE: Provides a header file for the profiler function.
  • :cLV_PROFILER_BEGIN: Profiler start point function.
  • :cLV_PROFILER_END: Profiler end point function.

Example

The following is an example of output performance measurements using LVGL logging systems:

Configure lv_conf.h:

#define LV_USE_PROFILER 1
#define LV_PROFILER_INCLUDE "lvgl/src/hal/lv_hal_tick.h"
#define LV_PROFILER_BEGIN   uint32_t profiler_start = lv_tick_get()
#define LV_PROFILER_END     LV_LOG_USER("cost %dms", (int)lv_tick_elaps(profiler_start))

Users can add the measured functions themselves:

LV_PROFILER_BEGIN;
my_func();
LV_PROFILER_END;