diff options
author | Martijn Coenen <maco@google.com> | 2018-03-09 09:29:59 +0100 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2018-03-27 07:22:55 +0000 |
commit | 22071ca4b44f8a7136e370fc50415a0dfb860f52 (patch) | |
tree | d2575c84b17bd755141adf5e4965aac0389c2c8b /cc | |
parent | 070f60548581d2da66ad3fb91df5bd4d88cceb26 (diff) | |
download | build_soong-22071ca4b44f8a7136e370fc50415a0dfb860f52.tar.gz build_soong-22071ca4b44f8a7136e370fc50415a0dfb860f52.tar.bz2 build_soong-22071ca4b44f8a7136e370fc50415a0dfb860f52.zip |
Add trace flag for cpp/Java AIDL generation.
The AIDL code generator can now include trace code in every generated
AIDL call. We don't want to enable this by default for all interfaces
for two reasons:
1) Potential performance overhead
2) For Java targets, the code depends on @hide APIs in android.os.Trace,
and I haven't found a clean way to determine whether a target is
allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS
is almost it, but it's not set for the core framework (which is
exactly one of the things we'd like to trace).
Bug: 74416314
Test: verify correct code is generated when flag is set
Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Diffstat (limited to 'cc')
-rw-r--r-- | cc/compiler.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cc/compiler.go b/cc/compiler.go index ef222854..b9ba31a7 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -106,6 +106,9 @@ type BaseCompilerProperties struct { // list of directories relative to the Blueprints file that will // be added to the aidl include paths. Local_include_dirs []string + + // whether to generate traces (for systrace) for this interface + Generate_traces *bool } Renderscript struct { @@ -477,6 +480,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.aidlFlags = append(flags.aidlFlags, includeDirsToFlags(rootAidlIncludeDirs)) } + if Bool(compiler.Properties.Aidl.Generate_traces) { + flags.aidlFlags = append(flags.aidlFlags, "-t") + } + flags.GlobalFlags = append(flags.GlobalFlags, "-I"+android.PathForModuleGen(ctx, "aidl").String()) } |