blob: 1d236d210a16f20606174da2b3269733963634d0 [file] [log] [blame]
André Kempeddbe3072023-03-03 18:44:381# Copyright 2023 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/compiler/compiler.gni")
André Kempe62af4e42024-05-03 17:11:176import("//build/config/compiler/pgo/pgo.gni")
André Kempeddbe3072023-03-03 18:44:387
8declare_args() {
9 # Whether to compile support for Allocation Stack Trace Recorder.
10 #
11 # The recorder is initially intended as a support tool for Arm's
12 # Memory Tagging Extensions. A history of the most recent allocations and
13 # frees is included in the crashpad report and gives developers information
14 # where the memory which was invalidly accessed was allocated or freed.
15 #
16 # Although it should work on other platforms as well, for the above reasons,
Keishi Hattori82d82af22023-08-22 18:42:2817 # we currently enable it only for Android when compiling for Arm64.
André Kempec8d8622b2024-06-19 08:24:3218 build_allocation_stack_trace_recorder = current_cpu == "arm64" && is_android
André Kempeddbe3072023-03-03 18:44:3819}
20
André Kempe7c53f622023-06-26 15:37:1421declare_args() {
22 # If enabled, the recorder gathers some additional information, i.e. number of
23 # collisions of slots, and prints these periodically.
24 #
25 # Since this might impact performance negatively, it's disabled by default.
26 # Even if it's disabled we still collect some data, i.e. total number of
27 # allocations. All other data will be set to a default value.
28 build_allocation_trace_recorder_full_reporting = false
29}
30
André Kempeddbe3072023-03-03 18:44:3831assert(!(build_allocation_stack_trace_recorder && is_fuchsia),
32 "Stack trace recording is not supported on Fuchsia due to missing" +
33 " Crashpad!")
34
35assert(!(build_allocation_stack_trace_recorder && is_linux),
36 "WARNING: Stack trace recording is not supported on Linux due to" +
37 " performance issues computing stack trace!")
André Kempe7c53f622023-06-26 15:37:1438
39assert(
40 build_allocation_stack_trace_recorder ||
41 !build_allocation_trace_recorder_full_reporting,
42 "Report for stack trace recorder is enabled, but the recorder is disabled!")