OSDN Git Service

Perfprofd: Factor out the command-line-based loop
[android-x86/system-extras.git] / perfprofd / Android.bp
1 //
2 // Copyright (C) 2016 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 cc_defaults {
18     name: "perfprofd_defaults",
19
20     cflags: [
21         "-Wall",
22         "-Wextra",
23         "-Werror",
24
25         // Try some more extreme warnings.
26         "-Wpedantic",
27         "-Wunreachable-code-aggressive",
28         // And disable some dumb things.
29         "-Wno-zero-length-array",
30         "-Wno-c99-extensions",
31         "-Wno-language-extension-token",
32         "-Wno-gnu-zero-variadic-macro-arguments",
33         "-Wno-nested-anon-types",
34         "-Wno-gnu-statement-expression",
35         "-Wno-vla-extension",
36     ],
37     cppflags: [
38         "-Wno-sign-compare",
39         "-Wno-unused-parameter",
40     ],
41 }
42
43 cc_defaults {
44     name: "perfprofd_debug_defaults",
45
46     cflags: [
47         "-O0",
48         "-g",
49         "-UNDEBUG",
50     ],
51
52     // Add sanitizers that work w/o extra libraries. This is important
53     // for atest etc to work.
54     sanitize: {
55         integer_overflow: true,
56         undefined: true,
57     },
58
59     target: {
60         // On the host add ASAN.
61         host: {
62             sanitize: {
63                 address: true,
64             },
65         },
66     }
67 }
68
69 //
70 // Static library containing guts of AWP daemon.
71 //
72
73 cc_defaults {
74     name: "libperfprofdcore_defaults",
75     defaults: [
76         "perfprofd_defaults",
77     ],
78     host_supported: true,
79     target: {
80         darwin: {
81             enabled: false,
82         },
83     },
84
85     static_libs: [
86         "libbase",
87         "libsimpleperf_elf_read",
88     ],
89     whole_static_libs: [
90         "libquipper",
91     ],
92     srcs: [
93         "perfprofd_record.proto",
94         "perf_data_converter.cc",
95         "configreader.cc",
96         "cpuconfig.cc",
97         "perfprofdcore.cc",
98         "perfprofd_cmdline.cc",
99         "perfprofd_io.cc",
100         "symbolizer.cc"
101     ],
102
103     proto: {
104         export_proto_headers: true,
105         include_dirs: ["external/perf_data_converter/src/quipper"],
106         type: "lite",
107     },
108     cflags: [
109         "-Wno-gnu-anonymous-struct",
110     ],
111
112     export_include_dirs: ["."],
113 }
114
115 cc_library_static {
116     name: "libperfprofdcore",
117     defaults: [
118         "libperfprofdcore_defaults",
119     ],
120 }
121
122 // Debug version.
123 cc_library_static {
124     name: "libperfprofdcored",
125     defaults: [
126         "libperfprofdcore_defaults",
127         "perfprofd_debug_defaults",
128     ],
129 }
130
131
132 //
133 // Main daemon
134 //
135 cc_binary {
136     name: "perfprofd",
137     defaults: [
138         "perfprofd_defaults",
139     ],
140
141     srcs: [
142         "perfprofdmain.cc",
143     ],
144
145     static_libs: [
146         "libperfprofdcore",
147         "libperfprofd_binder",
148         "libsimpleperf_elf_read",
149     ],
150     group_static_libs: true,
151
152     shared_libs: [
153         "liblog",
154         "libprotobuf-cpp-lite",
155         "libbase",
156         "libbinder",
157         "libservices",
158         "libutils",
159     ],
160
161     init_rc: ["perfprofd.rc"],
162
163     product_variables: {
164         pdk: {
165             enabled: false,
166         },
167     },
168
169     // We're technically independent, but ensure simpleperf is there.
170     required: [
171         "simpleperf",
172     ],
173 }
174
175 subdirs = [
176     "binder_interface",
177     "tests",
178 ]