// hasCPUFreq returns if the system has cpufreq information:
12383
func (prof *Profiler) hasCPUFreq() bool {
	_, err := os.Stat(filepath.Join(prof.cpuPath, CPUFreq))
	if err == nil {
		return true
	}
	return false
}
572096
func (c *engineIPC) HAStatus() (*seesaw.HAStatus, error) {
	var ha seesaw.HAStatus
	if err := c.client.Call("SeesawEngine.HAStatus", c.ctx, &ha); err != nil {
		return nil, err
	}
	return &ha, nil
}
472505
func (p *staticPolicy) assignableCPUs(s state.State) cpuset.CPUSet {
	return s.GetDefaultCPUSet().Difference(p.reserved)
}
811611
func (Ctx *Context) GetMaxCpus() (maxCpus int, err error) {
	err = Ctx.CheckOpen()
	if err != nil {
		return
	}

	ret := C.libxl_get_max_cpus(Ctx.ctx)
	if ret < 0 {
		err = Error(-ret)
		return
	}
	maxCpus = int(ret)
	return
}
1353234
func (s *VPCRouterSetting) HasL2TPIPsecServer() bool {
	return s.L2TPIPsecServer != nil && s.L2TPIPsecServer.Config != nil
}
520775
func (v *VPCRouter) HasDHCPStaticMapping() bool {
	return v.HasSetting() && v.Settings.Router.HasDHCPStaticMapping()
}
708311
func StartCPUProfile() error {
	if inCPUProfile {
		return errors.New("CPU profile has alreday been started!")
	}
	inCPUProfile = true

	os.MkdirAll(profilePath, os.ModePerm)
	f, err := os.Create(path.Join(profilePath, "cpu-"+com.ToStr(pid)+".pprof"))
	if err != nil {
		panic("fail to record CPU profile: " + err.Error())
	}
	pprof.StartCPUProfile(f)
	return nil
}
1109318
func (c *Call) isPreReq(other *Call) bool {
	for _, preReq := range c.preReqs {
		if other == preReq || preReq.isPreReq(other) {
			return true
		}
	}
	return false
}
443010
func (s *Container) SetCpu(v string) *Container {
	s.Cpu = &v
	return s
}
349422
func hasGperftoolsSuffix(path string) bool {
	suffixes := []string{
		"/pprof/heap",
		"/pprof/growth",
		"/pprof/profile",
		"/pprof/pmuprofile",
		"/pprof/contention",
	}
	for _, s := range suffixes {
		if strings.HasSuffix(path, s) {
			return true
		}
	}
	return false
}
745966
func (p *processorListener) shouldResync(now time.Time) bool {
	p.resyncLock.Lock()
	defer p.resyncLock.Unlock()

	if p.resyncPeriod == 0 {
		return false
	}

	return now.After(p.nextResync) || now.Equal(p.nextResync)
}
336066
func (client *peerRESTClient) CPULoadInfo() (info ServerCPULoadInfo, err error) {
	respBody, err := client.call(peerRESTMethodCPULoadInfo, nil, nil, -1)
	if err != nil {
		return
	}
	defer http.DrainBody(respBody)
	err = gob.NewDecoder(respBody).Decode(&info)
	return info, err
}
554007
func (s *RegisterTaskDefinitionInput) SetCpu(v string) *RegisterTaskDefinitionInput {
	s.Cpu = &v
	return s
}
673138
func CpuInfo(cpu int, property string) string {
	if cpuInfo == nil {
		loadCpuInfo()
	}

	return cpuInfo[fmt.Sprintf("%d:%s", cpu, property)]
}
1274870
func HasFsckFunc(ctx context.Context) bool {
	imf, ok := ctx.Value(ctxKeyFsckFunc).(store.FsckCallback)
	return ok && imf != nil
}
913613
func (cb *CacheBuilder) LoaderExpireFunc(loaderExpireFunc LoaderExpireFunc) *CacheBuilder {
	cb.loaderExpireFunc = loaderExpireFunc
	return cb
}
1082960
func WrapProcessorFunc(f func(fin string) string) ProcessorFunc {
	return func(in string) (string, bool) {
		return f(in), true
	}
}