From 33c578d57fd4e14c1d45e8176c1135d6165592e6 Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Fri, 5 Apr 2019 16:54:05 -0700 Subject: [PATCH] Add dropped code review changes from #2696 - drop the magic window size constant and simply use Perfetto's default. - Remove a TODO comment --- gapis/perfetto/cc/processor.cpp | 5 +---- gapis/perfetto/cc/processor.h | 2 +- gapis/perfetto/processor.go | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gapis/perfetto/cc/processor.cpp b/gapis/perfetto/cc/processor.cpp index edfae1ea11..38fb163f30 100644 --- a/gapis/perfetto/cc/processor.cpp +++ b/gapis/perfetto/cc/processor.cpp @@ -28,16 +28,13 @@ namespace pp = perfetto::protos; // Callback back into go. extern "C" void on_query_complete(int id, void* data, long unsigned int size); -processor new_processor(uint64_t window_size_ns) { +processor new_processor() { ptp::Config config; - config.window_size_ns = window_size_ns; - return ptp::TraceProcessor::CreateInstance(config).release(); } bool parse_data(processor processor, const void* data, size_t size) { ptp::TraceProcessor* p = static_cast(processor); - // TODO: do we need this copy? std::unique_ptr buf(new uint8_t[size]); memcpy(buf.get(), data, size); if (!p->Parse(std::move(buf), size)) { diff --git a/gapis/perfetto/cc/processor.h b/gapis/perfetto/cc/processor.h index f78929ccd6..604f0c0f62 100644 --- a/gapis/perfetto/cc/processor.h +++ b/gapis/perfetto/cc/processor.h @@ -27,7 +27,7 @@ extern "C" { typedef void* processor; -processor new_processor(uint64_t window_size_ns); +processor new_processor(); bool parse_data(processor processor, const void* data, size_t size); void execute_query(processor processor, int id, const char* query); void delete_processor(processor processor); diff --git a/gapis/perfetto/processor.go b/gapis/perfetto/processor.go index 616484385a..903b35189d 100644 --- a/gapis/perfetto/processor.go +++ b/gapis/perfetto/processor.go @@ -47,7 +47,7 @@ type Result struct { } func NewProcessor(ctx context.Context, data []byte) (*Processor, error) { - p := C.new_processor(60 * 1000 * 1000 * 1000) + p := C.new_processor() log.D(ctx, "[perfetto] Parsing %d bytes", len(data)) if !C.parse_data(p, unsafe.Pointer(&data[0]), C.size_t(len(data))) { log.W(ctx, "[perfetto] Parsing failed")