diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -1228,6 +1228,12 @@ if (hasSecFlag(Entry, SecFuncOffsetFlags::SecFlagOrdered)) Flags.append("ordered,"); break; + case SecFuncMetadata: + if (hasSecFlag(Entry, SecFuncMetadataFlags::SecFlagIsProbeBased)) + Flags.append("probe,"); + if (hasSecFlag(Entry, SecFuncMetadataFlags::SecFlagHasAttribute)) + Flags.append("attr,"); + break; default: break; } diff --git a/llvm/test/tools/llvm-profdata/cs-sample-profile.test b/llvm/test/tools/llvm-profdata/cs-sample-profile.test --- a/llvm/test/tools/llvm-profdata/cs-sample-profile.test +++ b/llvm/test/tools/llvm-profdata/cs-sample-profile.test @@ -2,3 +2,5 @@ RUN: diff -b %t.proftext %S/Inputs/cs-sample.proftext RUN: llvm-profdata merge --sample --extbinary %p/Inputs/cs-sample.proftext -o %t.prof && llvm-profdata merge --sample --text %t.prof -o %t1.proftext RUN: diff -b %t1.proftext %S/Inputs/cs-sample.proftext +RUN: llvm-profdata show --sample -show-sec-info-only %t.prof | FileCheck %s +CHECK: FunctionMetadata {{.*}} Flags: {attr} diff --git a/llvm/test/tools/llvm-profdata/merge-probe-profile.test b/llvm/test/tools/llvm-profdata/merge-probe-profile.test --- a/llvm/test/tools/llvm-profdata/merge-probe-profile.test +++ b/llvm/test/tools/llvm-profdata/merge-probe-profile.test @@ -22,3 +22,6 @@ MERGE2: 5: 14 _Z3foov:10 _Z3barv:4 MERGE2: 6: 12 _Z3barv:8 _Z3foov:4 MERGE2: !CFGChecksum: 563022570642068 + +RUN: llvm-profdata show --sample -show-sec-info-only %t | FileCheck %s +CHECK: FunctionMetadata {{.*}} Flags: {probe} \ No newline at end of file