[roll] Roll fuchsia [ktrace] Tune ktrace_provider in Streaming Mode

This patch tunes the frequency of ktrace provider's servicing of the
kernel buffer in several ways.

Justification of parameters:

Experimental data taken using `ffx trace start --categories kernel ...`
on emulator and hardware.

- On average, a trace with all kernel categories enabled puts out about
  10MiB/s of trace data. However,
- kernel:irq is particularly bursty, and can occasionally burst 500 irq events/ms for
  as long as 60ms.
  - An irq event is a duration complete event which is
    - 8 bytes header
    - 8 bytes timestamp
    - 16 bytes pid + tid
    - 8 bytes end timestamp
    - 8 bytes argument (32bit vector)
    Total: 48 bytes => 24k/ms
- ktrace_provider can exfiltrate data at > 250MB/s => > 250KB/ms

- The user buffer size is configurable, but we need to service the
  buffers often enough that they don't fill from missing a burst.

500kiB Buffer => Service at least every 21ms, service of full buffers is expected to take roughly 1.9ms.
1MiB Buffer => Service at least every 44ms, service of full buffers is expected to take roughly 4ms.

Regardless of buffer size, our peak usage is about 1 capacity per 10
period. Our period just needs to be small enough to not let the buffers
overflow.

Since we're somewhat latency sensitive and only polling during tracing,
and frequently won't be using our peak capacity, even during tracing, so
it's somewhat okay to over shoot.

The minimum per cpu buffer size we're currently expecting is 512kib,
which implies a period < 21ms. To provide extra headroom, halving that
period should catch a quickly filling buffer roughly at the 50% mark,
giving us ample time to be scheduled and start serving the buffer.

Therefore, this patch sets the profile to the 1:10 ratio computed and
set ktrace_provider to poll at that rate. With this profile, we are able
to get traces with all kernel categories enabled, (dropping ~344kb/269MB
trace in 2 instances each after a burst of kernel:irq records).

Without kernel:irq enabled, this profile should be well sufficient.

Original-Bug: 404539312

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1264024
Original-Revision: 21683f9de9032438df140931c8ca4d7a5381ebb2
GitOrigin-RevId: a17209325e6ce05792a9ed67b8eefbb20c83577a
Change-Id: I61d896599dc416ba49205074c3d08156932d0dc3
1 file changed
tree: 5bfd224091bd277592ca505afe01c169a8163671
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. flower
  6. jiri.lock
  7. MILESTONE
  8. minimal
  9. prebuilts
  10. README.md
  11. stem
  12. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.