tree: 1f194ba3b686c78855556414e241c3b0929c3b7f [path history] [tgz]
  1. init/
  2. reprocess_effect/
  3. seccomp_filter/
  4. tmpfiles.d/
  5. udev/
  6. BUILD.gn
  7. camera3_callback_ops_delegate.cc
  8. camera3_callback_ops_delegate.h
  9. camera3_device_ops_delegate.cc
  10. camera3_device_ops_delegate.h
  11. camera_device_adapter.cc
  12. camera_device_adapter.h
  13. camera_hal_adapter.cc
  14. camera_hal_adapter.h
  15. camera_hal_server_impl.cc
  16. camera_hal_server_impl.h
  17. camera_hal_test_adapter.cc
  18. camera_hal_test_adapter.h
  19. camera_metadata_inspector.cc
  20. camera_metadata_inspector.h
  21. camera_module_callbacks_associated_delegate.cc
  22. camera_module_callbacks_associated_delegate.h
  23. camera_module_delegate.cc
  24. camera_module_delegate.h
  25. camera_trace_event.cc
  26. camera_trace_event.h
  27. cros_camera_main.cc
  28. OWNERS
  29. README.md
  30. scoped_yuv_buffer_handle.cc
  31. scoped_yuv_buffer_handle.h
  32. vendor_tag_ops_delegate.cc
  33. vendor_tag_ops_delegate.h
camera/hal_adapter/README.md

How to collect and view camera traces

We use Perfetto to record camera traces on Chrome and CrOS Camera Service. Therefore, we can collect camera traces from these components to evaluate the performance of each steps when setting up the camera stream and understand the journey of a camera capture request.

To do so, currently we can run perfetto command line tool while using the camera.

Step 1:

Run the perfetto command line to collect camera traces from components.

You can specify how long you want to record by duration_ms field. Example:

perfetto -c - --txt -o /tmp/perfetto-trace \
<<EOF

buffers: {
    size_kb: 63488
    fill_policy: DISCARD
}
buffers: {
    size_kb: 63488
    fill_policy: DISCARD
}
data_sources: {
    config {
        name: "track_event"
        target_buffer: 0
        track_event_config {
            enabled_categories: "cros_camera"
        }
    }
}
data_sources: {
    config {
        name: "org.chromium.trace_event"
        target_buffer: 1
        chrome_config {
            trace_config: "{\"record_mode\":\"record-until-full\",\"included_categories\":[\"camera\"],\"memory_dump_config\":{}}"
        }
    }
}
duration_ms: 20000

EOF

Step 2:

While perfetto command is recording, open up a camera application and manipulate the flow you are interested in. (e.g. Taking a picture or recording a video)

Step 3:

Go to Perfetto UI (https://ui.perfetto.dev/), click “Open trace file” and provide the result file (in our example is /tmp/perfetto-trace).

The details of the tracing results should be shown on the UI.