[libcamera-devel] [PATCH v4 0/5] Tracing

Paul Elder paul.elder at ideasonboard.com
Fri Oct 30 09:57:51 CET 2020


Implement tracing in libcamera. Add tracepoints to Request. Also add a
pair of tracepoints for measuring time taken for IPA calls.

Add a script to show how one can analyze traces programatically. The
script gathers statistics on time taken for IPA calls.

Add tracing documentation.

Since this series is intended to be merged before IPC, but the raspberry
pi tracepoint emission for measure IPA call time depends on the IPC
series, that patch has been broken off (v4).

Changes in v4:
- rebase on master instead of IPC
- move enum tp definitions to their own files
  - they need to be concated and won't work with #include with include
    guards
- broke out the raspeberry pi tracepoint emission to separate patch,
  intended to be merged after IPC (I'll probably just append it to the
  IPC series)
- cosmetic changes

Changes in v3:
- add macros LIBCAMERA_TRACEPOINT_IPA_{BEGIN,END} for convenience for
  tracing IPA calls
  - this macro also makes it so that we can pass the pipeline and
    function name as symbols and not strings
- add enum tracepoint values so we get nice enum strings in the trace
  output, instead of just ints
- add pointer addresses to tracepoint fields so we can get addresses of
  objects in the trace output
- upgrade the Request tracepoints
- fix passing const strings into tracepoints without the need to cast
- expand and fix documentation


Paul Elder (5):
  libcamera: tracing: Implement tracing infrastructure
  libcamera: request: Add tracepoints
  tracepoints: Add pipeline tracepoints for tracing IPA calls
  utils: tracepoints: Add simple statistics script
  Documentation: tracing: Add tracing guide

 Documentation/Doxyfile.in                     |   4 +-
 Documentation/guides/tracing.rst              | 141 ++++++++++++++++++
 Documentation/index.rst                       |   1 +
 Documentation/meson.build                     |   1 +
 README.rst                                    |   3 +
 include/libcamera/internal/meson.build        |   9 ++
 include/libcamera/internal/tracepoints.h.in   |  61 ++++++++
 .../internal/tracepoints/buffer_enums.tp      |   9 ++
 .../internal/tracepoints/meson.build          |  10 ++
 .../internal/tracepoints/pipeline.tp          |  25 ++++
 .../libcamera/internal/tracepoints/request.tp |  68 +++++++++
 .../internal/tracepoints/request_enums.tp     |   9 ++
 meson.build                                   |   3 +
 meson_options.txt                             |   5 +
 src/libcamera/meson.build                     |   7 +
 src/libcamera/request.cpp                     |  11 ++
 src/libcamera/tracepoints.cpp                 |  10 ++
 utils/meson.build                             |   1 +
 utils/tracepoints/analyze-ipa-trace.py        |  77 ++++++++++
 utils/tracepoints/gen-tp-header.py            |  38 +++++
 utils/tracepoints/meson.build                 |   5 +
 21 files changed, 497 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/guides/tracing.rst
 create mode 100644 include/libcamera/internal/tracepoints.h.in
 create mode 100644 include/libcamera/internal/tracepoints/buffer_enums.tp
 create mode 100644 include/libcamera/internal/tracepoints/meson.build
 create mode 100644 include/libcamera/internal/tracepoints/pipeline.tp
 create mode 100644 include/libcamera/internal/tracepoints/request.tp
 create mode 100644 include/libcamera/internal/tracepoints/request_enums.tp
 create mode 100644 src/libcamera/tracepoints.cpp
 create mode 100755 utils/tracepoints/analyze-ipa-trace.py
 create mode 100644 utils/tracepoints/gen-tp-header.py
 create mode 100644 utils/tracepoints/meson.build

-- 
2.27.0



More information about the libcamera-devel mailing list