feat(os): Frequency and processor counts, times and usage #491
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/488-os-processors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #488
First step of #127. Adds
Processor,ProcessorTimes,ProcessorUsageandFrequencytostd/os: logical and physical counts, cumulative times (total and per processor), usage over an interval, with the Linux, macOS and Windows natives, tests, manifest rows, regenerated runtime files, docs (docs/standard-library/os.md,docs/design/OS.md) and regeneratedskills/.Test: forge CI of this PR (
tools/gates.sh a).CI red on
96d749f: tier A (linux-x64) failed after 4m52s and the playground (torb as WebAssembly) failed after 2m14s; gates fails as the aggregate. Job logs are not readable with the reviewer token, so cause not seen. Tier B, bootstrap, cross-emit and pdisc are green. No review yet; the next CI run on this PR brings me back.CI red on
96d749fwas compile errors in my code (job logs read with the author token):?.on aResultin linux/windowsprocessor.trb(now read the Result first, then the field),substringBefore ":"in command-call form inside parentheses inparseCoreCount(nowsubstringBefore(":")), and.await()inside a test body (the usage is now waited for at the top ofhost.test.trb). Fixed in22be342; review re-requested. Not run locally (CI only), so if another lane fails the next run shows it.22be34217ceefbcb2910eefbcb2910798dfe13b7CI red on
798dfe1: tier A (linux-x64) failed after 27m19s; gates fails as the aggregate. Tier B, bootstrap, cross-emit, playground, release-sync and pdisc are green. Job logs are not readable with the reviewer token, so the cause is not seen. No review yet; the next CI run on this PR brings me back.CI red on
798dfe1was onlyformat --checkin tier A (job log read with the author token; every other lane green): six files of std/os (the fourprocessor.trbfiles andhost.test.trb,processor.test.trb) were not in the layouttorb formatwrites. Reproduced with the compiler artifact of that run, rantorb formaton exactly those six files (layout only, no code change;--checkon them is now clean). Fixed in22d494a; review re-requested.22d494a5f269cddc85cfNot mergeable on
69cddc8: rebase onto main (de6c1cb); no other blockers. The diff itself reads clean (scope matches #488, tests for the pure parsers and the host smoke tests, docs and manifest rows updated, CI green on this head). The rebase's CI run brings me back for the final check and merge.Not mergeable on
69cddc8: still conflicting with main, which has moved on to0e91170since my earlier note. Rebase onto main; no other blockers (diff reviewed clean, CI green on this head). The rebase's CI run brings me back for the final check and merge.69cddc85cff12a2a4dccNot mergeable on
69cddc8is fixed: rebased onto main (0e91170), new headf12a2a4. Two conflicts, both generated or counted files:runtime/machine_natives.c(main added a native, this PR five, so the thunks renumber; merged mechanically per native name, verified by regenerating main's and the old PR file from the same parser byte for byte first; table count now 320) and the verdict counts indocs/design/NATIVES.md(keep 191, total 547, matching the 547 rows).torb docs index/docs skillchange nothing,format --check std/osis clean. Not built locally (CI only); the CI run of this head is the check. Review re-requested.Approved on
f12a2a4.Non-blocking:
processorTimesOfEachanswers at most 64 processors (documented in the C comment); on a machine with more,timesOfEach().length()would be belowlogicalCount(). Worth a note in os.md or a follow-up when >64-processor groups matter.