From e5d2814576937162ce183d5aab09616ae13d983c Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Mon, 7 Nov 2022 17:05:33 -0500 Subject: [PATCH] cmd/compile: adjust PGO debug output slightly - Include the callee names in hot call inlining message. - Print the graph when pgoinline >= 2. Change-Id: Iceb89b5f18cefc69ab9256aca9a910743d22ec0f Reviewed-on: https://go-review.googlesource.com/c/go/+/448496 TryBot-Result: Gopher Robot Run-TryBot: Cherry Mui Reviewed-by: Michael Pratt --- src/cmd/compile/internal/inline/inl.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index be4773ab28..6aaecfc7c6 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -122,7 +122,7 @@ func pgoInlinePrologue(p *pgo.Profile) { } } }) - if base.Debug.PGOInline > 0 { + if base.Debug.PGOInline >= 2 { fmt.Printf("hot-cg before inline in dot format:") p.PrintWeightedCallGraphDOT(inlineHotCallSiteThresholdPercent) } @@ -165,7 +165,7 @@ func computeThresholdFromCDF(p *pgo.Profile) (float64, []pgo.NodeMapKey) { // pgoInlineEpilogue updates IRGraph after inlining. func pgoInlineEpilogue(p *pgo.Profile) { - if base.Debug.PGOInline > 0 { + if base.Debug.PGOInline >= 2 { ir.VisitFuncsBottomUp(typecheck.Target.Decls, func(list []*ir.Func, recursive bool) { for _, f := range list { name := ir.PkgFuncName(f) @@ -930,7 +930,7 @@ func mkinlcall(n *ir.CallExpr, fn *ir.Func, maxCost int32, inlCalls *[]*ir.Inlin return n } if base.Debug.PGOInline > 0 { - fmt.Printf("hot-budget check allows inlining for callsite at %v\n", ir.Line(n)) + fmt.Printf("hot-budget check allows inlining for call %s at %v\n", ir.PkgFuncName(fn), ir.Line(n)) } } else { // The inlined function body is too big. Typically we use this check to restrict -- 2.50.0