]> Cypherpunks repositories - gostls13.git/commitdiff
internal/trace: actually add experimental data to map
authorMichael Pratt <mpratt@google.com>
Wed, 29 May 2024 04:35:53 +0000 (04:35 +0000)
committerMichael Pratt <mpratt@google.com>
Thu, 30 May 2024 22:14:45 +0000 (22:14 +0000)
addExperimentalData was missing actually placing the data into the map,
leaving ExperimentalEvent.Data always nil.

Change-Id: I1715ab11eb7cfcdb982b56be28378521a357ca2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/588955
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/internal/trace/generation.go

index c67bfdba1693e0818a8213c6bf8b9b7aa131444a..098d1d4f23949d603878d5e6e808e235f63b2fbf 100644 (file)
@@ -162,6 +162,9 @@ func processBatch(g *generation, b batch) error {
                }
                g.freq = freq
        case b.exp != event.NoExperiment:
+               if g.expData == nil {
+                       g.expData = make(map[event.Experiment]*ExperimentalData)
+               }
                if err := addExperimentalData(g.expData, b); err != nil {
                        return err
                }
@@ -437,6 +440,7 @@ func addExperimentalData(expData map[event.Experiment]*ExperimentalData, b batch
        ed, ok := expData[b.exp]
        if !ok {
                ed = new(ExperimentalData)
+               expData[b.exp] = ed
        }
        ed.Batches = append(ed.Batches, ExperimentalBatch{
                Thread: b.m,