aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-05-07 13:05:41 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-05-07 13:05:41 +0200
commitb9fea20df7dd0bd1279ae80c99f9bc9969e1fe5a (patch)
treecb9488268c091408bc5fcf8f1c282277e77ea2b4
parent757359b5ea7c593baeb8e2c9ac3d86546711ab6f (diff)
pkg/report: remove duplicated stub code
Update #538
-rw-r--r--.gometalinter.json2
-rw-r--r--pkg/report/fuchsia.go40
-rw-r--r--pkg/report/report.go6
-rw-r--r--pkg/report/stub.go (renamed from pkg/report/akaros.go)12
-rw-r--r--pkg/report/windows.go40
5 files changed, 10 insertions, 90 deletions
diff --git a/.gometalinter.json b/.gometalinter.json
index 2b0de8866..0c71cba97 100644
--- a/.gometalinter.json
+++ b/.gometalinter.json
@@ -6,7 +6,7 @@
"minconstlength": 7,
"linelength": 120,
"cyclo": 50,
- "duplthreshold": 150,
+ "duplthreshold": 100,
"skip": [
"pkg/kd",
"sys/akaros/gen",
diff --git a/pkg/report/fuchsia.go b/pkg/report/fuchsia.go
deleted file mode 100644
index 9e75c97b7..000000000
--- a/pkg/report/fuchsia.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2017 syzkaller project authors. All rights reserved.
-// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-package report
-
-import (
- "regexp"
-
- "github.com/google/syzkaller/pkg/symbolizer"
-)
-
-type fuchsia struct {
- kernelSrc string
- kernelObj string
- symbols map[string][]symbolizer.Symbol
- ignores []*regexp.Regexp
-}
-
-func ctorFuchsia(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol,
- ignores []*regexp.Regexp) (Reporter, error) {
- ctx := &fuchsia{
- kernelSrc: kernelSrc,
- kernelObj: kernelObj,
- symbols: symbols,
- ignores: ignores,
- }
- return ctx, nil
-}
-
-func (ctx *fuchsia) ContainsCrash(output []byte) bool {
- panic("not implemented")
-}
-
-func (ctx *fuchsia) Parse(output []byte) *Report {
- panic("not implemented")
-}
-
-func (ctx *fuchsia) Symbolize(rep *Report) error {
- panic("not implemented")
-}
diff --git a/pkg/report/report.go b/pkg/report/report.go
index b632bf65e..91f2ab4e7 100644
--- a/pkg/report/report.go
+++ b/pkg/report/report.go
@@ -67,12 +67,12 @@ func NewReporter(os, kernelSrc, kernelObj string, symbols map[string][]symbolize
}
var ctors = map[string]fn{
- "akaros": ctorAkaros,
+ "akaros": ctorStub,
"linux": ctorLinux,
"freebsd": ctorFreebsd,
"netbsd": ctorNetbsd,
- "fuchsia": ctorFuchsia,
- "windows": ctorWindows,
+ "fuchsia": ctorStub,
+ "windows": ctorStub,
}
type fn func(string, string, map[string][]symbolizer.Symbol, []*regexp.Regexp) (Reporter, error)
diff --git a/pkg/report/akaros.go b/pkg/report/stub.go
index 46d20590a..04f17084a 100644
--- a/pkg/report/akaros.go
+++ b/pkg/report/stub.go
@@ -9,16 +9,16 @@ import (
"github.com/google/syzkaller/pkg/symbolizer"
)
-type akaros struct {
+type stub struct {
kernelSrc string
kernelObj string
symbols map[string][]symbolizer.Symbol
ignores []*regexp.Regexp
}
-func ctorAkaros(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol,
+func ctorStub(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol,
ignores []*regexp.Regexp) (Reporter, error) {
- ctx := &akaros{
+ ctx := &stub{
kernelSrc: kernelSrc,
kernelObj: kernelObj,
symbols: symbols,
@@ -27,14 +27,14 @@ func ctorAkaros(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Sym
return ctx, nil
}
-func (ctx *akaros) ContainsCrash(output []byte) bool {
+func (ctx *stub) ContainsCrash(output []byte) bool {
panic("not implemented")
}
-func (ctx *akaros) Parse(output []byte) *Report {
+func (ctx *stub) Parse(output []byte) *Report {
panic("not implemented")
}
-func (ctx *akaros) Symbolize(rep *Report) error {
+func (ctx *stub) Symbolize(rep *Report) error {
panic("not implemented")
}
diff --git a/pkg/report/windows.go b/pkg/report/windows.go
deleted file mode 100644
index 47573c6a5..000000000
--- a/pkg/report/windows.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2017 syzkaller project authors. All rights reserved.
-// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-package report
-
-import (
- "regexp"
-
- "github.com/google/syzkaller/pkg/symbolizer"
-)
-
-type windows struct {
- kernelSrc string
- kernelObj string
- symbols map[string][]symbolizer.Symbol
- ignores []*regexp.Regexp
-}
-
-func ctorWindows(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol,
- ignores []*regexp.Regexp) (Reporter, error) {
- ctx := &windows{
- kernelSrc: kernelSrc,
- kernelObj: kernelObj,
- symbols: symbols,
- ignores: ignores,
- }
- return ctx, nil
-}
-
-func (ctx *windows) ContainsCrash(output []byte) bool {
- panic("not implemented")
-}
-
-func (ctx *windows) Parse(output []byte) *Report {
- panic("not implemented")
-}
-
-func (ctx *windows) Symbolize(rep *Report) error {
- panic("not implemented")
-}