benchmarks: fix usage of obsolete tracing functions

Currently it's not possible to build the project due to unstable
external API introduced in one of the recent patches.

As for Go 1.5, execution tracing is implemented in a separate
package named "trace". Signature of functions has changed as well.

This patch makes tracing functionality compatible with the stable
Go 1.5 release.

Change-Id: I92959e9cbe76e5ffe4c6cba70587159d797ed1c7
Reviewed-on: https://go-review.googlesource.com/15558
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/driver/driver.go b/driver/driver.go
index 4356528..b5d307d 100644
--- a/driver/driver.go
+++ b/driver/driver.go
@@ -22,6 +22,7 @@
 	"path/filepath"
 	"runtime"
 	"runtime/pprof"
+	"runtime/trace"
 	"sort"
 	"strings"
 	"sync"
@@ -38,7 +39,7 @@
 	affinity  = flag.Int("affinity", 0, "process affinity (passed to an OS-specific function like sched_setaffinity/SetProcessAffinityMask)")
 	tmpDir    = flag.String("tmpdir", os.TempDir(), "dir for temporary files")
 	genSvg    = flag.Bool("svg", false, "generate svg profiles")
-	trace     = flag.String("trace", "", "write an execution trace to the named file after execution")
+	traceFile = flag.String("trace", "", "write an execution trace to the named file after execution")
 
 	BenchNum  int
 	BenchMem  int
@@ -81,18 +82,18 @@
 		return
 	}
 
-	if *trace != "" {
-		f, err := os.Create(*trace)
+	if *traceFile != "" {
+		f, err := os.Create(*traceFile)
 		if err != nil {
 			fmt.Fprintln(os.Stderr, err)
 			os.Exit(1)
 		}
 		defer f.Close()
-		if err := pprof.StartTrace(f); err != nil {
+		if err := trace.Start(f); err != nil {
 			fmt.Fprintf(os.Stderr, "can't start tracing: %s\n", err)
 			os.Exit(1)
 		}
-		defer pprof.StopTrace()
+		defer trace.Stop()
 	}
 
 	res := f()