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

Function testFetchSymbols

internal/driver/driver_test.go:450–479  ·  view source on GitHub ↗
(source, post string)

Source from the content-addressed store, hash-verified

448}
449
450func testFetchSymbols(source, post string) ([]byte, error) {
451 var buf bytes.Buffer
452
453 switch source {
454 case testSourceURL(8000) + "symbolz":
455 for _, address := range strings.Split(post, "+") {
456 a, _ := strconv.ParseInt(address, 0, 64)
457 fmt.Fprintf(&buf, "%v\t", address)
458 if a-testStart > testOffset {
459 fmt.Fprintf(&buf, "wrong_source_%v_", address)
460 continue
461 }
462 fmt.Fprintf(&buf, "%#x\n", a-testStart)
463 }
464 return buf.Bytes(), nil
465 case testSourceURL(8001) + "symbolz":
466 for _, address := range strings.Split(post, "+") {
467 a, _ := strconv.ParseInt(address, 0, 64)
468 fmt.Fprintf(&buf, "%v\t", address)
469 if a-testStart < testOffset {
470 fmt.Fprintf(&buf, "wrong_source_%v_", address)
471 continue
472 }
473 fmt.Fprintf(&buf, "%#x\n", a-testStart-testOffset)
474 }
475 return buf.Bytes(), nil
476 default:
477 return nil, fmt.Errorf("unexpected source: %s", source)
478 }
479}
480
481type testSymbolzSymbolizer struct{}
482

Callers

nothing calls this directly

Calls 1

testSourceURLFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…