I can't quite figure it out. I don't think the Timeline UI does right either - as far as I can tell it just picks the first one or shows all three duplicates.

The patterns them come in as is:
[some event]
-- [some other nested event]
----- [GC from A to B, delta=Y]
----- [GC from A to B, delta=Y]
----- [GC from A to B, delta=Y]

Or all top level:
[GC from A to B, delta=Y]
[GC from A to B, delta=Y]
[GC from A to B, delta=Y]

Every once in awhile Y may be different, but by like 100 bytes (Y=7MB, next Y=7.001MB, etc)

So for now I'm just picking the first. This prevents overcounting GC time when looking at total time in the UI.