Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 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 | # |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 16 | LOCAL_PATH := $(call my-dir) |
| 17 | |
Yabin Cui | 6ef55f7 | 2016-07-26 18:42:38 -0700 | [diff] [blame] | 18 | simpleperf_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null) |
| 19 | |
| 20 | simpleperf_common_cppflags := -Wextra -Wunused -Wno-unknown-pragmas \ |
| 21 | -DSIMPLEPERF_REVISION='"$(simpleperf_version)"' |
Yabin Cui | 76769e5 | 2015-07-13 12:23:54 -0700 | [diff] [blame] | 22 | |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 23 | simpleperf_cppflags_target := $(simpleperf_common_cppflags) |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 24 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 25 | simpleperf_cppflags_host := $(simpleperf_common_cppflags) \ |
| 26 | -DUSE_BIONIC_UAPI_HEADERS -I bionic/libc/kernel \ |
Yabin Cui | a447c0d | 2016-08-26 11:35:28 -0700 | [diff] [blame] | 27 | -fvisibility=hidden \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 28 | |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 29 | simpleperf_cppflags_host_darwin := -I $(LOCAL_PATH)/nonlinux_support/include |
| 30 | simpleperf_cppflags_host_windows := -I $(LOCAL_PATH)/nonlinux_support/include |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 31 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 32 | |
| 33 | LLVM_ROOT_PATH := external/llvm |
| 34 | include $(LLVM_ROOT_PATH)/llvm.mk |
| 35 | |
Than McIntosh | f831e6d | 2016-02-01 19:50:20 -0500 | [diff] [blame] | 36 | simpleperf_static_libraries_target := \ |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 37 | libbacktrace_offline \ |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 38 | libbacktrace \ |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 39 | libunwind \ |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 40 | libziparchive \ |
| 41 | libz \ |
| 42 | libbase \ |
| 43 | libcutils \ |
| 44 | liblog \ |
Yabin Cui | 7e5aa13 | 2016-11-16 22:47:53 +0000 | [diff] [blame] | 45 | libprocinfo \ |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 46 | libutils \ |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 47 | liblzma \ |
| 48 | libLLVMObject \ |
| 49 | libLLVMBitReader \ |
| 50 | libLLVMMC \ |
| 51 | libLLVMMCParser \ |
| 52 | libLLVMCore \ |
| 53 | libLLVMSupport \ |
Yabin Cui | 42c8dc6 | 2016-06-03 15:06:53 -0700 | [diff] [blame] | 54 | libprotobuf-cpp-lite \ |
Yabin Cui | 3e4c595 | 2016-07-26 15:03:27 -0700 | [diff] [blame] | 55 | libevent \ |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 56 | libc \ |
Than McIntosh | f831e6d | 2016-02-01 19:50:20 -0500 | [diff] [blame] | 57 | |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 58 | simpleperf_static_libraries_host := \ |
Colin Cross | dec58a2 | 2016-08-26 11:16:28 -0700 | [diff] [blame] | 59 | libziparchive \ |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 60 | libbase \ |
| 61 | liblog \ |
Yabin Cui | 0540053 | 2016-03-17 21:18:53 -0700 | [diff] [blame] | 62 | liblzma \ |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 63 | libz \ |
| 64 | libutils \ |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 65 | libLLVMObject \ |
| 66 | libLLVMBitReader \ |
| 67 | libLLVMMC \ |
| 68 | libLLVMMCParser \ |
| 69 | libLLVMCore \ |
| 70 | libLLVMSupport \ |
Yabin Cui | 42c8dc6 | 2016-06-03 15:06:53 -0700 | [diff] [blame] | 71 | libprotobuf-cpp-lite \ |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 72 | |
| 73 | simpleperf_static_libraries_host_linux := \ |
Yabin Cui | 7e5aa13 | 2016-11-16 22:47:53 +0000 | [diff] [blame] | 74 | libprocinfo \ |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 75 | libbacktrace_offline \ |
| 76 | libbacktrace \ |
| 77 | libunwind \ |
| 78 | libcutils \ |
Yabin Cui | 3e4c595 | 2016-07-26 15:03:27 -0700 | [diff] [blame] | 79 | libevent \ |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 80 | |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 81 | simpleperf_ldlibs_host_linux := -lrt |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 82 | |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 83 | # libsimpleperf |
| 84 | # ========================================================= |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 85 | libsimpleperf_src_files := \ |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 86 | cmd_dumprecord.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 87 | cmd_help.cpp \ |
Yabin Cui | 6965d42 | 2016-06-15 11:41:42 -0700 | [diff] [blame] | 88 | cmd_kmem.cpp \ |
Yabin Cui | 2672dea | 2015-05-21 12:17:23 -0700 | [diff] [blame] | 89 | cmd_report.cpp \ |
Yabin Cui | 767dd17 | 2016-06-02 21:02:43 -0700 | [diff] [blame] | 90 | cmd_report_sample.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 91 | command.cpp \ |
Yabin Cui | ec12ed9 | 2015-06-08 10:38:10 -0700 | [diff] [blame] | 92 | dso.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 93 | event_attr.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 94 | event_type.cpp \ |
Yabin Cui | 76769e5 | 2015-07-13 12:23:54 -0700 | [diff] [blame] | 95 | perf_regs.cpp \ |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 96 | read_apk.cpp \ |
Yabin Cui | 8f62251 | 2015-05-05 19:58:07 -0700 | [diff] [blame] | 97 | read_elf.cpp \ |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 98 | record.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 99 | record_file_reader.cpp \ |
Yabin Cui | 42c8dc6 | 2016-06-03 15:06:53 -0700 | [diff] [blame] | 100 | report_sample.proto \ |
Yabin Cui | 60a0ea9 | 2015-07-22 20:30:43 -0700 | [diff] [blame] | 101 | thread_tree.cpp \ |
Yabin Cui | 4f41df6 | 2016-06-01 17:29:06 -0700 | [diff] [blame] | 102 | tracing.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 103 | utils.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 104 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 105 | libsimpleperf_src_files_linux := \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 106 | cmd_list.cpp \ |
| 107 | cmd_record.cpp \ |
| 108 | cmd_stat.cpp \ |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 109 | dwarf_unwind.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 110 | environment.cpp \ |
| 111 | event_fd.cpp \ |
| 112 | event_selection_set.cpp \ |
Yabin Cui | 26968e6 | 2017-01-30 11:34:24 -0800 | [diff] [blame] | 113 | InplaceSamplerClient.cpp \ |
Yabin Cui | 3e4c595 | 2016-07-26 15:03:27 -0700 | [diff] [blame] | 114 | IOEventLoop.cpp \ |
Yabin Cui | aa65c8b | 2016-09-15 10:43:20 -0700 | [diff] [blame] | 115 | perf_clock.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 116 | record_file_writer.cpp \ |
Yabin Cui | 5450070 | 2016-10-24 16:53:32 -0700 | [diff] [blame] | 117 | UnixSocket.cpp \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 118 | workload.cpp \ |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 119 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 120 | libsimpleperf_src_files_darwin := \ |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 121 | nonlinux_support/nonlinux_support.cpp \ |
| 122 | |
| 123 | libsimpleperf_src_files_windows := \ |
| 124 | nonlinux_support/nonlinux_support.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 125 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 126 | # libsimpleperf target |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 127 | include $(CLEAR_VARS) |
| 128 | LOCAL_CLANG := true |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 129 | LOCAL_MODULE := libsimpleperf |
| 130 | LOCAL_MODULE_TAGS := debug |
| 131 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 132 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) |
| 133 | LOCAL_SRC_FILES := \ |
| 134 | $(libsimpleperf_src_files) \ |
| 135 | $(libsimpleperf_src_files_linux) \ |
| 136 | |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 137 | LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target) |
Yabin Cui | d0d1454 | 2016-03-30 15:37:53 -0700 | [diff] [blame] | 138 | LOCAL_MULTILIB := both |
Yabin Cui | 42c8dc6 | 2016-06-03 15:06:53 -0700 | [diff] [blame] | 139 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 140 | include $(LLVM_DEVICE_BUILD_MK) |
| 141 | include $(BUILD_STATIC_LIBRARY) |
| 142 | |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 143 | # libsimpleperf host |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 144 | include $(CLEAR_VARS) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 145 | #LOCAL_CLANG := true # Comment it to build on windows. |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 146 | LOCAL_MODULE := libsimpleperf |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 147 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 148 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
| 149 | LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin) |
| 150 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 151 | LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows) |
| 152 | LOCAL_SRC_FILES := $(libsimpleperf_src_files) |
| 153 | LOCAL_SRC_FILES_darwin := $(libsimpleperf_src_files_darwin) |
| 154 | LOCAL_SRC_FILES_linux := $(libsimpleperf_src_files_linux) |
| 155 | LOCAL_SRC_FILES_windows := $(libsimpleperf_src_files_windows) |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 156 | LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host) |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 157 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 158 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) |
Daniel Friederich | b2465ad | 2016-10-17 12:28:03 -0500 | [diff] [blame] | 159 | LOCAL_MULTILIB := both |
Yabin Cui | 42c8dc6 | 2016-06-03 15:06:53 -0700 | [diff] [blame] | 160 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Yabin Cui | be903f4 | 2016-06-22 15:30:37 -0700 | [diff] [blame] | 161 | LOCAL_CXX_STL := libc++_static |
Yabin Cui | 8f62251 | 2015-05-05 19:58:07 -0700 | [diff] [blame] | 162 | include $(LLVM_HOST_BUILD_MK) |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 163 | include $(BUILD_HOST_STATIC_LIBRARY) |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 164 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 165 | |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 166 | # simpleperf |
| 167 | # ========================================================= |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 168 | |
| 169 | # simpleperf target |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 170 | include $(CLEAR_VARS) |
| 171 | LOCAL_CLANG := true |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 172 | LOCAL_MODULE := simpleperf |
| 173 | LOCAL_MODULE_TAGS := debug |
| 174 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 175 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 176 | LOCAL_SRC_FILES := main.cpp |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 177 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target) |
Yabin Cui | d0d1454 | 2016-03-30 15:37:53 -0700 | [diff] [blame] | 178 | ifdef TARGET_2ND_ARCH |
| 179 | LOCAL_MULTILIB := both |
| 180 | LOCAL_MODULE_STEM_32 := simpleperf32 |
| 181 | LOCAL_MODULE_STEM_64 := simpleperf |
| 182 | endif |
Yabin Cui | 6d8c834 | 2016-02-10 11:29:51 -0800 | [diff] [blame] | 183 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 184 | include $(LLVM_DEVICE_BUILD_MK) |
| 185 | include $(BUILD_EXECUTABLE) |
| 186 | |
Dan Willemsen | e87fd02 | 2016-06-22 16:41:36 -0700 | [diff] [blame] | 187 | $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf.BUILT)) |
| 188 | ifdef TARGET_2ND_ARCH |
| 189 | $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf$(TARGET_2ND_ARCH_MODULE_SUFFIX).BUILT)) |
| 190 | endif |
| 191 | |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 192 | # simpleperf host |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 193 | include $(CLEAR_VARS) |
Yabin Cui | 57222a3 | 2017-01-04 21:27:26 +0000 | [diff] [blame] | 194 | LOCAL_MODULE := simpleperf_host |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 195 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 196 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
| 197 | LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin) |
| 198 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 199 | LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows) |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 200 | LOCAL_SRC_FILES := main.cpp |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 201 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host) |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 202 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 203 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) |
Yabin Cui | 57222a3 | 2017-01-04 21:27:26 +0000 | [diff] [blame] | 204 | LOCAL_MULTILIB := both |
| 205 | LOCAL_MODULE_STEM_32 := simpleperf32 |
| 206 | LOCAL_MODULE_STEM_64 := simpleperf |
Yabin Cui | be903f4 | 2016-06-22 15:30:37 -0700 | [diff] [blame] | 207 | LOCAL_CXX_STL := libc++_static |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 208 | include $(LLVM_HOST_BUILD_MK) |
Yabin Cui | 67d3abd | 2015-04-16 15:26:31 -0700 | [diff] [blame] | 209 | include $(BUILD_HOST_EXECUTABLE) |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 210 | |
Yabin Cui | 57222a3 | 2017-01-04 21:27:26 +0000 | [diff] [blame] | 211 | $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host.BUILT):simpleperf_host) |
| 212 | ifdef HOST_2ND_ARCH |
| 213 | $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):simpleperf_host32) |
| 214 | endif |
| 215 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host.BUILT)) |
| 216 | ifdef HOST_CROSS_2ND_ARCH |
| 217 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT)) |
| 218 | endif |
| 219 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 220 | |
Yabin Cui | a447c0d | 2016-08-26 11:35:28 -0700 | [diff] [blame] | 221 | # libsimpleperf_report.so |
| 222 | # It is the shared library used on host by python scripts |
| 223 | # to report samples in different ways. |
| 224 | # ========================================================= |
| 225 | include $(CLEAR_VARS) |
| 226 | LOCAL_MODULE := libsimpleperf_report |
| 227 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 228 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
Yabin Cui | a447c0d | 2016-08-26 11:35:28 -0700 | [diff] [blame] | 229 | LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin) |
| 230 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 231 | LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows) |
| 232 | LOCAL_SRC_FILES := report_lib_interface.cpp |
| 233 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host) |
| 234 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
| 235 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL |
Daniel Friederich | b2465ad | 2016-10-17 12:28:03 -0500 | [diff] [blame] | 236 | LOCAL_MULTILIB := both |
Yabin Cui | a447c0d | 2016-08-26 11:35:28 -0700 | [diff] [blame] | 237 | LOCAL_CXX_STL := libc++_static |
| 238 | include $(LLVM_HOST_BUILD_MK) |
| 239 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 240 | |
Yabin Cui | 57222a3 | 2017-01-04 21:27:26 +0000 | [diff] [blame] | 241 | $(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report.BUILT)) |
| 242 | ifdef HOST_2ND_ARCH |
| 243 | $(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):libsimpleperf_report32.so) |
| 244 | endif |
| 245 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report.BUILT):libsimpleperf_report32.dll) |
| 246 | ifdef HOST_CROSS_2ND_ARCH |
| 247 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT)) |
| 248 | endif |
Yabin Cui | a447c0d | 2016-08-26 11:35:28 -0700 | [diff] [blame] | 249 | |
Yabin Cui | b92bae8 | 2017-02-10 12:07:29 -0800 | [diff] [blame] | 250 | |
| 251 | # libsimpleperf_inplace_sampler.so |
| 252 | # It is the shared library linked with user's app and get samples from |
| 253 | # signal handlers in each thread. |
| 254 | # ========================================================= |
| 255 | |
| 256 | libsimpleperf_inplace_sampler_static_libraries_target := \ |
| 257 | $(filter-out libc,$(simpleperf_static_libraries_target)) \ |
| 258 | |
| 259 | # libsimpleperf_inplace_sampler.so on target |
| 260 | include $(CLEAR_VARS) |
| 261 | LOCAL_CLANG := true |
| 262 | LOCAL_MODULE := libsimpleperf_inplace_sampler |
| 263 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) |
| 264 | LOCAL_SRC_FILES := inplace_sampler_lib.cpp |
| 265 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(libsimpleperf_inplace_sampler_static_libraries_target) |
| 266 | LOCAL_MULTILIB := both |
| 267 | LOCAL_CXX_STL := libc++_static |
| 268 | LOCAL_LDLIBS := -Wl,--exclude-libs,ALL |
| 269 | include $(LLVM_DEVICE_BUILD_MK) |
| 270 | include $(BUILD_SHARED_LIBRARY) |
| 271 | |
| 272 | # libsimpleperf_inplace_sampler.so on host |
| 273 | include $(CLEAR_VARS) |
| 274 | LOCAL_CLANG := true |
| 275 | LOCAL_MODULE := libsimpleperf_inplace_sampler |
| 276 | LOCAL_MODULE_HOST_OS := linux |
| 277 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
| 278 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 279 | LOCAL_SRC_FILES := inplace_sampler_lib.cpp |
| 280 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host) |
| 281 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
| 282 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL |
| 283 | LOCAL_MULTILIB := both |
| 284 | LOCAL_CXX_STL := libc++_static |
| 285 | include $(LLVM_HOST_BUILD_MK) |
| 286 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 287 | |
| 288 | |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 289 | # simpleperf_unit_test |
| 290 | # ========================================================= |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 291 | simpleperf_unit_test_src_files := \ |
Yabin Cui | 6965d42 | 2016-06-15 11:41:42 -0700 | [diff] [blame] | 292 | cmd_kmem_test.cpp \ |
Yabin Cui | 6e51bef | 2016-02-23 21:41:03 -0800 | [diff] [blame] | 293 | cmd_report_test.cpp \ |
Yabin Cui | 767dd17 | 2016-06-02 21:02:43 -0700 | [diff] [blame] | 294 | cmd_report_sample_test.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 295 | command_test.cpp \ |
| 296 | gtest_main.cpp \ |
Yabin Cui | 569f64a | 2016-02-05 17:32:08 -0800 | [diff] [blame] | 297 | read_apk_test.cpp \ |
| 298 | read_elf_test.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 299 | record_test.cpp \ |
| 300 | sample_tree_test.cpp \ |
Yabin Cui | b421297 | 2016-05-25 14:08:05 -0700 | [diff] [blame] | 301 | utils_test.cpp \ |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 302 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 303 | simpleperf_unit_test_src_files_linux := \ |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 304 | cmd_dumprecord_test.cpp \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 305 | cmd_list_test.cpp \ |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 306 | cmd_record_test.cpp \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 307 | cmd_stat_test.cpp \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 308 | environment_test.cpp \ |
Yabin Cui | 3e4c595 | 2016-07-26 15:03:27 -0700 | [diff] [blame] | 309 | IOEventLoop_test.cpp \ |
Yabin Cui | 9759e1b | 2015-04-28 15:54:13 -0700 | [diff] [blame] | 310 | record_file_test.cpp \ |
Yabin Cui | 5450070 | 2016-10-24 16:53:32 -0700 | [diff] [blame] | 311 | UnixSocket_test.cpp \ |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 312 | workload_test.cpp \ |
| 313 | |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 314 | # simpleperf_unit_test target |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 315 | include $(CLEAR_VARS) |
| 316 | LOCAL_CLANG := true |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 317 | LOCAL_MODULE := simpleperf_unit_test |
Dan Shi | 222a025 | 2017-03-28 11:40:50 -0700 | [diff] [blame] | 318 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 319 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) |
| 320 | LOCAL_SRC_FILES := \ |
| 321 | $(simpleperf_unit_test_src_files) \ |
| 322 | $(simpleperf_unit_test_src_files_linux) \ |
| 323 | |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 324 | LOCAL_STATIC_LIBRARIES += libsimpleperf $(simpleperf_static_libraries_target) |
Po Hu | 4432b6f | 2017-04-25 08:53:24 +0800 | [diff] [blame] | 325 | LOCAL_TEST_DATA := $(call find-test-data-in-subdirs,$(LOCAL_PATH),"*",testdata) |
Yabin Cui | 5be914d | 2016-11-29 15:21:13 -0800 | [diff] [blame] | 326 | LOCAL_MULTILIB := both |
Yabin Cui | 3375421 | 2016-04-14 16:35:00 -0700 | [diff] [blame] | 327 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 328 | include $(LLVM_DEVICE_BUILD_MK) |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 329 | include $(BUILD_NATIVE_TEST) |
| 330 | |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 331 | # simpleperf_unit_test host |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 332 | include $(CLEAR_VARS) |
Yabin Cui | 323e945 | 2015-04-20 18:07:17 -0700 | [diff] [blame] | 333 | LOCAL_MODULE := simpleperf_unit_test |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 334 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 335 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
| 336 | LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin) |
| 337 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 338 | LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows) |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 339 | LOCAL_SRC_FILES := $(simpleperf_unit_test_src_files) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 340 | LOCAL_SRC_FILES_linux := $(simpleperf_unit_test_src_files_linux) |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 341 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host) |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 342 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 343 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) |
Yabin Cui | 57222a3 | 2017-01-04 21:27:26 +0000 | [diff] [blame] | 344 | LOCAL_MULTILIB := both |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 345 | include $(LLVM_HOST_BUILD_MK) |
Yabin Cui | 9fd3cc1 | 2015-06-25 17:42:23 -0700 | [diff] [blame] | 346 | include $(BUILD_HOST_NATIVE_TEST) |
Yabin Cui | 0930ea8 | 2015-10-01 17:24:07 -0700 | [diff] [blame] | 347 | |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 348 | |
| 349 | # simpleperf_cpu_hotplug_test |
| 350 | # ========================================================= |
| 351 | simpleperf_cpu_hotplug_test_src_files := \ |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 352 | cpu_hotplug_test.cpp \ |
| 353 | |
| 354 | # simpleperf_cpu_hotplug_test target |
| 355 | include $(CLEAR_VARS) |
| 356 | LOCAL_CLANG := true |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 357 | LOCAL_MODULE := simpleperf_cpu_hotplug_test |
Dan Shi | 222a025 | 2017-03-28 11:40:50 -0700 | [diff] [blame] | 358 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 359 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) |
| 360 | LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files) |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 361 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target) |
Yabin Cui | 5633586 | 2016-04-18 13:43:20 -0700 | [diff] [blame] | 362 | LOCAL_MULTILIB := both |
Yabin Cui | 3375421 | 2016-04-14 16:35:00 -0700 | [diff] [blame] | 363 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 364 | include $(LLVM_DEVICE_BUILD_MK) |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 365 | include $(BUILD_NATIVE_TEST) |
| 366 | |
| 367 | # simpleperf_cpu_hotplug_test linux host |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 368 | include $(CLEAR_VARS) |
| 369 | LOCAL_CLANG := true |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 370 | LOCAL_MODULE := simpleperf_cpu_hotplug_test |
| 371 | LOCAL_MODULE_HOST_OS := linux |
| 372 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
| 373 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 374 | LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files) |
Yabin Cui | ff7465c | 2016-02-25 11:02:30 -0800 | [diff] [blame] | 375 | LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host) |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 376 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
Yabin Cui | ffaa912 | 2016-01-15 15:25:48 -0800 | [diff] [blame] | 377 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 378 | LOCAL_MULTILIB := first |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 379 | include $(LLVM_HOST_BUILD_MK) |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 380 | include $(BUILD_HOST_NATIVE_TEST) |
Yabin Cui | 89905b7 | 2015-12-07 20:14:14 -0800 | [diff] [blame] | 381 | |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 382 | |
| 383 | # libsimpleperf_cts_test |
| 384 | # ========================================================= |
| 385 | libsimpleperf_cts_test_src_files := \ |
| 386 | $(libsimpleperf_src_files) \ |
| 387 | $(libsimpleperf_src_files_linux) \ |
| 388 | $(simpleperf_unit_test_src_files) \ |
| 389 | $(simpleperf_unit_test_src_files_linux) \ |
| 390 | |
| 391 | # libsimpleperf_cts_test target |
| 392 | include $(CLEAR_VARS) |
| 393 | LOCAL_CLANG := true |
| 394 | LOCAL_MODULE := libsimpleperf_cts_test |
Yabin Cui | f560a6f | 2016-12-14 17:43:26 -0800 | [diff] [blame] | 395 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) -DRUN_IN_APP_CONTEXT |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 396 | LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files) |
| 397 | LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target) |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 398 | LOCAL_MULTILIB := both |
Yabin Cui | 3375421 | 2016-04-14 16:35:00 -0700 | [diff] [blame] | 399 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 400 | include $(LLVM_DEVICE_BUILD_MK) |
| 401 | include $(BUILD_STATIC_TEST_LIBRARY) |
| 402 | |
| 403 | # libsimpleperf_cts_test linux host |
| 404 | include $(CLEAR_VARS) |
| 405 | LOCAL_CLANG := true |
| 406 | LOCAL_MODULE := libsimpleperf_cts_test |
| 407 | LOCAL_MODULE_HOST_OS := linux |
Yabin Cui | 6acf8c6 | 2016-03-18 13:48:42 -0700 | [diff] [blame] | 408 | LOCAL_CPPFLAGS := $(simpleperf_cppflags_host) |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 409 | LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux) |
| 410 | LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files) |
| 411 | LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host) |
Yabin Cui | 040f7b4 | 2016-04-13 21:28:54 -0700 | [diff] [blame] | 412 | LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux) |
Yabin Cui | be7ec66 | 2016-03-02 13:56:28 -0800 | [diff] [blame] | 413 | LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) |
| 414 | LOCAL_MULTILIB := both |
| 415 | include $(LLVM_HOST_BUILD_MK) |
| 416 | include $(BUILD_HOST_STATIC_TEST_LIBRARY) |
| 417 | |
Christopher Ferris | 860a858 | 2016-01-25 16:21:54 -0800 | [diff] [blame] | 418 | include $(call first-makefiles-under,$(LOCAL_PATH)) |