cmd/bench: print pkg and shortname tags for Sweet benchmark results

Without these, perf.golang.org gets confused. The tags from bent runs
get applied to Sweet benchmarks.

Change-Id: I975526bfd9feb7015f1f88206b7cacfbc487addf
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/384974
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
diff --git a/cmd/bench/sweet.go b/cmd/bench/sweet.go
index a021792..14da3e1 100644
--- a/cmd/bench/sweet.go
+++ b/cmd/bench/sweet.go
@@ -11,6 +11,7 @@
 	"os"
 	"os/exec"
 	"path/filepath"
+	"strings"
 
 	"golang.org/x/benchmarks/sweet/common"
 )
@@ -136,6 +137,12 @@
 		}
 		fmt.Printf("toolchain: %s\n", tc.Name)
 		for _, match := range matches {
+			// Print pkg and shortname tags because Sweet won't do it.
+			benchName := filepath.Base(filepath.Dir(match))
+			fmt.Printf("pkg: golang.org/x/benchmarks/sweet/benchmarks/%s\n", benchName)
+			fmt.Printf("shortname: sweet_%s\n", strings.ReplaceAll(benchName, "-", "_"))
+
+			// Dump results file.
 			f, err := os.Open(match)
 			if err != nil {
 				return fmt.Errorf("opening result %s: %v", match, err)