[roll] Roll fuchsia [zircon][sampler] Move Timer into Percpu Struct

To service each cpu, we set a timer on each cpu and take a sample on
that cpu when the timer goes off.

This isn't correct as timers can be migrated when cpus go on and off
line. Instead, we can make the percpu struct aware of our timers and
properly integrate with it to prevent the timer from being started on
another cpu when it goes offline.

This CL:
- Moves the per cpu Timers out of the sampler into the percpu structs.
  These percpu struct Timers do not get migrated
- Adds a ref counting system to only allow timers to be set while the
  session is running and to prevent destroying the session until the
  timers have been successfully canceled.
- Integrates with the cpu start up and shutdown paths. On shutting down,
  check if the session is running, and if so, cancel the timer and
  decrement the ref count. On start up, check if a session is running.
  If so, increment the ref count and start the timer.

Test:

fx run-boot-test  core-tests --test-filter 'ThreadSampler.*'
fx run-boot-test  kernel-unittests-boot-test --kernel-unittest thread_sampler --symbolize
fx test profiler
zircon/scripts/grind -n 64 -d ./grind-logs \
"while true; do fx qemu --arch x64 -z out/fuchsia_internal.x64-balanced/obj/zircon/kernel/kernel-unittests-boot-test.product_bundle/system_a/fuchsia.zbi -c 'kernel.shell.script=ut+thread_sampler;boot-test-success;graceful-shutdown' -- -no-reboot; done"

Original-Original-Bug: 377907138
Original-Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1470202
Original-Original-Revision: adb1edd83e76b3eb83de8ac146a7fa3f08f63029
GitOrigin-RevId: 65563403643618831a3b19f755dc3d7d086508ac
Change-Id: I57b79dd31bed7127bd1bb3e22072e1d72d7689a7
Reviewed-on: https://fuchsia-review.googlesource.com/c/integration/+/1709697
Cr-Commit-Position: refs/heads/main@{#197020}
1 file changed
tree: 39a55cd51e1a3dd251ae23a1dd720293ee2e4d73
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cobalt
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. 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.