Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2178)

Unified Diff: build/config/compiler/BUILD.gn

Issue 1965143003: Don't omit frame pointers in profiling GN builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 0ae9cb050a36a34bdb61a35075d5584347a4264b..49020831330530347e773fdcce38142fec751d76 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -241,17 +241,19 @@ config("compiler") {
# Non-Mac Posix compiler flags setup.
# -----------------------------------
if (is_posix && !(is_mac || is_ios)) {
- if (enable_profiling && !is_debug) {
- cflags += [
- "-fno-omit-frame-pointer",
- "-g",
- ]
-
- if (enable_full_stack_frames_for_profiling) {
- cflags += [
- "-fno-inline",
- "-fno-optimize-sibling-calls",
- ]
+ if (enable_profiling) {
+ # Explicitly ask for frame pointers. Otherwise they are omitted when
+ # any optimization level is used (and Android debug builds use -Os).
+ cflags += [ "-fno-omit-frame-pointer" ]
+ if (!is_debug) {
+ cflags += [ "-g" ]
+
+ if (enable_full_stack_frames_for_profiling) {
+ cflags += [
+ "-fno-inline",
+ "-fno-optimize-sibling-calls",
+ ]
+ }
}
}
@@ -1209,7 +1211,7 @@ if (is_win) {
# We don't omit frame pointers on arm64 since they are required
# to correctly unwind stackframes which contain system library
# function frames (crbug.com/391706).
- if (!using_sanitizer && target_cpu != "arm64") {
+ if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
common_optimize_on_cflags += [ "-fomit-frame-pointer" ]
}
@@ -1299,7 +1301,7 @@ config("no_optimize") {
# We don't omit frame pointers on arm64 since they are required
# to correctly unwind stackframes which contain system library
# function frames (crbug.com/391706).
- if (!using_sanitizer && target_cpu != "arm64") {
+ if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
cflags += [ "-fomit-frame-pointer" ]
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698