OSDN Git Service

0e14a02151edbd6c43c6f32296315895cdccbc2f
[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         "-Werror",
23     ],
24     cppflags: [
25         "-Wno-sign-compare",
26         "-Wno-unused-parameter",
27     ],
28 }
29
30 //
31 // Static library for ELF symbolization.
32 //
33 // TODO: make this a proper part of simpleperf once that is moved to Soong.
34 //
35
36 cc_library_static {
37     name: "libperfprofd_elf_read",
38     defaults: [
39         "perfprofd_defaults",
40     ],
41
42     export_include_dirs: [
43         "simpleperf",
44     ],
45
46     cflags: [
47         "-DSIMPLEPERF_REVISION=\"dummy\"",
48     ],
49
50     static_libs: [
51         "libbase",
52     ],
53     // Use whole-static to avoid having to pull this in later.
54     whole_static_libs: [
55         "libLLVMObject",
56         "libLLVMBitReader",
57         "libLLVMMC",
58         "libLLVMMCParser",
59         "libLLVMCore",
60         "libLLVMSupport",
61         "liblog",
62         "liblzma",
63         "libz",
64         "libziparchive",
65     ],
66
67     target: {
68         // Required for LLVM.
69         linux_glibc: {
70             host_ldlibs: [
71                 "-lncurses",
72             ],
73         },
74     },
75
76     srcs: [
77         "simpleperf/read_apk.cpp",
78         "simpleperf/read_elf.cpp",
79         "simpleperf/utils.cpp",
80     ],
81
82     group_static_libs: true,
83 }
84
85 //
86 // Static library containing guts of AWP daemon.
87 //
88
89 cc_library_static {
90     name: "libperfprofdcore",
91     defaults: [
92         "perfprofd_defaults",
93     ],
94
95     local_include_dirs: ["quipper/kernel-headers"],
96     export_include_dirs: ["."],
97     static_libs: [
98         "libbase",
99         "libperfprofd_elf_read",
100     ],
101     srcs: [
102         "perf_profile.proto",
103         "quipper/perf_utils.cc",
104         "quipper/base/logging.cc",
105         "quipper/address_mapper.cc",
106         "quipper/perf_reader.cc",
107         "quipper/perf_parser.cc",
108         "perf_data_converter.cc",
109         "configreader.cc",
110         "cpuconfig.cc",
111         "perfprofdcore.cc",
112         "symbolizer.cc"
113     ],
114
115     proto: {
116         export_proto_headers: true,
117     },
118 }
119
120 //
121 // Static library with primary utilities layer (called by perfprofd core)
122 //
123 cc_library_static {
124     name: "libperfprofdutils",
125     defaults: [
126         "perfprofd_defaults",
127     ],
128
129     srcs: [
130         "perfprofdutils.cc",
131     ],
132 }
133
134 //
135 // Main daemon
136 //
137 cc_binary {
138     name: "perfprofd",
139     defaults: [
140         "perfprofd_defaults",
141     ],
142
143     srcs: [
144         "perfprofdmain.cc",
145     ],
146
147     static_libs: [
148         "libperfprofdcore",
149         "libperfprofdutils",
150         "libperfprofd_binder",
151         "libperfprofd_elf_read",
152     ],
153     group_static_libs: true,
154
155     shared_libs: [
156         "liblog",
157         "libprotobuf-cpp-lite",
158         "libbase",
159         "libbinder",
160         "libutils",
161     ],
162
163     init_rc: ["perfprofd.rc"],
164 }
165
166 subdirs = [
167     "binder_interface",
168     "tests",
169 ]