diff options
author | 2022-12-19 09:40:18 +0000 | |
---|---|---|
committer | 2023-01-04 15:15:23 +0000 | |
commit | 5497f749b4d35c7b0767d21cb487e2fee293cd07 (patch) | |
tree | ab9d266fa3e38628486b1dcdbdcbd43237851aed /test/2246-trace-stream/run.py | |
parent | 3cde18ddf4a7af5aabd183eab59f052065270f10 (diff) |
Fix method tracing in non-debuggable runtimes
There are a few fixes needed for correctly supporting method tracing in
non-debuggable runtimes:
1. When we start method tracing we report method entry events for
methods already on the stack with the expectation that method exit
events would be called when method finishes. In non-debuggable
runtimes some of these may not support method exit events, so report
method entry events only if the frame supports them.
2. When method tracing is enabled, we switch the runtime to debuggable.
When we switch to debuggable runtime, we missed updating entrypoints
and deoptimizing boot image. Fix it so we get method entry / exit
events for all methods.
Also updates test 2246-method-trace to work in non-debuggable runtimes.
Bug: 259258187
Test: art/testrunner.py -t 2246
Change-Id: I040416c7cb72062c02312eedb5bcd41da09e53dc
Diffstat (limited to 'test/2246-trace-stream/run.py')
-rw-r--r-- | test/2246-trace-stream/run.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/2246-trace-stream/run.py b/test/2246-trace-stream/run.py index 6881d714c8..6eb92655f8 100644 --- a/test/2246-trace-stream/run.py +++ b/test/2246-trace-stream/run.py @@ -18,5 +18,15 @@ def run(ctx, args): # The expected output is different in debuggable and non debuggable. Just # enable debuggable for now. - # TODO(mythria): Also add tests for non-debuggable mode. - ctx.default_run(args, Xcompiler_option=["--debuggable"]) + ctx.default_run(args) + + print(args); + if ("--debuggable" in args.Xcompiler_option): + # On debuggable runtimes we disable oat code in boot images right at the start + # so we get events for all methods including methods optimized in boot images. + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".debuggable.txt") + elif ("--interpreter" in args.Xcompiler_option) or args.interpreter: + # On forced interpreter runtimes we don't get method events for optimized + # methods in boot images but get events for a few more methods that would + # have otherwise used nterp. + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".interpreter.txt") |