File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ struct PseudoProbeDesc {
275275 std::vector<Hex64> GUID;
276276 std::vector<Hex64> Hash;
277277 std::vector<uint32_t > GUIDHash; // Index of hash for that GUID in Hash
278+
279+ bool operator ==(const PseudoProbeDesc &Other) const {
280+ // Only treat empty Desc as equal
281+ return GUID.empty () && Other.GUID .empty () && Hash.empty () &&
282+ Other.Hash .empty () && GUIDHash.empty () && Other.GUIDHash .empty ();
283+ }
278284};
279285} // end namespace bolt
280286
@@ -306,7 +312,8 @@ template <> struct MappingTraits<bolt::BinaryProfile> {
306312 static void mapping (IO &YamlIO, bolt::BinaryProfile &BP) {
307313 YamlIO.mapRequired (" header" , BP.Header );
308314 YamlIO.mapRequired (" functions" , BP.Functions );
309- YamlIO.mapOptional (" pseudo_probe_desc" , BP.PseudoProbeDesc );
315+ YamlIO.mapOptional (" pseudo_probe_desc" , BP.PseudoProbeDesc ,
316+ bolt::PseudoProbeDesc ());
310317 }
311318};
312319
Original file line number Diff line number Diff line change 3636## generated
3737# RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata
3838# RUN: FileCheck --input-file %t.yaml %s --check-prefix CHECK-NO-OPT
39- # CHECK-NO-OPT-NOT: pseudo_probes
40- # CHECK-NO-OPT-NOT: inline_tree
39+ # CHECK-NO-OPT-NOT: probes:
40+ # CHECK-NO-OPT-NOT: inline_tree:
41+ # CHECK-NO-OPT-NOT: pseudo_probe_desc:
4142
4243CHECK: Report of decoding input pseudo probe binaries
4344
You can’t perform that action at this time.
0 commit comments