]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: adjust PGO debug output slightly
authorCherry Mui <cherryyz@google.com>
Mon, 7 Nov 2022 22:05:33 +0000 (17:05 -0500)
committerCherry Mui <cherryyz@google.com>
Tue, 8 Nov 2022 18:10:43 +0000 (18:10 +0000)
- 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 <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/inline/inl.go

index be4773ab2803e5dbd35922fddaef488c3af9233b..6aaecfc7c62798fd153c49cbb90eb9162f528730 100644 (file)
@@ -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