Files
clang-p2996/llvm/test/tools/llvm-profdata/trace-limit.proftext
Ellis Hoag c87b1ca4ed [InstrProf] Fix bug when clearing traces with samples (#92310)
The `--temporal-profile-max-trace-length=0` flag in the `llvm-profdata
merge` command is used to remove traces from a profile. There was a bug
where traces would not be cleared if the profile was already sampled.
This patch fixes that.
2024-05-15 18:41:25 -05:00

48 lines
1.2 KiB
Plaintext

# RUN: llvm-profdata merge --temporal-profile-max-trace-length=0 %s -o %t.profdata
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefix=NONE
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %s %s %s -o %t.profdata
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 --temporal-profile-max-trace-length=0 %t.profdata -o %t.profdata
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefix=NONE
# RUN: llvm-profdata merge --temporal-profile-max-trace-length=2 %s -o %t.profdata
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=CHECK,SOME
# RUN: llvm-profdata merge --temporal-profile-max-trace-length=1000 %s -o %t.profdata
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=CHECK,ALL
# NONE: Temporal Profile Traces (samples=0
# CHECK: Temporal Profile Traces (samples=1 seen=1):
# SOME: Trace 0 (weight=1 count=2):
# ALL: Trace 0 (weight=1 count=3):
# Header
:ir
:temporal_prof_traces
# Num Traces
1
# Trace Stream Size:
1
# Weight
1
a, b, c
a
# Func Hash:
0x1234
# Num Counters:
1
# Counter Values:
101
b
0x5678
1
202
c
0xabcd
1
303