MCPcopy Create free account
hub / github.com/google/pprof / TestWebList

Function TestWebList

internal/report/source_test.go:30–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestWebList(t *testing.T) {
31 if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
32 t.Skip("weblist only tested on x86-64 linux")
33 }
34
35 cpu := readProfile(filepath.Join("testdata", "sample.cpu"), t)
36 rpt := New(cpu, &Options{
37 OutputFormat: WebList,
38 Symbol: regexp.MustCompile("busyLoop"),
39 SampleValue: func(v []int64) int64 { return v[1] },
40 SampleUnit: cpu.SampleType[1].Unit,
41 })
42 result, err := MakeWebList(rpt, &binutils.Binutils{}, -1)
43 if err != nil {
44 t.Fatalf("could not generate weblist: %v", err)
45 }
46 output := fmt.Sprint(result)
47
48 for _, expect := range []string{"func busyLoop", "call.*mapassign"} {
49 if match, _ := regexp.MatchString(expect, output); !match {
50 t.Errorf("weblist output does not contain '%s':\n%s", expect, output)
51 }
52 }
53}
54
55func TestSourceSyntheticAddress(t *testing.T) {
56 testSourceMapping(t, true)

Callers

nothing calls this directly

Calls 3

readProfileFunction · 0.85
MakeWebListFunction · 0.85
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…