Skip to content

Commit

Permalink
cmd/memlat: accept SampleFormatWeightStruct
Browse files Browse the repository at this point in the history
  • Loading branch information
aclements committed Jul 11, 2022
1 parent 8e534be commit fc9d1ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/memlat/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func parsePerf(fileName string) *database {
droppedMmaps := 0
droppedSymbols := 0

const requiredFormat = perffile.SampleFormatIP | perffile.SampleFormatAddr | perffile.SampleFormatWeight | perffile.SampleFormatDataSrc
const requiredFormat = perffile.SampleFormatIP | perffile.SampleFormatAddr | perffile.SampleFormatDataSrc

rs := f.Records(perffile.RecordsCausalOrder)
for rs.Next() {
Expand All @@ -110,6 +110,10 @@ func parsePerf(fileName string) *database {
if r.Format&requiredFormat != requiredFormat {
break
}
// Either Weight or WeightStruct is required.
if r.Format&(perffile.SampleFormatWeight|perffile.SampleFormatWeightStruct) == 0 {
break
}

numSamples++

Expand Down

0 comments on commit fc9d1ba

Please sign in to comment.