From 63a10e1edcda12d172f6c72de9b5f232251d4783 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 18 Mar 2020 11:00:29 -0700 Subject: [PATCH] Remove command filter from report --- cmd/gapit/benchmark.go | 3 +- cmd/gapit/flags.go | 1 - cmd/gapit/report.go | 13 ++------ cmd/smoketests/main.go | 1 - .../src/main/com/google/gapid/util/Paths.java | 2 +- gapis/resolve/get_set_test.go | 2 +- gapis/resolve/report.go | 32 ++++++------------- gapis/service/path/path.go | 4 +-- gapis/service/path/path.proto | 2 -- test/integration/service/service_test.go | 2 +- 10 files changed, 18 insertions(+), 44 deletions(-) diff --git a/cmd/gapit/benchmark.go b/cmd/gapit/benchmark.go index a94d6dad0..9464e9425 100644 --- a/cmd/gapit/benchmark.go +++ b/cmd/gapit/benchmark.go @@ -204,14 +204,13 @@ func (verb *benchmarkVerb) Run(ctx context.Context, flags flag.FlagSet) error { go func() { ctx := status.Start(oldCtx, "Getting Report") defer status.Finish(ctx) - filter := &path.CommandFilter{} _, err := client.Get(ctx, c.Commands().Path(), resolveConfig) if err != nil { panic(err) } - _, err = client.Get(ctx, c.Report(device, filter, false).Path(), resolveConfig) + _, err = client.Get(ctx, c.Report(device, false).Path(), resolveConfig) wg.Done() }() diff --git a/cmd/gapit/flags.go b/cmd/gapit/flags.go index c81963b19..e9b3c4622 100644 --- a/cmd/gapit/flags.go +++ b/cmd/gapit/flags.go @@ -184,7 +184,6 @@ type ( Gapir GapirFlags Out string `help:"output report path"` DisplayToSurface bool `help:"display the frames rendered in the replay back to the surface"` - CommandFilterFlags CaptureFileFlags } ExportReplayFlags struct { diff --git a/cmd/gapit/report.go b/cmd/gapit/report.go index 4bdb901ce..7d89f5695 100644 --- a/cmd/gapit/report.go +++ b/cmd/gapit/report.go @@ -32,11 +32,7 @@ import ( type reportVerb struct{ ReportFlags } func init() { - verb := &reportVerb{ - ReportFlags: ReportFlags{ - CommandFilterFlags: CommandFilterFlags{}, - }, - } + verb := &reportVerb{} app.AddVerb(&app.Verb{ Name: "report", ShortHelp: "Check a capture replays without issues", @@ -85,18 +81,13 @@ func (verb *reportVerb) Run(ctx context.Context, flags flag.FlagSet) error { return err } - filter, err := verb.commandFilter(ctx, client, capturePath) - if err != nil { - return log.Err(ctx, err, "Failed to build the CommandFilter") - } - boxedCommands, err := client.Get(ctx, capturePath.Commands().Path(), nil) if err != nil { return log.Err(ctx, err, "Failed to acquire the capture's commands") } commands := boxedCommands.(*service.Commands).List - boxedReport, err := client.Get(ctx, capturePath.Report(device, filter, verb.DisplayToSurface).Path(), nil) + boxedReport, err := client.Get(ctx, capturePath.Report(device, verb.DisplayToSurface).Path(), nil) if err != nil { return log.Err(ctx, err, "Failed to acquire the capture's report") } diff --git a/cmd/smoketests/main.go b/cmd/smoketests/main.go index f541a0d47..5afe4f596 100644 --- a/cmd/smoketests/main.go +++ b/cmd/smoketests/main.go @@ -154,7 +154,6 @@ func testTrace(ctx context.Context, nbErr *int, gapitPath string, tracepath stri tests := [][]string{ {"commands", tracepath}, - {"commands", "-context", "0", tracepath}, {"commands", "-groupbyapi", tracepath}, {"commands", "-groupbydrawcall", tracepath}, {"commands", "-groupbyframe", tracepath}, diff --git a/gapic/src/main/com/google/gapid/util/Paths.java b/gapic/src/main/com/google/gapid/util/Paths.java index 3127c7ec5..d8d49bc43 100644 --- a/gapic/src/main/com/google/gapid/util/Paths.java +++ b/gapic/src/main/com/google/gapid/util/Paths.java @@ -1716,7 +1716,7 @@ public StringBuilder visit(Path.Report path, StringBuilder sb) { visit(path.getDevice(), sb); sb.append(']'); } - return append(sb, path.getFilter()); + return sb; } @Override diff --git a/gapis/resolve/get_set_test.go b/gapis/resolve/get_set_test.go index 62416332e..5be090d5b 100644 --- a/gapis/resolve/get_set_test.go +++ b/gapis/resolve/get_set_test.go @@ -267,7 +267,7 @@ func TestSet(t *testing.T) { // Test invalid sets {sB.Field("Map").MapIndex("bird"), 10.0, fmt.Errorf( - "Map at capture<%v>.commands[2].state>.Map has value of type test.Complexʳ, got type float64", p.ID.ID())}, + "Map at capture<%v>.commands[2].state.Map has value of type test.Complexʳ, got type float64", p.ID.ID())}, } { ctx := log.V{"path": test.path, "value": test.val}.Bind(ctx) diff --git a/gapis/resolve/report.go b/gapis/resolve/report.go index 70c96081d..091eae977 100644 --- a/gapis/resolve/report.go +++ b/gapis/resolve/report.go @@ -60,16 +60,6 @@ func (r *ReportResolvable) Resolve(ctx context.Context) (interface{}, error) { defer analytics.SendTiming("resolve", "report")(analytics.Size(len(c.Commands))) - sd, err := SyncData(ctx, r.Path.Capture) - if err != nil { - return nil, err - } - - filter, err := buildFilter(ctx, r.Path.Capture, r.Path.Filter, sd, r.Config) - if err != nil { - return nil, err - } - builder := service.NewReportBuilder() var currentCmd uint64 @@ -134,19 +124,17 @@ func (r *ReportResolvable) Resolve(ctx context.Context) (interface{}, error) { } } - if filter(id, cmd, state) { - for _, item := range items { - item.Tags = append(item.Tags, getCommandNameTag(cmd)) - builder.Add(ctx, item) - } - for _, issue := range issues[id] { - item := r.newReportItem(log.Severity(issue.Severity), uint64(issue.Command), - messages.ErrReplayDriver(issue.Error.Error())) - if int(issue.Command) < len(c.Commands) { - item.Tags = append(item.Tags, getCommandNameTag(c.Commands[issue.Command])) - } - builder.Add(ctx, item) + for _, item := range items { + item.Tags = append(item.Tags, getCommandNameTag(cmd)) + builder.Add(ctx, item) + } + for _, issue := range issues[id] { + item := r.newReportItem(log.Severity(issue.Severity), uint64(issue.Command), + messages.ErrReplayDriver(issue.Error.Error())) + if int(issue.Command) < len(c.Commands) { + item.Tags = append(item.Tags, getCommandNameTag(c.Commands[issue.Command])) } + builder.Add(ctx, item) } return nil }) diff --git a/gapis/service/path/path.go b/gapis/service/path/path.go index f3549c1bc..6047ec7b3 100644 --- a/gapis/service/path/path.go +++ b/gapis/service/path/path.go @@ -546,8 +546,8 @@ func (n *Capture) Resources() *Resources { } // Report returns the path node to the capture's report. -func (n *Capture) Report(d *Device, f *CommandFilter, display bool) *Report { - return &Report{Capture: n, Device: d, Filter: f, DisplayToSurface: display} +func (n *Capture) Report(d *Device, display bool) *Report { + return &Report{Capture: n, Device: d, DisplayToSurface: display} } // Messages returns the path node to the capture's messages. diff --git a/gapis/service/path/path.proto b/gapis/service/path/path.proto index e41dc8c1d..456b60114 100644 --- a/gapis/service/path/path.proto +++ b/gapis/service/path/path.proto @@ -394,8 +394,6 @@ message Report { Capture capture = 1; // The optional path to the device used to generate replay information. Device device = 2; - // The optional filter to apply to the report items. - CommandFilter filter = 3; // Whether to display the replay to the original surface while in progress. bool display_to_surface = 4; } diff --git a/test/integration/service/service_test.go b/test/integration/service/service_test.go index 79dfb069d..2630c7c65 100644 --- a/test/integration/service/service_test.go +++ b/test/integration/service/service_test.go @@ -201,7 +201,7 @@ func TestGet(t *testing.T) { {capture.Command(swapCmdIndex).MemoryAfter(0, 0x1000, 0x1000), T((*service.Memory)(nil))}, {capture.Command(drawCmdIndex).Mesh(nil), T((*api.Mesh)(nil))}, {capture.CommandTree(nil), T((*service.CommandTree)(nil))}, - {capture.Report(nil, nil, false), T((*service.Report)(nil))}, + {capture.Report(nil, false), T((*service.Report)(nil))}, {capture.Resources(), T((*service.Resources)(nil))}, } { ctx = log.V{"path": test.path}.Bind(ctx)