diff options
author | 2023-02-27 18:50:44 +0000 | |
---|---|---|
committer | 2023-05-12 13:50:45 +0000 | |
commit | 98aefe07b6e28632fff0efce6b71f1f816cfc1dc (patch) | |
tree | 8709ed103391510d7cf7a11846a8f8a3728199b8 /compiler/utils/x86/assembler_x86.h | |
parent | 1b8a7838e95d0a57be2b920183ba9b7b2188ccb2 (diff) |
Collect timestamps directly from the JITed code
JIT code was calling out to C++ code to collect timestamps at method
entry / exit when precise profiling is enabled. Calling out to C++ would
involve setting up a frame and spilling registers which can be
expensive. This CL generates code to collect timestamps and update the
per-thread buffer so we can collect timestamps directly from JITed code.
This also updates the test to check timestamps are monotonic.
Bug: 259258187
Test: art/test.py
Change-Id: I07148d4e2605bbb0e75062e0f4642a7f7847bebb
Diffstat (limited to 'compiler/utils/x86/assembler_x86.h')
-rw-r--r-- | compiler/utils/x86/assembler_x86.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index 0f7854dc5c..e6503045fa 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -955,6 +955,12 @@ class X86Assembler final : public Assembler { lock()->xaddl(address, reg); } + void rdtsc() { + AssemblerBuffer::EnsureCapacity ensured(&buffer_); + EmitUint8(0x0F); + EmitUint8(0x31); + } + // // Misc. functionality // |