[roll] Roll fuchsia [kernel][jtrace] Make JTRACE work better during early boot.

JTRACE uses the presence of 0 timestamps to detect records which were
never written when trying to find where the implied read pointer is
during trace dumping.  Unfortunately, before clock selection has taken
place, the clock code is always going to return 0, meaning that these
early records are going to get skipped when dumping the buffer.

So, when recording records, if we would have recorded a zero
timestamp, record a sentinel value instead.  Later on, when the trace
is getting dumped, we substitute back to zero if we detect the
sentinel.

Also, make JTRACE work even before thread_early_init has been called.
Thread::Current::Get does not work until after this function has
completed, meaning that trying to create a JTRACE entry could crash
for two separate reasons.  First, when using large records, it will
attempt to access the current thread's TID.  Second, during record
creation, it attempt to disable preemption, which requires modifying a
flag in the current thread's state.

To work around these problems, we add a flag to the tracer's
state which gets set immediately after thread_early_init completes.
We skip disabling preemption, and record a special "unknown tid"
sentinel when creating records before this.

Finally (not related to early boot), change the name of the `entry`
variable used in the JTRACE macro to `_entry`.  This helps to prevent
warnings from the compiler when using JTRACE in contexts where the
surrounding code has already declared an `entry` variable (producing a
warning about shadowing).

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/872876
Original-Revision: 955b7a69dc234fda88f24fe731bc6a07361ed65f
GitOrigin-RevId: dd9518a9d0b18450010d84184a129a4cd42a250c
Change-Id: I8421f4edad4477ea07c7996be9df482ac41ae9c0
1 file changed
tree: 29c4059a58532b975b3de7cabb25e8cf6e7b314e
  1. git-hooks/
  2. infra/
  3. third_party/
  4. cts
  5. firmware
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
  14. toolchain
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 via the IRC channel #fuchsia on Freenode.

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.