Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 1 | // Copyright 2017 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package cc |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
Pirama Arumuga Nainar | 8aed42c | 2018-03-08 22:56:37 -0800 | [diff] [blame] | 19 | "path/filepath" |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 20 | "strings" |
| 21 | |
Yi Kong | ca610d2 | 2018-04-24 10:42:02 -0700 | [diff] [blame] | 22 | "github.com/google/blueprint/proptools" |
| 23 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 24 | "android/soong/android" |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 25 | "android/soong/cc/config" |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | var ( |
| 29 | // Add flags to ignore warnings that profiles are old or missing for |
Pirama Arumuga Nainar | 3a25405 | 2019-06-14 09:54:23 -0700 | [diff] [blame] | 30 | // some functions. |
Yi Kong | 69c1ed9 | 2019-03-21 14:28:13 -0700 | [diff] [blame] | 31 | profileUseOtherFlags = []string{ |
| 32 | "-Wno-backend-plugin", |
Yi Kong | 69c1ed9 | 2019-03-21 14:28:13 -0700 | [diff] [blame] | 33 | } |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 34 | |
Pirama Arumuga Nainar | 4954080 | 2018-01-29 23:11:42 -0800 | [diff] [blame] | 35 | globalPgoProfileProjects = []string{ |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 36 | "toolchain/pgo-profiles", |
| 37 | "vendor/google_data/pgo-profiles", |
| 38 | } |
| 39 | ) |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 40 | |
Colin Cross | 571cccf | 2019-02-04 11:22:08 -0800 | [diff] [blame] | 41 | var pgoProfileProjectsConfigKey = android.NewOnceKey("PgoProfileProjects") |
| 42 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 43 | const profileInstrumentFlag = "-fprofile-generate=/data/local/tmp" |
Yi Kong | 61a1b98 | 2020-01-30 21:15:12 +0800 | [diff] [blame] | 44 | const profileSamplingFlag = "-gmlt -fdebug-info-for-profiling" |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 45 | const profileUseInstrumentFormat = "-fprofile-use=%s" |
Yi Kong | b6ec66a | 2020-01-31 12:36:12 +0800 | [diff] [blame] | 46 | const profileUseSamplingFormat = "-fprofile-sample-accurate -fprofile-sample-use=%s" |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 47 | |
Pirama Arumuga Nainar | 4954080 | 2018-01-29 23:11:42 -0800 | [diff] [blame] | 48 | func getPgoProfileProjects(config android.DeviceConfig) []string { |
| 49 | return config.OnceStringSlice(pgoProfileProjectsConfigKey, func() []string { |
| 50 | return append(globalPgoProfileProjects, config.PgoAdditionalProfileDirs()...) |
| 51 | }) |
| 52 | } |
| 53 | |
Yi Kong | 7e53c57 | 2018-02-14 18:16:12 +0800 | [diff] [blame] | 54 | func recordMissingProfileFile(ctx BaseModuleContext, missing string) { |
Colin Cross | 571cccf | 2019-02-04 11:22:08 -0800 | [diff] [blame] | 55 | getNamedMapForConfig(ctx.Config(), modulesMissingProfileFileKey).Store(missing, true) |
Pirama Arumuga Nainar | 28316d4 | 2018-01-29 09:18:45 -0800 | [diff] [blame] | 56 | } |
| 57 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 58 | type PgoProperties struct { |
| 59 | Pgo struct { |
Pirama Arumuga Nainar | 6aeed8b | 2017-10-16 13:31:40 -0700 | [diff] [blame] | 60 | Instrumentation *bool |
| 61 | Sampling *bool |
| 62 | Profile_file *string `android:"arch_variant"` |
| 63 | Benchmarks []string |
| 64 | Enable_profile_use *bool `android:"arch_variant"` |
Pirama Arumuga Nainar | 690ed55 | 2017-12-13 16:48:20 -0800 | [diff] [blame] | 65 | // Additional compiler flags to use when building this module |
| 66 | // for profiling (either instrumentation or sampling). |
| 67 | Cflags []string `android:"arch_variant"` |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 68 | } `android:"arch_variant"` |
| 69 | |
| 70 | PgoPresent bool `blueprint:"mutated"` |
| 71 | ShouldProfileModule bool `blueprint:"mutated"` |
Yi Kong | 7e53c57 | 2018-02-14 18:16:12 +0800 | [diff] [blame] | 72 | PgoCompile bool `blueprint:"mutated"` |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | type pgo struct { |
| 76 | Properties PgoProperties |
| 77 | } |
| 78 | |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 79 | func (props *PgoProperties) isInstrumentation() bool { |
| 80 | return props.Pgo.Instrumentation != nil && *props.Pgo.Instrumentation == true |
| 81 | } |
| 82 | |
| 83 | func (props *PgoProperties) isSampling() bool { |
| 84 | return props.Pgo.Sampling != nil && *props.Pgo.Sampling == true |
| 85 | } |
| 86 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 87 | func (pgo *pgo) props() []interface{} { |
| 88 | return []interface{}{&pgo.Properties} |
| 89 | } |
| 90 | |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 91 | func (props *PgoProperties) addProfileGatherFlags(ctx ModuleContext, flags Flags) Flags { |
Colin Cross | 4af21ed | 2019-11-04 09:37:55 -0800 | [diff] [blame] | 92 | flags.Local.CFlags = append(flags.Local.CFlags, props.Pgo.Cflags...) |
Pirama Arumuga Nainar | 690ed55 | 2017-12-13 16:48:20 -0800 | [diff] [blame] | 93 | |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 94 | if props.isInstrumentation() { |
Colin Cross | 4af21ed | 2019-11-04 09:37:55 -0800 | [diff] [blame] | 95 | flags.Local.CFlags = append(flags.Local.CFlags, profileInstrumentFlag) |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 96 | // The profile runtime is added below in deps(). Add the below |
| 97 | // flag, which is the only other link-time action performed by |
| 98 | // the Clang driver during link. |
Colin Cross | 4af21ed | 2019-11-04 09:37:55 -0800 | [diff] [blame] | 99 | flags.Local.LdFlags = append(flags.Local.LdFlags, "-u__llvm_profile_runtime") |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 100 | } |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 101 | if props.isSampling() { |
Colin Cross | 4af21ed | 2019-11-04 09:37:55 -0800 | [diff] [blame] | 102 | flags.Local.CFlags = append(flags.Local.CFlags, profileSamplingFlag) |
| 103 | flags.Local.LdFlags = append(flags.Local.LdFlags, profileSamplingFlag) |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 104 | } |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 105 | return flags |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Yi Kong | 7e53c57 | 2018-02-14 18:16:12 +0800 | [diff] [blame] | 108 | func (props *PgoProperties) getPgoProfileFile(ctx BaseModuleContext) android.OptionalPath { |
Pirama Arumuga Nainar | 8aed42c | 2018-03-08 22:56:37 -0800 | [diff] [blame] | 109 | profile_file := *props.Pgo.Profile_file |
| 110 | |
Pirama Arumuga Nainar | 4954080 | 2018-01-29 23:11:42 -0800 | [diff] [blame] | 111 | // Test if the profile_file is present in any of the PGO profile projects |
| 112 | for _, profileProject := range getPgoProfileProjects(ctx.DeviceConfig()) { |
Pirama Arumuga Nainar | 8aed42c | 2018-03-08 22:56:37 -0800 | [diff] [blame] | 113 | // Bug: http://b/74395273 If the profile_file is unavailable, |
| 114 | // use a versioned file named |
| 115 | // <profile_file>.<arbitrary-version> when available. This |
| 116 | // works around an issue where ccache serves stale cache |
| 117 | // entries when the profile file has changed. |
| 118 | globPattern := filepath.Join(profileProject, profile_file+".*") |
| 119 | versioned_profiles, err := ctx.GlobWithDeps(globPattern, nil) |
| 120 | if err != nil { |
| 121 | ctx.ModuleErrorf("glob: %s", err.Error()) |
| 122 | } |
| 123 | |
| 124 | path := android.ExistentPathForSource(ctx, profileProject, profile_file) |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 125 | if path.Valid() { |
Pirama Arumuga Nainar | 8aed42c | 2018-03-08 22:56:37 -0800 | [diff] [blame] | 126 | if len(versioned_profiles) != 0 { |
| 127 | ctx.PropertyErrorf("pgo.profile_file", "Profile_file has multiple versions: "+filepath.Join(profileProject, profile_file)+", "+strings.Join(versioned_profiles, ", ")) |
| 128 | } |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 129 | return path |
| 130 | } |
Pirama Arumuga Nainar | 8aed42c | 2018-03-08 22:56:37 -0800 | [diff] [blame] | 131 | |
| 132 | if len(versioned_profiles) > 1 { |
| 133 | ctx.PropertyErrorf("pgo.profile_file", "Profile_file has multiple versions: "+strings.Join(versioned_profiles, ", ")) |
| 134 | } else if len(versioned_profiles) == 1 { |
| 135 | return android.OptionalPathForPath(android.PathForSource(ctx, versioned_profiles[0])) |
| 136 | } |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 137 | } |
| 138 | |
Pirama Arumuga Nainar | 28316d4 | 2018-01-29 09:18:45 -0800 | [diff] [blame] | 139 | // Record that this module's profile file is absent |
| 140 | missing := *props.Pgo.Profile_file + ":" + ctx.ModuleDir() + "/Android.bp:" + ctx.ModuleName() |
| 141 | recordMissingProfileFile(ctx, missing) |
| 142 | |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 143 | return android.OptionalPathForPath(nil) |
| 144 | } |
| 145 | |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 146 | func (props *PgoProperties) profileUseFlag(ctx ModuleContext, file string) string { |
| 147 | if props.isInstrumentation() { |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 148 | return fmt.Sprintf(profileUseInstrumentFormat, file) |
| 149 | } |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 150 | if props.isSampling() { |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 151 | return fmt.Sprintf(profileUseSamplingFormat, file) |
| 152 | } |
| 153 | return "" |
| 154 | } |
| 155 | |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 156 | func (props *PgoProperties) profileUseFlags(ctx ModuleContext, file string) []string { |
| 157 | flags := []string{props.profileUseFlag(ctx, file)} |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 158 | flags = append(flags, profileUseOtherFlags...) |
| 159 | return flags |
| 160 | } |
| 161 | |
Pirama Arumuga Nainar | 0fdfc45 | 2017-10-10 11:00:18 -0700 | [diff] [blame] | 162 | func (props *PgoProperties) addProfileUseFlags(ctx ModuleContext, flags Flags) Flags { |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 163 | // Return if 'pgo' property is not present in this module. |
| 164 | if !props.PgoPresent { |
| 165 | return flags |
| 166 | } |
| 167 | |
Yi Kong | ca610d2 | 2018-04-24 10:42:02 -0700 | [diff] [blame] | 168 | if props.PgoCompile { |
| 169 | profileFile := props.getPgoProfileFile(ctx) |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 170 | profileFilePath := profileFile.Path() |
| 171 | profileUseFlags := props.profileUseFlags(ctx, profileFilePath.String()) |
Pirama Arumuga Nainar | 0fdfc45 | 2017-10-10 11:00:18 -0700 | [diff] [blame] | 172 | |
Colin Cross | 4af21ed | 2019-11-04 09:37:55 -0800 | [diff] [blame] | 173 | flags.Local.CFlags = append(flags.Local.CFlags, profileUseFlags...) |
| 174 | flags.Local.LdFlags = append(flags.Local.LdFlags, profileUseFlags...) |
Pirama Arumuga Nainar | 0fdfc45 | 2017-10-10 11:00:18 -0700 | [diff] [blame] | 175 | |
| 176 | // Update CFlagsDeps and LdFlagsDeps so the module is rebuilt |
| 177 | // if profileFile gets updated |
Pirama Arumuga Nainar | 64946fe | 2018-01-17 14:00:53 -0800 | [diff] [blame] | 178 | flags.CFlagsDeps = append(flags.CFlagsDeps, profileFilePath) |
| 179 | flags.LdFlagsDeps = append(flags.LdFlagsDeps, profileFilePath) |
Yi Kong | 92474e5 | 2020-01-16 17:04:38 -0800 | [diff] [blame] | 180 | |
| 181 | if props.isSampling() { |
| 182 | flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-mllvm,-no-warn-sample-unused=true") |
| 183 | } |
Pirama Arumuga Nainar | 0fdfc45 | 2017-10-10 11:00:18 -0700 | [diff] [blame] | 184 | } |
| 185 | return flags |
| 186 | } |
| 187 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 188 | func (props *PgoProperties) isPGO(ctx BaseModuleContext) bool { |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 189 | isInstrumentation := props.isInstrumentation() |
| 190 | isSampling := props.isSampling() |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 191 | |
| 192 | profileKindPresent := isInstrumentation || isSampling |
| 193 | filePresent := props.Pgo.Profile_file != nil |
| 194 | benchmarksPresent := len(props.Pgo.Benchmarks) > 0 |
| 195 | |
| 196 | // If all three properties are absent, PGO is OFF for this module |
| 197 | if !profileKindPresent && !filePresent && !benchmarksPresent { |
| 198 | return false |
| 199 | } |
| 200 | |
| 201 | // If at least one property exists, validate that all properties exist |
| 202 | if !profileKindPresent || !filePresent || !benchmarksPresent { |
| 203 | var missing []string |
| 204 | if !profileKindPresent { |
| 205 | missing = append(missing, "profile kind (either \"instrumentation\" or \"sampling\" property)") |
| 206 | } |
| 207 | if !filePresent { |
| 208 | missing = append(missing, "profile_file property") |
| 209 | } |
| 210 | if !benchmarksPresent { |
| 211 | missing = append(missing, "non-empty benchmarks property") |
| 212 | } |
| 213 | missingProps := strings.Join(missing, ", ") |
| 214 | ctx.ModuleErrorf("PGO specification is missing properties: " + missingProps) |
| 215 | } |
| 216 | |
Pirama Arumuga Nainar | 6fc8d91 | 2017-10-05 10:25:00 -0700 | [diff] [blame] | 217 | if isSampling && isInstrumentation { |
| 218 | ctx.PropertyErrorf("pgo", "Exactly one of \"instrumentation\" and \"sampling\" properties must be set") |
| 219 | } |
| 220 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 221 | return true |
| 222 | } |
| 223 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 224 | func (pgo *pgo) begin(ctx BaseModuleContext) { |
| 225 | // TODO Evaluate if we need to support PGO for host modules |
| 226 | if ctx.Host() { |
| 227 | return |
| 228 | } |
| 229 | |
| 230 | // Check if PGO is needed for this module |
| 231 | pgo.Properties.PgoPresent = pgo.Properties.isPGO(ctx) |
| 232 | |
| 233 | if !pgo.Properties.PgoPresent { |
| 234 | return |
| 235 | } |
| 236 | |
| 237 | // This module should be instrumented if ANDROID_PGO_INSTRUMENT is set |
Pirama Arumuga Nainar | e236b5a | 2018-01-22 19:10:19 -0800 | [diff] [blame] | 238 | // and includes 'all', 'ALL' or a benchmark listed for this module. |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 239 | // |
| 240 | // TODO Validate that each benchmark instruments at least one module |
| 241 | pgo.Properties.ShouldProfileModule = false |
Colin Cross | 6510f91 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 242 | pgoBenchmarks := ctx.Config().Getenv("ANDROID_PGO_INSTRUMENT") |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 243 | pgoBenchmarksMap := make(map[string]bool) |
| 244 | for _, b := range strings.Split(pgoBenchmarks, ",") { |
| 245 | pgoBenchmarksMap[b] = true |
| 246 | } |
| 247 | |
Pirama Arumuga Nainar | e236b5a | 2018-01-22 19:10:19 -0800 | [diff] [blame] | 248 | if pgoBenchmarksMap["all"] == true || pgoBenchmarksMap["ALL"] == true { |
| 249 | pgo.Properties.ShouldProfileModule = true |
| 250 | } else { |
| 251 | for _, b := range pgo.Properties.Pgo.Benchmarks { |
| 252 | if pgoBenchmarksMap[b] == true { |
| 253 | pgo.Properties.ShouldProfileModule = true |
| 254 | break |
| 255 | } |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 256 | } |
| 257 | } |
Yi Kong | 7e53c57 | 2018-02-14 18:16:12 +0800 | [diff] [blame] | 258 | |
Pirama Arumuga Nainar | 807d49b | 2020-02-12 13:57:37 -0800 | [diff] [blame] | 259 | // PGO profile use is not feasible for a Clang coverage build because |
| 260 | // -fprofile-use and -fprofile-instr-generate are incompatible. |
| 261 | if ctx.DeviceConfig().ClangCoverageEnabled() { |
| 262 | return |
| 263 | } |
| 264 | |
Yi Kong | ca610d2 | 2018-04-24 10:42:02 -0700 | [diff] [blame] | 265 | if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") && |
| 266 | proptools.BoolDefault(pgo.Properties.Pgo.Enable_profile_use, true) { |
Yi Kong | 7e53c57 | 2018-02-14 18:16:12 +0800 | [diff] [blame] | 267 | if profileFile := pgo.Properties.getPgoProfileFile(ctx); profileFile.Valid() { |
| 268 | pgo.Properties.PgoCompile = true |
| 269 | } |
| 270 | } |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 271 | } |
| 272 | |
Pirama Arumuga Nainar | 49b53d5 | 2017-10-04 16:47:29 -0700 | [diff] [blame] | 273 | func (pgo *pgo) deps(ctx BaseModuleContext, deps Deps) Deps { |
| 274 | if pgo.Properties.ShouldProfileModule { |
| 275 | runtimeLibrary := config.ProfileRuntimeLibrary(ctx.toolchain()) |
| 276 | deps.LateStaticLibs = append(deps.LateStaticLibs, runtimeLibrary) |
| 277 | } |
| 278 | return deps |
| 279 | } |
| 280 | |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 281 | func (pgo *pgo) flags(ctx ModuleContext, flags Flags) Flags { |
| 282 | if ctx.Host() { |
| 283 | return flags |
| 284 | } |
| 285 | |
| 286 | props := pgo.Properties |
| 287 | |
| 288 | // Add flags to profile this module based on its profile_kind |
| 289 | if props.ShouldProfileModule { |
Pirama Arumuga Nainar | 3f5bb9c | 2017-10-10 10:47:41 -0700 | [diff] [blame] | 290 | return props.addProfileGatherFlags(ctx, flags) |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Colin Cross | 6510f91 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 293 | if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") { |
Pirama Arumuga Nainar | 0fdfc45 | 2017-10-10 11:00:18 -0700 | [diff] [blame] | 294 | return props.addProfileUseFlags(ctx, flags) |
Pirama Arumuga Nainar | ada83ec | 2017-08-31 23:38:27 -0700 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | return flags |
| 298 | } |