aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-12-19 23:49:11 +0100
committerTaras Madan <tarasmadan@google.com>2024-12-20 08:49:58 +0000
commit49cfeac8a68105a32e4d9bb4e06d1b80e6b0657f (patch)
tree20aaf0a269f8e1fdc470b68a2b230e00fa44e41c /tools
parent0f61b4150f69bfee656d0398f8b4125a66a9512f (diff)
tools/syz-covermerger: specify to-gcs destination
It allows to skip communication with dashboard and test merge+"upload to gcs". + Trim gs:// prefix. It is a convenient way to specify target address.
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-covermerger/syz_covermerger.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/syz-covermerger/syz_covermerger.go b/tools/syz-covermerger/syz_covermerger.go
index 9814f6ce7..f125309ba 100644
--- a/tools/syz-covermerger/syz_covermerger.go
+++ b/tools/syz-covermerger/syz_covermerger.go
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"runtime"
+ "strings"
"cloud.google.com/go/civil"
"github.com/google/syzkaller/dashboard/dashapi"
@@ -32,6 +33,7 @@ var (
flagDashboardClientName = flag.String("dashboard-client-name", "coverage-merger", "[optional]")
flagSrcProvider = flag.String("provider", "git-clone", "[optional] git-clone or web-git")
flagFilePathPrefix = flag.String("file-path-prefix", "", "[optional] kernel file path prefix")
+ flagToGCS = flag.String("to-gcs", "", "[optional] gcs destination to save jsonl to")
)
func makeProvider() covermerger.FileVersProvider {
@@ -84,7 +86,7 @@ func do() error {
panic(fmt.Sprintf("failed to dbReader.Reader: %v", errReader.Error()))
}
var wc io.WriteCloser
- var url string
+ url := *flagToGCS
if *flagToDashAPI != "" {
dash, err := dashapi.New(*flagDashboardClientName, *flagToDashAPI, "")
if err != nil {
@@ -94,12 +96,14 @@ func do() error {
if err != nil {
return fmt.Errorf("dash.CreateUploadURL: %w", err)
}
+ }
+ if url != "" {
gcsClient, err := gcs.NewClient(context.Background())
if err != nil {
return fmt.Errorf("gcs.NewClient: %w", err)
}
defer gcsClient.Close()
- wc, err = gcsClient.FileWriter(url)
+ wc, err = gcsClient.FileWriter(strings.TrimPrefix(url, "gs://"))
if err != nil {
return fmt.Errorf("gcsClient.FileWriter: %w", err)
}