Skip to content

Commit

Permalink
Remove command filter from report
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisforbes committed Mar 19, 2020
1 parent 85bfa46 commit 63a10e1
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 44 deletions.
3 changes: 1 addition & 2 deletions cmd/gapit/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}()

Expand Down
1 change: 0 additions & 1 deletion cmd/gapit/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 2 additions & 11 deletions cmd/gapit/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")
}
Expand Down
1 change: 0 additions & 1 deletion cmd/smoketests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion gapic/src/main/com/google/gapid/util/Paths.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gapis/resolve/get_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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<context: <nil>>.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)

Expand Down
32 changes: 10 additions & 22 deletions gapis/resolve/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})
Expand Down
4 changes: 2 additions & 2 deletions gapis/service/path/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions gapis/service/path/path.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 63a10e1

Please sign in to comment.