Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#6822 unscheduled: Add start-unscheduled support #6851

Merged
merged 5 commits into from
Jun 22, 2024

Conversation

derekbruening
Copy link
Contributor

Adds support for threads starting out in an "unscheduled" state. This is accomplished by always reading ahead in each input and looking for a TRACE_MARKER_TYPE_SYSCALL_UNSCHEDULE marker before the first instruction. Normally such a marker indicates the invocation of a system call and is after the system call instruction; for start-unscheduled threads it is present at the system call exit at the start of the trace.

Changes the scheduler's virtual method process_next_initial_record() to make the booleans on finding certain markers input-and-output parameters and moves filetype marker handling and timestamp recording into the function. This also fixes a problem where an input's initial next_timestamp was replaced with the 2nd timestamp if a subclass read ahead.

The extra readahead causes complexities elsewhere which are addressed:

  • The reader caches the last cpuid to use for synthetic recores on skipping.
  • Generalizes the existing scheduler handling of readahead (the "recorded_in_schedule" field in input_info_t) to store a count of pre-read instructions, which will generally be either 0 or 1. Adds a new internal interface get_instr_ordinal() to get the input reader's instruction ordinal minus the pre-read count.

Changes raw2trace's virtual function process_marker_additionally() to process_marker() and moves all marker processing (including timestamps, which are not markers in the raw format) there, to better support subclasses inserting start-unscheduled markers and deciding whether to insert new markers either before or after pre-existing markers.

Adds a scheduler test for the new feature.

Issue: #6822

Adds support for threads starting out in an "unscheduled" state.  This
is accomplished by always reading ahead in each input and looking for
a TRACE_MARKER_TYPE_SYSCALL_UNSCHEDULE marker *before* the first
instruction.  Normally such a marker indicates the invocation of a
system call and is after the system call instruction; for
start-unscheduled threads it is present at the system call exit at the
start of the trace.

Changes the scheduler's virtual method process_next_initial_record()
to make the booleans on finding certain markers input-and-output
parameters and moves filetype marker handling and timestamp recording
into the function.  This also fixes a problem where an input's initial
next_timestamp was replaced with the 2nd timestamp if a subclass read
ahead.

The extra readahead causes complexities elsewhere which are addressed:
+ The reader caches the last cpuid to use for synthetic recores
  on skipping.
+ Generalizes the existing scheduler handling of readahead (the
  "recorded_in_schedule" field in input_info_t) to store a count of
  pre-read instructions, which will generally be either 0 or 1.  Adds
  a new internal interface get_instr_ordinal() to get the input
  reader's instruction ordinal minus the pre-read count.

Changes raw2trace's virtual function process_marker_additionally() to
process_marker() and moves all marker processing (including
timestamps, which are not markers in the raw format) there, to better
support subclasses inserting start-unscheduled markers and deciding
whether to insert new markers either before or after pre-existing
markers.

Adds a scheduler test for the new feature.

Issue: #6822
@derekbruening
Copy link
Contributor Author

x32 failure is opcode_mix encoding error #6303

@derekbruening
Copy link
Contributor Author

Will wait to merge until corresponding 3rd party subclass changes are fully ready.

@derekbruening derekbruening merged commit 304faf9 into master Jun 22, 2024
16 of 17 checks passed
@derekbruening derekbruening deleted the i6822-start-unscheduled branch June 22, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants