Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: fuzzer/go/generator/afl_generation.go

Issue 1722163002: Metrics2: Store a registry of Counters (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fuzzer/go/aggregator/aggregator.go ('k') | go/buildbot/local_db.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package generator 1 package generator
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io/ioutil" 5 "io/ioutil"
6 "os" 6 "os"
7 "path/filepath" 7 "path/filepath"
8 "strings" 8 "strings"
9 9
10 "github.com/skia-dev/glog" 10 "github.com/skia-dev/glog"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 fuzzCount := config.Generator.NumBinaryFuzzProcesses 60 fuzzCount := config.Generator.NumBinaryFuzzProcesses
61 if strings.HasPrefix(g.Category, "api_") { 61 if strings.HasPrefix(g.Category, "api_") {
62 fuzzCount = config.Generator.NumAPIFuzzProcesses 62 fuzzCount = config.Generator.NumAPIFuzzProcesses
63 } 63 }
64 if fuzzCount <= 0 { 64 if fuzzCount <= 0 {
65 // TODO(kjlubick): Make this actually an intelligent number base d on the number of cores. 65 // TODO(kjlubick): Make this actually an intelligent number base d on the number of cores.
66 fuzzCount = 4 66 fuzzCount = 4
67 } 67 }
68 68
69 » g.fuzzProcessCount = metrics2.NewCounter("afl-fuzz-process-count", map[s tring]string{"category": g.Category}) 69 » g.fuzzProcessCount = metrics2.GetCounter("afl-fuzz-process-count", map[s tring]string{"category": g.Category})
70 g.fuzzProcessCount.Inc(int64(fuzzCount)) 70 g.fuzzProcessCount.Inc(int64(fuzzCount))
71 for i := 1; i < fuzzCount; i++ { 71 for i := 1; i < fuzzCount; i++ {
72 fuzzerName := fmt.Sprintf("fuzzer%d", i) 72 fuzzerName := fmt.Sprintf("fuzzer%d", i)
73 slaveCmd := &exec.Command{ 73 slaveCmd := &exec.Command{
74 Name: "./afl-fuzz", 74 Name: "./afl-fuzz",
75 Args: common.GenerationArgsFor(g.Category, executab le, fuzzerName, false), 75 Args: common.GenerationArgsFor(g.Category, executab le, fuzzerName, false),
76 Dir: config.Generator.AflRoot, 76 Dir: config.Generator.AflRoot,
77 LogStdout: true, 77 LogStdout: true,
78 LogStderr: true, 78 LogStderr: true,
79 Env: []string{"AFL_SKIP_CPUFREQ=true"}, // Avoids a warning afl-fuzz spits out about dynamic scaling of cpu frequency 79 Env: []string{"AFL_SKIP_CPUFREQ=true"}, // Avoids a warning afl-fuzz spits out about dynamic scaling of cpu frequency
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 glog.Errorf("[%s] Problem downloading %s from Google Sto rage, continuing anyway", g.Category, item.Name) 184 glog.Errorf("[%s] Problem downloading %s from Google Sto rage, continuing anyway", g.Category, item.Name)
185 return 185 return
186 } 186 }
187 fileName := filepath.Join(seedPath, strings.SplitAfter(name, gsF older)[1]) 187 fileName := filepath.Join(seedPath, strings.SplitAfter(name, gsF older)[1])
188 if err = ioutil.WriteFile(fileName, content, 0644); err != nil & & !os.IsExist(err) { 188 if err = ioutil.WriteFile(fileName, content, 0644); err != nil & & !os.IsExist(err) {
189 glog.Errorf("[%s] Problem creating binary seed file %s, continuing anyway", g.Category, fileName) 189 glog.Errorf("[%s] Problem creating binary seed file %s, continuing anyway", g.Category, fileName)
190 } 190 }
191 }) 191 })
192 return err 192 return err
193 } 193 }
OLDNEW
« no previous file with comments | « fuzzer/go/aggregator/aggregator.go ('k') | go/buildbot/local_db.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698