Skip to content

Commit

Permalink
Make Android Perfetto tracing work on Windows.
Browse files Browse the repository at this point in the history
Passing the binary data via adb doesn't quite work on Windows, so
encode the proto to base64 to make it go safely through adb.
  • Loading branch information
pmuetschard committed Jul 26, 2019
1 parent 770359c commit 9b728a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/os/android/adb/perfetto.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package adb

import (
"bufio"
"bytes"
"context"
"encoding/base64"
"io"
"strings"

Expand Down Expand Up @@ -56,8 +56,8 @@ func (b *binding) StartPerfettoTrace(ctx context.Context, config *perfetto_pb.Tr
}
})

process, err := b.Shell("perfetto", "-c", "-", "-o", out).
Read(bytes.NewReader(data)).
process, err := b.Shell("base64", "-d", "|", "perfetto", "-c", "-", "-o", out).
Read(strings.NewReader(base64.StdEncoding.EncodeToString(data))).
Capture(stdout, stdout).
Start(ctx)
if err != nil {
Expand Down

0 comments on commit 9b728a8

Please sign in to comment.