I have created a custom track event, following the instructions on this page:
https://perfetto.dev/docs/instrumentation/track-eventsSo now I am trying to build Perfetto but it keeps failing. I am using a Ubuntu VM and trying to build for an arm64 target. However, it keeps failing because the protoc is incompatible for my host platform.
I tried copying /usr/local/bin/protoc to out/arm64_debug/gcc_like_host/ but now I get a lot of compiler issues:
FAILED: obj/out/arm64_debug/gen/protos/perfetto/common/lite.android_energy_consumer_descriptor.pb.o
../../buildtools/linux64/clang/bin/clang++ --target=aarch64-linux-gnu --sysroot=../../buildtools/debian_sid_arm64-sysroot -MMD -MF obj/out/arm64_debug/gen/protos/perfetto/common/lite.android_energy_consumer_descriptor.pb.o.d -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_DEBUG=0 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -I../../buildtools/libcxx_config -Igen -fstrict-aliasing -Wformat -g -fPIC -fstack-protector-strong -Werror -fcolor-diagnostics -fdiagnostics-show-template-tree -Wno-c99-designator -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fvisibility=hidden -O0 -funwind-tables -isystem ../../buildtools/protobuf/src -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/libcxx/include -isystem../../buildtools/libcxxabi/include -std=c++17 -c gen/protos/perfetto/common/
android_energy_consumer_descriptor.pb.cc -o obj/out/arm64_debug/gen/protos/perfetto/common/lite.android_energy_consumer_descriptor.pb.o
In file included from gen/protos/perfetto/common/
android_energy_consumer_descriptor.pb.cc:4:
gen/protos/perfetto/common/android_energy_consumer_descriptor.pb.h:17:2: error: This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^
gen/protos/perfetto/common/android_energy_consumer_descriptor.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^
gen/protos/perfetto/common/android_energy_consumer_descriptor.pb.h:19:2: error: regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^
gen/protos/perfetto/common/android_energy_consumer_descriptor.pb.h:26:10: fatal error: 'google/protobuf/generated_message_table_driven.h' file not found
26 | #include <google/protobuf/generated_message_table_driven.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
[13/3946] compile gen/protos/perfetto/common/
ftrace_descriptor.pb.ccFAILED: obj/out/arm64_debug/gen/protos/perfetto/common/lite.ftrace_descriptor.pb.o
../../buildtools/linux64/clang/bin/clang++ --target=aarch64-linux-gnu --sysroot=../../buildtools/debian_sid_arm64-sysroot -MMD -MF obj/out/arm64_debug/gen/protos/perfetto/common/lite.ftrace_descriptor.pb.o.d -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_DEBUG=0 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -I../../buildtools/libcxx_config -Igen -fstrict-aliasing -Wformat -g -fPIC -fstack-protector-strong -Werror -fcolor-diagnostics -fdiagnostics-show-template-tree -Wno-c99-designator -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fvisibility=hidden -O0 -funwind-tables -isystem ../../buildtools/protobuf/src -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/libcxx/include -isystem../../buildtools/libcxxabi/include -std=c++17 -c gen/protos/perfetto/common/
ftrace_descriptor.pb.cc -o obj/out/arm64_debug/gen/protos/perfetto/common/lite.ftrace_descriptor.pb.o
In file included from gen/protos/perfetto/common/
ftrace_descriptor.pb.cc:4:
Can you please help? What version of protoc should I be using?