Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/bench.go

    rf4f79dd r2c7eee0  
    55        "flag"
    66        "fmt"
    7         "log"
    87        "os"
    98        "runtime"
    10         "runtime/pprof"
    119        "sync/atomic"
    1210        "time"
     
    4543}
    4644
    47 func bench_init() func() {
     45func bench_init() {
    4846        nprocsOpt := flag.Int("p", 1, "The number of processors")
    4947        nthreadsOpt := flag.Int("t", 1, "The number of threads")
    5048        durationOpt := flag.Float64("d", 0, "Duration of the experiment in seconds")
    5149        stopOpt := flag.Uint64("i", 0, "Duration of the experiment in iterations")
    52         cpuprofile := flag.String("cpuprofile", "", "write cpu profile to file")
    5350
    5451        flag.Parse()
     
    7572
    7673        runtime.GOMAXPROCS(nprocs)
    77 
    78         if (*cpuprofile) != "" {
    79                 f, err := os.Create(*cpuprofile)
    80                 if err != nil {
    81                     log.Fatal(err)
    82                 }
    83                 pprof.StartCPUProfile(f)
    84         }
    85 
    86         return func() {
    87                 if (*cpuprofile) != "" {
    88                         pprof.StopCPUProfile()
    89                 }
    90         }
    9174}
Note: See TracChangeset for help on using the changeset viewer.