[zircon] API for setting thread affinity in profiles.

Add support to |zx_profile_create| for specifying thread affinity, and
expose via |zx_object_get_info| the last CPU a particular thread was
scheduled on to facilitate testing. No implementation actually exists at
this point; this change simply updates the API.

More specifically, this CL performs three changes:

  * First, we add support for a CPU affinity mask. This is specified by
    by a pointer to a CPU mask and the size of the mask.

  * Second, inline the scheduler |priority| argument from inside of the
    union in |zx_profile_t| to being directly in the top-level of the
    struct.

    Our longer term vision for profile objects is that they be atomic:
    that is, a thread can have only a single profile applied to it at
    a point. However, by having the scheduler parameters inside of the
    union, users can only create profile objects covering one dimension
    of attributes (i.e., users can create a scheduling profile, or a CPU
    affinity profile, but not a profile that covers both).

    This CL allows profile objects to specify both scheduler parameters
    and CPU affinity masks by adding new fields outside of the union.
    Once implemented, existing users of the |zx_profile_create| syscall
    will be migrated to the new fields, and the old union removed.

  * Finally, we add a new field to |zx_info_thread_stats| to expose
    to userspace the most recent CPU a given thread was scheduled on.
    This allows us in later CLs to test that the kernel is respecting
    affinity. Other tools, such as "top" may also use these statistics
    in future.

BUG: ZX-3828

Change-Id: I06ecd17add266ba44a1fd2aa0805c9c49e112807
8 files changed
tree: 73723d58c3a34a0a3c6eb1c1a5249771c236ad1c
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. peridot/
  9. products/
  10. scripts/
  11. sdk/
  12. src/
  13. third_party/
  14. tools/
  15. zircon/
  16. .clang-format
  17. .clang-tidy
  18. .dir-locals.el
  19. .gitattributes
  20. .gitignore
  21. .gn
  22. .style.yapf
  23. AUTHORS
  24. BUILD.gn
  25. CODE_OF_CONDUCT.md
  26. CONTRIBUTING.md
  27. LICENSE
  28. OWNERS
  29. PATENTS
  30. README.md
  31. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See the documentation.