Repository navigation
feat(ktrace): added derived CPU slices, thread states, threads and processes to ktrace-decode - #350
Merged
Merged
Conversation
…ocesses to ktrace-decode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ktrace-decodederives them once:cpu_slices,thread_states(running, runnable or sleeping, with the waker, switch reason or syscall behind each stretch),threads,thread_namesandprocesses. Anything the records cannot determine is left out or NULL rather than guessed, and aswitch_chainhealth check confirms the chain of switches these tables rely on is unbroken.Note
Medium Risk
Large new timeline interpretation logic drives correctness of derived scheduling data; mistakes would mislead offline analysis but do not affect runtime kernel behavior.
Overview
ktrace-decodenow materializes scheduling-oriented SQLite tables so analyses do not have to rebuild CPU timelines and thread lifetimes from rawsched_switch/sched_wakeupevents. A newwrite_derived_tablespass walks the ordered timeline and populatescpu_slices,thread_states(running / runnable / sleeping, with waker, switch reason, and syscall or page-fault context when the trace supports it),threads,thread_names, andprocesses, using NULL where the records do not prove a value.Pipeline and schema wiring changes: task-name interning moves into shared
name_table(name_idsflows through event and derived writers); event table creation drops the inlinenamesschema and instead auto-creates(tid, ts_ns)indexes on event fields whose names end intid. Health checks gain aswitch_chainvalidation that each CPU’s switches continue from the previous task, andcheck_healthnow takes the fulltimeline. CLI output reports derived row counts;record_event_id/record_payloadhelpers centralize record parsing.Reviewed by Cursor Bugbot for commit aaf7dcd. Bugbot is set up for automated code reviews on this repo. Configure here.