Chromium Code Reviews| Index: fuzzer/go/generator/afl_generation.go |
| diff --git a/fuzzer/go/generator/afl_generation.go b/fuzzer/go/generator/afl_generation.go |
| index 46f0ab52f0759e434d7f08926a1d2b6e5a35a699..d5a4da95e5ea216c267165a91f8c03ff6198e7ca 100644 |
| --- a/fuzzer/go/generator/afl_generation.go |
| +++ b/fuzzer/go/generator/afl_generation.go |
| @@ -7,19 +7,19 @@ import ( |
| "path/filepath" |
| "strings" |
| - go_metrics "github.com/rcrowley/go-metrics" |
| "github.com/skia-dev/glog" |
| "go.skia.org/infra/fuzzer/go/common" |
| "go.skia.org/infra/fuzzer/go/config" |
| "go.skia.org/infra/go/exec" |
| "go.skia.org/infra/go/fileutil" |
| "go.skia.org/infra/go/gs" |
| + "go.skia.org/infra/go/metrics2" |
| "google.golang.org/cloud/storage" |
| ) |
| type Generator struct { |
| Category string |
| - fuzzProcessCount go_metrics.Counter |
| + fuzzProcessCount *metrics2.Counter |
| fuzzProcesses []exec.Process |
| } |
| @@ -34,6 +34,10 @@ func New(category string) *Generator { |
| // n is specified by config.Generator.NumFuzzProcesses. Output goes to |
| // config.Generator.AflOutputPath/[category]. |
| func (g *Generator) Start() error { |
| + if config.Generator.SkipGeneration { |
| + glog.Info("Skipping generation because flag was set.") |
| + return nil |
| + } |
| executable, err := g.setup() |
| if err != nil { |
| return fmt.Errorf("Failed %s generator setup: %s", g.Category, err) |
| @@ -58,7 +62,7 @@ func (g *Generator) Start() error { |
| // TODO(kjlubick): Make this actually an intelligent number based on the number of cores. |
| fuzzCount = 10 |
| } |
| - g.fuzzProcessCount = go_metrics.NewRegisteredCounter("afl_fuzz_process_count", go_metrics.DefaultRegistry) |
| + g.fuzzProcessCount = metrics2.NewCounter("afl_fuzz_process_count", map[string]string{"category": g.Category}) |
|
borenet
2016/02/10 15:32:32
Dashes
kjlubick
2016/02/10 16:14:29
Done
|
| g.fuzzProcessCount.Inc(int64(fuzzCount)) |
| for i := 1; i < fuzzCount; i++ { |
| fuzzerName := fmt.Sprintf("fuzzer%d", i) |