Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Perfetto Support in GAPIS #2696

Merged
merged 6 commits into from Apr 4, 2019

Conversation

pmuetschard
Copy link
Member

  • adds the Perfetto repository, build rules to build the config proto and trace processor along with its dependency sqlite.
  • adds some of the scaffolding for taking a Perfetto trace in GAPIS (not yet exposed to the GAPIS API, though)
  • adds support for opening a Perfetto trace in GAPIS via the API
  • adds a GAPIS API to run queries against a Perfetto trace

bool parse_data(processor processor, const void* data, size_t size) {
ptp::TraceProcessor* p = static_cast<ptp::TraceProcessor*>(processor);
// TODO: do we need this copy?
std::unique_ptr<uint8_t[]> buf(new uint8_t[size]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eww this is an ugly API.

virtual bool Parse(std::unique_ptr<uint8_t[]>, size_t) = 0;

You will need the copy unless we can allocate the data with new but I think this is meant to be exported to go, so the data is coming from "magic place"

}

func NewProcessor(ctx context.Context, data []byte) (*Processor, error) {
p := C.new_processor(60 * 1000 * 1000 * 1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name this magic constant?

)

const (
perfettoTraceFile = "/data/misc/perfetto-traces/gapis-trace"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the path on the Android device where we are putting the trace?

@@ -68,6 +68,30 @@ message Devices {
message Events {
repeated Event list = 1;
}
// This needs to be binary compatible with perfetto.protos.RawQueryResult.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way we can check this at build-time?

@pmuetschard pmuetschard force-pushed the perfetto_back branch 6 times, most recently from c38f638 to b8271e5 Compare April 3, 2019 22:54
@pmuetschard pmuetschard merged commit a492101 into google:master Apr 4, 2019
@pmuetschard pmuetschard deleted the perfetto_back branch April 4, 2019 19:34
pmuetschard added a commit to pmuetschard/gapid that referenced this pull request Apr 5, 2019
- drop the magic window size constant and simply use Perfetto's default.
- Remove a TODO comment
pmuetschard added a commit to pmuetschard/gapid that referenced this pull request Apr 5, 2019
- drop the magic window size constant and simply use Perfetto's default.
- Remove a TODO comment
pmuetschard added a commit that referenced this pull request Apr 10, 2019
- drop the magic window size constant and simply use Perfetto's default.
- Remove a TODO comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants