Closed q-p closed 2 years ago
tc.op
Ah, fun. I just saw this the other day and fixed in r.android.com/1853531
kRandomSeed
This is weird I can't repro this.
Which compiler are you using? Maybe it's too old. We build continuously with gcc-7 in ci.perfetto.dev
Anyhow, mind sending a patch if you can figure out a fix? See https://perfetto.dev/docs/contributing/getting-started
Thanks, Primiano
kRandomSeed
This is weird I can't repro this.
It seems that that (g++ 8.2) version of libstdc++ takes the seed by reference thereby resulting in the linker error as it is never defined but only declared (pre C++17).
The following fixes it for me:
diff --git a/src/trace_processor/sqlite/sqlite_vtable_benchmark.cc b/src/trace_processor/sqlite/sqlite_vtable_benchmark.cc
index 510f77687..85cb0278c 100644
--- a/src/trace_processor/sqlite/sqlite_vtable_benchmark.cc
+++ b/src/trace_processor/sqlite/sqlite_vtable_benchmark.cc
@@ -71,6 +71,7 @@ class BenchmarkCursor : public sqlite3_vtab_cursor {
std::minstd_rand0 rnd_engine_;
};
+constexpr uint32_t BenchmarkCursor::kRandomSeed;
void BenchmarkCursor::RandomFill() {
for (size_t col = 0; col < num_cols_; col++) {
Given this is on an old compiler version + old SDK, closing. Please reopen if this still happens today.
Edit: All this is based on v20.1 of the SDK.
The documentation at https://perfetto.dev/docs/data-sources/native-heap-profiler#-non-android-linux-support indicates steps to get a heap profile on native (non-Android) Linux, but following the instructions, I was never able to get it to build the mentioned
libheapprofd_glibc_preload.so
library. It builds the other stuff (tools, sdk, etc.) as expected (after fixing a few minor build problems)*.I've been building (on x86_64 Linux with gcc 8.2) with
is_clang = false
and both default andis_debug = false
, but neither produced that library.*The problems I ran into were:
as
tc.op
wasn't printable using %d according to gcc 8.2'sprintf
warning.kRandomSeed (from some anonymous namespace iirc) wasn't found during linking, so I just hardcoded a number.
as event produced an "using initialized fields" warning.