-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#5505 kernel tracing: Add syscall instr encodings (#6479)
Adds encodings for kernel system call instructions to the trace in raw2trace. Kernel system call traces are decoded using libipt which also provides the instruction encodings. We add support to drir_t to write these encodings to a new buffer which is re-used for all dynamic instances of that instr even across multiple system call traces. Fixes taken/not-taken detection for conditional branches in the syscall trace. Adds support in the syscall_mix tool to report the counts of each system call's traces also. Adds sysnum to system call trace start and end markers to achieve this. Ran all Intel-PT tests locally: ``` $ ctest -VV -R 'SUDO' ... The following tests passed: code_api|client.drpttracer_SUDO-test code_api|tool.drcachesim.phys_SUDO # not really PT. Just included because of ctest -R. code_api|tool.drcachesim.phys-threads_SUDO # not really PT. Just included because of ctest -R. code_api|tool.drcacheoff.phys_SUDO # not really PT. Just included because of ctest -R. code_api|tool.drcacheoff.kernel.simple_SUDO code_api|tool.drcacheoff.kernel.opcode-mix_SUDO code_api|tool.drcacheoff.kernel.syscall-mix_SUDO 100% tests passed, 0 tests failed out of 7 ``` Found some flakiness due to #6486 in local runs of the kernel sudo tests, which will be addressed separately. Issue: #5505
- Loading branch information
1 parent
30031e0
commit b9441b3
Showing
20 changed files
with
224 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TAG 0x0000000000000000 | ||
\+0 L3 .* mov \$0x00000001 -> %eax | ||
\+5 L3 .* mov \$0x00000001 -> %edi | ||
\+10 L3 .* \$0x0000000000402000 -> %rsi | ||
.* | ||
\+20 L3 .* mov \$0x0000000e -> %edx | ||
\+25 L3 .* syscall -> %rcx %r11 | ||
\+27 L3 .* mov \$0x0000003c -> %eax | ||
\+32 L3 .* mov \$0x00000000 -> %edi | ||
\+37 L3 .* syscall -> %rcx %r11 | ||
END 0x0000000000000000 | ||
.* | ||
Number of Instructions: 8 | ||
Number of Trace Entries: 8 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Hello, world! | ||
Opcode mix tool results: | ||
.*: total executed instructions | ||
.* | ||
.*: .*clac | ||
.* |
6 changes: 6 additions & 0 deletions
6
clients/drcachesim/tests/offline-kernel-syscall-mix.templatex
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Hello, world! | ||
Syscall mix tool results: | ||
syscall count : syscall_num | ||
.* | ||
syscall trace count : syscall_num | ||
.* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Hello, world! | ||
Syscall mix tool results: | ||
count : syscall_num | ||
syscall count : syscall_num | ||
( *[1-9][0-9]* : *[0-9]*.*)+ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Hello, world! | ||
---- <application exited with code 0> ---- | ||
Syscall mix tool results: | ||
count : syscall_num | ||
syscall count : syscall_num | ||
( *[1-9][0-9]* : *[0-9]*.*)+ |
Oops, something went wrong.