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

Function longNameFuncsProfile

internal/driver/driver_test.go:512–585  ·  view source on GitHub ↗

longNameFuncsProfile returns a profile with function names which should be shortened in graph and flame views.

()

Source from the content-addressed store, hash-verified

510// longNameFuncsProfile returns a profile with function names which should be
511// shortened in graph and flame views.
512func longNameFuncsProfile() *profile.Profile {
513 var longNameFuncsM = []*profile.Mapping{
514 {
515 ID: 1,
516 Start: 0x1000,
517 Limit: 0x4000,
518 File: "/path/to/testbinary",
519 HasFunctions: true,
520 HasFilenames: true,
521 HasLineNumbers: true,
522 HasInlineFrames: true,
523 },
524 }
525
526 var longNameFuncsF = []*profile.Function{
527 {ID: 1, Name: "path/to/package1.object.function1", SystemName: "path/to/package1.object.function1", Filename: "path/to/package1.go"},
528 {ID: 2, Name: "(anonymous namespace)::Bar::Foo", SystemName: "(anonymous namespace)::Bar::Foo", Filename: "a/long/path/to/package2.cc"},
529 {ID: 3, Name: "java.bar.foo.FooBar.run(java.lang.Runnable)", SystemName: "java.bar.foo.FooBar.run(java.lang.Runnable)", Filename: "FooBar.java"},
530 }
531
532 var longNameFuncsL = []*profile.Location{
533 {
534 ID: 1000,
535 Mapping: longNameFuncsM[0],
536 Address: 0x1000,
537 Line: []profile.Line{
538 {Function: longNameFuncsF[0], Line: 1},
539 },
540 },
541 {
542 ID: 2000,
543 Mapping: longNameFuncsM[0],
544 Address: 0x2000,
545 Line: []profile.Line{
546 {Function: longNameFuncsF[1], Line: 4},
547 },
548 },
549 {
550 ID: 3000,
551 Mapping: longNameFuncsM[0],
552 Address: 0x3000,
553 Line: []profile.Line{
554 {Function: longNameFuncsF[2], Line: 9},
555 },
556 },
557 }
558
559 return &profile.Profile{
560 PeriodType: &profile.ValueType{Type: "cpu", Unit: "milliseconds"},
561 Period: 1,
562 DurationNanos: 10e9,
563 SampleType: []*profile.ValueType{
564 {Type: "samples", Unit: "count"},
565 {Type: "cpu", Unit: "milliseconds"},
566 },
567 Sample: []*profile.Sample{
568 {
569 Location: []*profile.Location{longNameFuncsL[0], longNameFuncsL[1], longNameFuncsL[2]},

Callers 2

FetchMethod · 0.85
TestProfileCopierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…