OSDN Git Service

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