blob: f8419e424b70d17749d54be9ab8e4c797314948a [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")
6
7declare_args() {
8 # Whether to compile support for Allocation Stack Trace Recorder.
9 #
10 # The recorder is initially intended as a support tool for Arm's
11 # Memory Tagging Extensions. A history of the most recent allocations and
12 # frees is included in the crashpad report and gives developers information
13 # where the memory which was invalidly accessed was allocated or freed.
14 #
15 # Although it should work on other platforms as well, for the above reasons,
Keishi Hattori82d82af22023-08-22 18:42:2816 # we currently enable it only for Android when compiling for Arm64.
17 build_allocation_stack_trace_recorder = current_cpu == "arm64" && is_android
André Kempeddbe3072023-03-03 18:44:3818}
19
André Kempe7c53f622023-06-26 15:37:1420declare_args() {
21 # If enabled, the recorder gathers some additional information, i.e. number of
22 # collisions of slots, and prints these periodically.
23 #
24 # Since this might impact performance negatively, it's disabled by default.
25 # Even if it's disabled we still collect some data, i.e. total number of
26 # allocations. All other data will be set to a default value.
27 build_allocation_trace_recorder_full_reporting = false
28}
29
André Kempeddbe3072023-03-03 18:44:3830assert(!(build_allocation_stack_trace_recorder && is_fuchsia),
31 "Stack trace recording is not supported on Fuchsia due to missing" +
32 " Crashpad!")
33
34assert(!(build_allocation_stack_trace_recorder && is_linux),
35 "WARNING: Stack trace recording is not supported on Linux due to" +
36 " performance issues computing stack trace!")
André Kempe7c53f622023-06-26 15:37:1437
38assert(
39 build_allocation_stack_trace_recorder ||
40 !build_allocation_trace_recorder_full_reporting,
41 "Report for stack trace recorder is enabled, but the recorder is disabled!")