Skip to content

[XRay][account] add account test for nonempty exit mismatch #93564

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#RUN: not llvm-xray account %s -o - -m %S/Inputs/simple-instrmap.yaml -d 2>&1 | FileCheck %s
#RUN: llvm-xray account %s -k -o - -m %S/Inputs/simple-instrmap.yaml -d 2>&1 | FileCheck %s --check-prefix=KEEPGOING

---
header:
version: 1
type: 0
constant-tsc: true
nonstop-tsc: true
cycle-frequency: 0
records:
# An exit record doesn't match an entry record on a non empty stack with sibling call deduction.
# This can happen for example when an instrumented function does a 'fork()',
# where the child process will not see
# the entry record but see the exit record. This is completely valid data,
# which should be handled with grace (i.e. we treat it as an error, but since
# the llvm-xray account tool has an option to keep going, gives the user a
# chance to retry).
- { type: 0, func-id: 1, cpu: 1, thread: 1, kind: function-enter, tsc: 10000 }
- { type: 0, func-id: 4, cpu: 1, thread: 1, kind: function-exit, tsc: 10001 }
- { type: 0, func-id: 1, cpu: 1, thread: 1, kind: function-exit, tsc: 10002 }
...

#CHECK: Error processing record: {{.*}}
#CHECK-NEXT: Thread ID: 1
#CHECK-NEXT: #1 @(1)
#CHECK-NEXT: llvm-xray: Failed accounting function calls in file '{{.*}}'.

#KEEPGOING: Error processing record: {{.*}}
#KEEPGOING-NEXT: Thread ID: 1
#KEEPGOING-NEXT: #1 @(1)
4 changes: 2 additions & 2 deletions llvm/test/tools/llvm-xray/X86/account-keep-going.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ header:
nonstop-tsc: true
cycle-frequency: 0
records:
# We want to test the case for when we see spurious exits, but keep going
# anyway ignoring the records in the process.
# We want to test the case for when we see spurious exits without sibling call deduction,
# but keep going anyway ignoring the records in the process.
- { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10000 }
- { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
- { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-enter, tsc: 10002 }
Expand Down
Loading