code: func (p *Profiler) Start() error {
  	if p.Dir == "" {
  		if p.ProfileCPU {
  			return errors.New("-profile-cpu requires -profile-output-dir to be set")
  		}
  		if p.ProfileHeap {
  			return errors.New("-profile-heap requires -profile-output-dir to be set")
  		}
  	}
  
  	if p.ProfileCPU {
  		out, err := os.Create(p.generateOutPath("cpu"))
  		if err != nil {
  			return errors.Annotate(err, "failed to create CPU profile output file").Err()
  		}
  		pprof.StartCPUProfile(out)
  		p.profilingCPU = true
  	}
  
  	if p.BindHTTP != "" {
  		if err := p.startHTTP(); err != nil {
  			return errors.Annotate(err, "failed to start HTTP server").Err()
  		}
  	}
  
  	return nil
  }
docs: // Start starts the Profiler's configured operations.  On success, returns a
  // function that can be called to shutdown the profiling server.
  //
  // Calling Stop is not necessary, but will enable end-of-operation profiling
  // to be gathered.