Skip to content

Commit

Permalink
Enable Thread Safety Annotations for Perfetto standalone builds.
Browse files Browse the repository at this point in the history
Import build file located in "//gn/standalone/" only for the standalone builds.
This fixes the Chromium build (Chromium can't depend on "//gn/standalone/").

Add "&& !is_perfetto_build_generator" to the "perfetto_thread_safety_annotations" argument computation.
This fixes google3 build.


Bug: 236942309
Change-Id: I81c2fd5c8d38ac9a89a45a03d5fe6140f89bbfb1
  • Loading branch information
Kirill Timofeev committed Nov 1, 2024
1 parent cebafef commit b7080b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions gn/perfetto.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import("//build_overrides/build.gni")
import("//gn/standalone/libc++/libc++.gni")
import("wasm_vars.gni")

# Summary of our typical build configurations:
Expand Down Expand Up @@ -109,6 +108,7 @@ perfetto_build_standalone =
if (perfetto_build_standalone || is_perfetto_build_generator) {
perfetto_root_path = "//"
import("//gn/standalone/android.gni") # For android_api_level
import("//gn/standalone/libc++/libc++.gni") # For use_custom_libcxx
import("//gn/standalone/sanitizers/vars.gni") # For is_fuzzer
} else if (!defined(perfetto_root_path)) {
perfetto_root_path = "//third_party/perfetto/"
Expand Down Expand Up @@ -250,7 +250,8 @@ declare_args() {

# Enables complie-time thread safety analysis.
perfetto_thread_safety_annotations =
use_custom_libcxx && perfetto_build_standalone
perfetto_build_standalone && !is_perfetto_build_generator &&
defined(use_custom_libcxx) && use_custom_libcxx
}

declare_args() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_X64_CPU_OPT() (0)
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_LLVM_DEMANGLE() (1)
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_SYSTEM_CONSUMER() (1)
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_THREAD_SAFETY_ANNOTATIONS() (1)
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_THREAD_SAFETY_ANNOTATIONS() (0)

// clang-format on
#endif // GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_

0 comments on commit b7080b8

Please sign in to comment.