profcheck: implement duplicate mappings check#108
profcheck: implement duplicate mappings check#108florianl wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
Signed-off-by: Florian Lehner <dev@der-flo.net>
| if !(m.MemoryStart == 0 && m.MemoryLimit == 0) && !(m.MemoryStart < m.MemoryLimit) { | ||
| errs = errors.Join(errs, fmt.Errorf("[%d]: memory_start=%016x, memory_limit=%016x: must be both zero or start < limit", idx, m.MemoryStart, m.MemoryLimit)) | ||
| } | ||
| if c.CheckDictionaryDuplicates { |
There was a problem hiding this comment.
If this style of duplicate entry check is fine for everyone, I can apply it to the other tables as well.
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
| slices.Sort(newMapping.attrIdxs) | ||
| slices.Sort(e.attrIdxs) |
There was a problem hiding this comment.
We're doing a lot of redundant operations here (like iterating uniqMappings for every mapping, sorting e.attrIdxs repeatedly instead of once) and depending on number of mappings, it could get expensive.
Can't we switch uniqMappings to be a map instead? We can keep uniqMapping as the key if we switch attrIdxs to be a string of sorted indices.
There was a problem hiding this comment.
Can't we switch uniqMappings to be a map instead? We can keep uniqMapping as the key if we switch attrIdxs to be a string of sorted indices.
Unfortunatly it is not possible to use uniqMapping as key to a map, as uniqMapping contains a slice as a field. See https://go.dev/play/p/4-wpRA-KV3Q.
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
No description provided.