diff --git a/internal/report/report.go b/internal/report/report.go index ca0272ef..06e185a0 100644 --- a/internal/report/report.go +++ b/internal/report/report.go @@ -84,7 +84,7 @@ type Options struct { // Generate generates a report as directed by the Report. func Generate(w io.Writer, rpt *Report, obj plugin.ObjTool, ui plugin.UI) error { if rpt.unexpNegSamples { - ui.PrintErr("Profile has negative sample values.\nIf using the -base flag to compare profiles, consider using the -diff_base flag instead.") + ui.PrintErr("Profile has negative values, percentage values may be incorrect. If using -base, consider using -diff_base instead.") } o := rpt.options @@ -1254,7 +1254,7 @@ func computeTotal(prof *profile.Profile, value, meanDiv func(v []int64) int64) ( if diffTotal > 0 { total = diffTotal div = diffDiv - // negative samples are expected in diff base profiles. + // Negative samples are expected in diff base profiles. negSamples = false } if div != 0 { diff --git a/internal/report/report_test.go b/internal/report/report_test.go index d1c68db1..b4e50c60 100644 --- a/internal/report/report_test.go +++ b/internal/report/report_test.go @@ -93,7 +93,7 @@ func TestSource(t *testing.T) { var b bytes.Buffer ui := &proftest.TestUI{T: t} if tc.wantNegSampleErr { - ui.AllowRx = "Profile has negative sample values.\nIf using the -base flag to compare profiles, consider using the -diff_base flag instead." + ui.AllowRx = "Profile has negative values, percentage values may be incorrect. If using -base, consider using -diff_base instead." } if err := Generate(&b, tc.rpt, &binutils.Binutils{}, ui); err != nil { t.Fatalf("%s: %v", tc.want, err)