Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions Android.bp

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ perfetto_cc_library(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_cpp",
Expand Down Expand Up @@ -303,6 +305,7 @@ perfetto_cc_binary(
":protos_perfetto_config_priority_boost_cpp",
":protos_perfetto_config_process_stats_cpp",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_sys_stats_cpp",
":protos_perfetto_config_system_info_cpp",
Expand Down Expand Up @@ -475,6 +478,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -681,6 +685,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -780,6 +785,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -851,6 +857,8 @@ perfetto_cc_binary(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_cpp",
Expand Down Expand Up @@ -982,6 +990,8 @@ perfetto_cc_library(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_cpp",
Expand Down Expand Up @@ -5128,6 +5138,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand Down Expand Up @@ -5207,6 +5218,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand Down Expand Up @@ -5691,6 +5703,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero_h",
":protos_perfetto_config_process_stats_zero_h",
":protos_perfetto_config_profiling_zero_h",
":protos_perfetto_config_qnx_zero_h",
":protos_perfetto_config_statsd_zero_h",
":protos_perfetto_config_sys_stats_zero_h",
":protos_perfetto_config_system_info_zero_h",
Expand Down Expand Up @@ -5731,6 +5744,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -5905,6 +5919,7 @@ perfetto_cc_protocpp_library(
":protos_perfetto_config_process_stats_cpp",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_sys_stats_cpp",
":protos_perfetto_config_system_info_cpp",
Expand Down Expand Up @@ -6185,13 +6200,46 @@ perfetto_proto_library(
":protos_perfetto_config_priority_boost_protos",
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
":protos_perfetto_config_track_event_protos",
],
)

# GN target: //protos/perfetto/config/qnx:cpp
perfetto_cc_protocpp_library(
name = "protos_perfetto_config_qnx_cpp",
deps = [
":protos_perfetto_common_cpp",
":protos_perfetto_config_qnx_protos",
],
)

# GN target: //protos/perfetto/config/qnx:source_set
perfetto_proto_library(
name = "protos_perfetto_config_qnx_protos",
srcs = [
"protos/perfetto/config/qnx/qnx_config.proto",
],
visibility = [
PERFETTO_CONFIG.proto_library_visibility,
],
deps = [
":protos_perfetto_common_protos",
],
)

# GN target: //protos/perfetto/config/qnx:zero
perfetto_cc_protozero_library(
name = "protos_perfetto_config_qnx_zero",
deps = [
":protos_perfetto_common_zero",
":protos_perfetto_config_qnx_protos",
],
)

# GN target: //protos/perfetto/config/statsd:cpp
perfetto_cc_protocpp_library(
name = "protos_perfetto_config_statsd_cpp",
Expand Down Expand Up @@ -6322,6 +6370,7 @@ perfetto_cc_protozero_library(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand All @@ -6345,6 +6394,7 @@ perfetto_cc_protocpp_library(
":protos_perfetto_config_priority_boost_cpp",
":protos_perfetto_config_process_stats_cpp",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_sys_stats_cpp",
":protos_perfetto_config_system_info_cpp",
Expand All @@ -6369,6 +6419,7 @@ perfetto_cc_ipc_library(
":protos_perfetto_config_priority_boost_cpp",
":protos_perfetto_config_process_stats_cpp",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_sys_stats_cpp",
":protos_perfetto_config_system_info_cpp",
Expand Down Expand Up @@ -6402,6 +6453,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand Down Expand Up @@ -7164,6 +7216,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand All @@ -7186,6 +7239,7 @@ perfetto_cc_protozero_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -7226,6 +7280,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand Down Expand Up @@ -7271,6 +7326,7 @@ perfetto_cc_protozero_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -7441,6 +7497,7 @@ perfetto_proto_library(
":protos_perfetto_config_process_stats_protos",
":protos_perfetto_config_profiling_protos",
":protos_perfetto_config_protos",
":protos_perfetto_config_qnx_protos",
":protos_perfetto_config_statsd_protos",
":protos_perfetto_config_sys_stats_protos",
":protos_perfetto_config_system_info_protos",
Expand Down Expand Up @@ -7866,6 +7923,8 @@ perfetto_cc_library(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_cpp",
Expand Down Expand Up @@ -7967,6 +8026,8 @@ perfetto_cc_binary(
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_cpp",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_cpp",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_cpp",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_cpp",
Expand Down Expand Up @@ -8147,6 +8208,7 @@ perfetto_cc_library(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down Expand Up @@ -8367,6 +8429,7 @@ perfetto_cc_binary(
":protos_perfetto_config_priority_boost_zero",
":protos_perfetto_config_process_stats_zero",
":protos_perfetto_config_profiling_zero",
":protos_perfetto_config_qnx_zero",
":protos_perfetto_config_statsd_zero",
":protos_perfetto_config_sys_stats_zero",
":protos_perfetto_config_system_info_zero",
Expand Down
6 changes: 6 additions & 0 deletions buildtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,12 @@ config("upb_config") {
"protobuf/upb/reflection/stage0", # For pre-generated descriptor.upb.h
"protobuf/third_party/utf8_range", # For utf8_range.h
]
if (is_gcc) {
cflags = [
"-Wno-stringop-overread",
"-Wno-stringop-overflow",
]
}
defines = [ "UPB_BOOTSTRAP_STAGE=0" ] # Use stage0 minitable functions
}

Expand Down
3 changes: 3 additions & 0 deletions gn/standalone/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ config("release") {
cflags = [ "-O2" ]
} else if (is_fuzzer) {
cflags = [ "-O1" ]
} else if (is_qnx && current_cpu == "x64") {
# -02 on x64 causes on QNX8.0 x86_64 -Wno-error=alloc-size-larger-than
cflags = [ "-O1" ]
} else {
cflags = [ "-O3" ]
}
Expand Down
11 changes: 9 additions & 2 deletions gn/standalone/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ declare_args() {
_target_triplet = "x86_64-linux-android"
} else if (target_os == "qnx" && target_cpu == "arm64") {
_target_triplet = "ntoaarch64"
} else if (target_os == "qnx" && target_cpu == "x64") {
_target_triplet = "ntox86_64"
} else {
assert(
false,
Expand Down Expand Up @@ -194,10 +196,15 @@ declare_args() {
target_strip = "$android_llvm_dir/bin/llvm-strip"
} else if (is_qnx) {
target_ar = "${_target_triplet}-ar"
target_cc = "qcc -V8.3.0,gcc_${_target_triplet}le"
target_cxx = "q++ -V8.3.0,gcc_${_target_triplet}le_cxx"
target_linker = "${_target_triplet}-ld"
target_strip = "${_target_triplet}-strip"
if (target_cpu == "arm64") {
target_cc = "qcc -Vgcc_${_target_triplet}le"
target_cxx = "q++ -Vgcc_${_target_triplet}le_cxx"
} else {
target_cc = "qcc -Vgcc_${_target_triplet}"
target_cxx = "q++ -Vgcc_${_target_triplet}_cxx"
}
} else {
assert(_target_triplet != "",
"target_triplet must be non-empty when cross-compiling")
Expand Down
1 change: 1 addition & 0 deletions include/perfetto/ext/base/sys_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#if !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC)
// MinGW has these. clang-cl and MSVC, which use just the Windows SDK, don't.
using uid_t = int;
using gid_t = int;
using pid_t = int;
#endif // !GCC

Expand Down
1 change: 1 addition & 0 deletions protos/perfetto/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ perfetto_proto_library("@TYPE@") {
"priority_boost:@TYPE@",
"process_stats:@TYPE@",
"profiling:@TYPE@",
"qnx:@TYPE@",
"statsd:@TYPE@",
"sys_stats:@TYPE@",
"system_info:@TYPE@",
Expand Down
4 changes: 4 additions & 0 deletions protos/perfetto/config/data_source_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import "protos/perfetto/config/test_config.proto";
import "protos/perfetto/config/track_event/track_event_config.proto";
import "protos/perfetto/config/system_info/system_info_config.proto";
import "protos/perfetto/config/chrome/histogram_samples.proto";
import "protos/perfetto/config/qnx/qnx_config.proto";

// The configuration that is passed to each data source when starting tracing.
// Next id: 140
Expand Down Expand Up @@ -285,6 +286,9 @@ message DataSourceConfig {
// Data source name: android.inputmethod
optional InputMethodConfig inputmethod_config = 139 [lazy = true];

// Data source name: qnx.kernel
optional QnxConfig qnx_config = 150 [lazy = true];

// This is a fallback mechanism to send a free-form text config to the
// producer. In theory this should never be needed. All the code that
// is part of the platform (i.e. traced service) is supposed to *not* truncate
Expand Down
37 changes: 37 additions & 0 deletions protos/perfetto/config/perfetto_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,40 @@ message PerfEventConfig {

// End of protos/perfetto/config/profiling/perf_event_config.proto

// Begin of protos/perfetto/config/qnx/qnx_config.proto

// QnxConfig is used with trace_qnx_probes build from
// https://github.com/qnx-ports/perfetto
message QnxConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

@primiano are you okay with QNX providing a description to the proto and a link to the traced_qnx_probes repo. I think having a link to the actual source code would provide very meaningful context to this proto.

If not here then it would be nice for a reference to QNX's traced_qnx_probes repo to exists within the Perfetto repo, so that it is possible to go deeper into QNX's integration of Perfetto.

Copy link
Author

Choose a reason for hiding this comment

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

From our side I think this is a great idea, but will wait for confirmation before integrating the change.

Copy link
Author

Choose a reason for hiding this comment

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

pushed change, leaving the solution generic so we won't need to update in case our branch name changes.

also still working on getting the CLA signed

Copy link
Member

Choose a reason for hiding this comment

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

@primiano are you okay with QNX providing a description to the proto and a link to the traced_qnx_probes repo. I think having a link to the actual source code would provide very meaningful context to this proto.

Yeah aboslutely. I think it's great to be able to see where this comes from.

// The number of buffers that tracelog will init for the QNX trace.
optional uint32 qnx_kernel_buffers = 1;

// The number of kernel buffers that tracelog will init for the QNX trace.
optional uint32 qnx_kernel_kbuffers = 2;

// Flag indicating whether the QNX kernel tracing should produce wide
// events which contain additional data or fast events which are most
// concise. In fast mode we lose the priority information
optional bool qnx_kernel_wide_events = 3;

// The number of pages initialized by default the parser's page cache.
optional uint32 qnx_cache_pages = 4;

// The max pages the page cache should allocate (must be at least as big)
// as the qnx_cache_pages value. Using -1 will allow the cache to grow
// unbounded. The cache will prefer to re-use existing pages so growth will
// only happen when needed (when parser is not keeping up).
optional int32 qnx_cache_max_pages = 5;

// The initial size of the the buffer used to hold the trace header values
// this dynamic buffer will grow as needed but reallocs can be avoided by
// selecting an initial size large enough to hold all the initial header
// data.
optional uint32 qnx_trace_buffer_init_bytes = 6;
}

// End of protos/perfetto/config/qnx/qnx_config.proto

// Begin of protos/perfetto/config/statsd/atom_ids.proto

// This enum is obtained by post-processing
Expand Down Expand Up @@ -4270,6 +4304,9 @@ message DataSourceConfig {
// Data source name: android.inputmethod
optional InputMethodConfig inputmethod_config = 139 [lazy = true];

// Data source name: qnx.kernel
optional QnxConfig qnx_config = 150 [lazy = true];

// This is a fallback mechanism to send a free-form text config to the
// producer. In theory this should never be needed. All the code that
// is part of the platform (i.e. traced service) is supposed to *not* truncate
Expand Down
Loading
Loading