Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for cpuHog2 (0.23 sec)

  1. src/runtime/pprof/pprof_test.go

    // otherwise under race detector the samples will be in the race runtime.
    func cpuHog1(x int) int {
    	return cpuHog0(x, 1e5)
    }
    
    func cpuHog0(x, n int) int {
    	foo := x
    	for i := 0; i < n; i++ {
    		if foo > 0 {
    			foo *= foo
    		} else {
    			foo *= foo + 1
    		}
    	}
    	return foo
    }
    
    func cpuHog2(x int) int {
    	foo := x
    	for i := 0; i < 1e5; i++ {
    		if foo > 0 {
    			foo *= foo
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 68.8K bytes
    - Viewed (0)
  2. src/internal/trace/testdata/testprog/cpu-profile.go

    // The actual CPU hogging function.
    // Must not call other functions nor access heap/globals in the loop,
    // otherwise under race detector the samples will be in the race runtime.
    func cpuHog1(x int) int {
    	return cpuHog0(x, 1e5)
    }
    
    func cpuHog0(x, n int) int {
    	foo := x
    	for i := 0; i < n; i++ {
    		if i%1000 == 0 {
    			// Spend time in mcall, stored as gp.m.curg, with g0 running
    			runtime.Gosched()
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  3. src/cmd/trace/testdata/testprog/main.go

    	}
    	done <- err
    }
    
    func cpu10(wg *sync.WaitGroup) {
    	defer wg.Done()
    	cpuHog(10 * time.Millisecond)
    }
    
    func cpu20(wg *sync.WaitGroup) {
    	defer wg.Done()
    	cpuHog(20 * time.Millisecond)
    }
    
    func cpuHog(dt time.Duration) {
    	start := time.Now()
    	for i := 0; ; i++ {
    		if i%1000 == 0 && time.Since(start) > dt {
    			return
    		}
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 17:15:58 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. src/runtime/crash_cgo_test.go

    		}
    	}
    }
    
    func TestCgoPprof(t *testing.T) {
    	testCgoPprof(t, "", "CgoPprof", "cpuHog", "runtime.main")
    }
    
    func TestCgoPprofPIE(t *testing.T) {
    	testCgoPprof(t, "-buildmode=pie", "CgoPprof", "cpuHog", "runtime.main")
    }
    
    func TestCgoPprofThread(t *testing.T) {
    	testCgoPprof(t, "", "CgoPprofThread", "cpuHogThread", "cpuHogThread2")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 16:44:47 UTC 2024
    - 22.2K bytes
    - Viewed (0)
  5. src/cmd/trace/testdata/go122.test

    String id=68
    	data="runtime.asyncPreempt"
    String id=69
    	data="/usr/local/google/home/mknyszek/work/go-1/src/runtime/preempt_amd64.s"
    String id=70
    	data="main.cpuHog"
    String id=71
    	data="main.main.func1"
    String id=72
    	data="runtime.gcMarkDone"
    String id=73
    	data="/usr/local/google/home/mknyszek/work/go-1/src/runtime/mgc.go"
    String id=74
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 17:15:58 UTC 2024
    - 166K bytes
    - Viewed (0)
Back to top