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#6495 syscall templates: Inject kernel traces in raw2trace #6496

Merged
merged 24 commits into from
Dec 9, 2023

Conversation

abhinav92003
Copy link
Contributor

@abhinav92003 abhinav92003 commented Dec 6, 2023

Adds support to raw2trace to read system call kernel trace templates from the given file and inject them at the corresponding system call number marker during raw2trace conversion of user-space traces.

Adds a new offline file type OFFLINE_FILE_TYPE_KERNEL_SYSCALL_TRACE_TEMPLATES used by such system call trace template files.

Adds the burst_syscall_inject.cpp test that writes a sample system call template file and verifies that it can be processed by the analyzer framework; further, it collects a user-space trace for an app function that makes some system calls, then performs raw2trace conversion with system call template injection using the above-mentioned file. It then verifies that the trace templates are injected properly in the resulting trace. The test also runs basic_counts on the resulting trace to ensure it can be processed by the analyzer framework.

Extracts raw2trace logic to write the essential header entries (that is, the entries that are expected by the analyzer framework in the trace) into a separate public API that can be used by other libraries (such as the new burst_syscall_inject test or any other library writing the syscall trace template file) to write valid header entries.

The sample system call template file written by burst_syscall_inject.cpp also serves as documentation for the expected format of OFFLINE_FILE_TYPE_KERNEL_SYSCALL_TRACE_TEMPLATES files.

More aspects of system call kernel trace injection is left to future work: supporting multiple trace templates per system call (e.g. differentiated by system call arguments or return value), or other adjustment to the template at injection time.

Issue: #6495

Adds support to raw2trace to read system call trace templates from the given
file and inject the system call trace templates at the corresponding system call
number marker during raw2trace conversion of user-space traces.

Adds a new offline file type OFFLINE_FILE_TYPE_KERNEL_SYSCALL_TRACE_TEMPLATES
used by such system call trace template files.

Adds the burst_syscall_inject.cpp test that writes a sample system call template
file and verifies that it can be processed by the analyzer framework; further,
it collects a user-space trace for an app function that makes some system calls,
then performs raw2trace conversion with system call template injection using
the above-mentioned file. It then verifies that the trace templates are injected
properly.

The sample system call template file written by burst_syscall_inject.cpp also
serves as documentation for the expected format of
OFFLINE_FILE_TYPE_KERNEL_SYSCALL_TRACE_TEMPLATES files.

More aspects of system call trace injection is left to future work: supporting
multiple trace templates per system call (e.g. differentiated by system call
arguments or return value), or other adjustment to the template at injection
time.

Issue: #6495
@abhinav92003 abhinav92003 changed the title i#6495 syscall templates: Inject syscall trace templates in raw2trace i#6495 syscall templates: Inject kernel traces in raw2trace Dec 6, 2023
@abhinav92003 abhinav92003 marked this pull request as ready for review December 6, 2023 21:37
api/docs/release.dox Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/burst_syscall_inject.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
@abhinav92003
Copy link
Contributor Author

I'm seeing two test timeouts in vs2019-32 that aren't happening on other PRs: tool.drcacheoff.simple and tool.drcacheoff.windows-simple.

clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
@abhinav92003
Copy link
Contributor Author

x86-32 failures are #6417.

@abhinav92003 abhinav92003 merged commit 43cbfc3 into master Dec 9, 2023
14 of 15 checks passed
@abhinav92003 abhinav92003 deleted the i6495-inject-syscall-template branch December 9, 2023 00:42
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.

2 participants