Home | History | Annotate | Download | only in simpleperf
      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 #
     16 LOCAL_PATH := $(call my-dir)
     17 
     18 simpleperf_version :=  $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)
     19 
     20 simpleperf_common_cflags := -Wall -Werror -Wextra -Wunused -Wno-unknown-pragmas \
     21                               -DSIMPLEPERF_REVISION='"$(simpleperf_version)"'
     22 
     23 simpleperf_cflags_target := $(simpleperf_common_cflags)
     24 
     25 simpleperf_cflags_host := $(simpleperf_common_cflags) \
     26                             -DUSE_BIONIC_UAPI_HEADERS -I bionic/libc/kernel \
     27                             -fvisibility=hidden \
     28 
     29 simpleperf_cflags_host_darwin := -I $(LOCAL_PATH)/nonlinux_support/include
     30 simpleperf_cflags_host_windows := -I $(LOCAL_PATH)/nonlinux_support/include
     31 
     32 
     33 LLVM_ROOT_PATH := external/llvm
     34 include $(LLVM_ROOT_PATH)/llvm.mk
     35 
     36 simpleperf_static_libraries_target := \
     37   libbacktrace \
     38   libunwindstack \
     39   libdexfile \
     40   libziparchive \
     41   libz \
     42   libbase \
     43   libcutils \
     44   liblog \
     45   libprocinfo \
     46   libutils \
     47   liblzma \
     48   libLLVMObject \
     49   libLLVMBitReader \
     50   libLLVMMC \
     51   libLLVMMCParser \
     52   libLLVMCore \
     53   libLLVMSupport \
     54   libprotobuf-cpp-lite \
     55   libevent \
     56 
     57 simpleperf_static_libraries_with_libc_target := \
     58   $(simpleperf_static_libraries_target) \
     59   libc \
     60 
     61 simpleperf_static_libraries_host := \
     62   libziparchive \
     63   libbase \
     64   liblog \
     65   liblzma \
     66   libz \
     67   libutils \
     68   libLLVMObject \
     69   libLLVMBitReader \
     70   libLLVMMC \
     71   libLLVMMCParser \
     72   libLLVMCore \
     73   libLLVMSupport \
     74   libprotobuf-cpp-lite \
     75 
     76 simpleperf_static_libraries_host_linux := \
     77   libprocinfo \
     78   libbacktrace \
     79   libunwindstack \
     80   libdexfile \
     81   libcutils \
     82   libevent \
     83 
     84 simpleperf_ldlibs_host_linux := -lrt
     85 
     86 # libsimpleperf
     87 # =========================================================
     88 libsimpleperf_src_files := \
     89   cmd_dumprecord.cpp \
     90   cmd_help.cpp \
     91   cmd_kmem.cpp \
     92   cmd_report.cpp \
     93   cmd_report_sample.cpp \
     94   command.cpp \
     95   dso.cpp \
     96   event_attr.cpp \
     97   event_type.cpp \
     98   perf_regs.cpp \
     99   read_apk.cpp \
    100   read_elf.cpp \
    101   record.cpp \
    102   record_file_reader.cpp \
    103   report_sample.proto \
    104   thread_tree.cpp \
    105   tracing.cpp \
    106   utils.cpp \
    107 
    108 libsimpleperf_src_files_linux := \
    109   CallChainJoiner.cpp \
    110   cmd_debug_unwind.cpp \
    111   cmd_list.cpp \
    112   cmd_record.cpp \
    113   cmd_stat.cpp \
    114   environment.cpp \
    115   event_fd.cpp \
    116   event_selection_set.cpp \
    117   InplaceSamplerClient.cpp \
    118   IOEventLoop.cpp \
    119   OfflineUnwinder.cpp \
    120   perf_clock.cpp \
    121   record_file_writer.cpp \
    122   UnixSocket.cpp \
    123   workload.cpp \
    124 
    125 libsimpleperf_src_files_darwin := \
    126   nonlinux_support/nonlinux_support.cpp \
    127 
    128 libsimpleperf_src_files_windows := \
    129   nonlinux_support/nonlinux_support.cpp \
    130 
    131 # libsimpleperf target
    132 include $(CLEAR_VARS)
    133 LOCAL_MODULE := libsimpleperf
    134 LOCAL_MODULE_TAGS := debug
    135 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
    136 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    137 LOCAL_SRC_FILES := \
    138   $(libsimpleperf_src_files) \
    139   $(libsimpleperf_src_files_linux) \
    140 
    141 LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
    142 LOCAL_MULTILIB := both
    143 LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
    144 include $(LLVM_DEVICE_BUILD_MK)
    145 include $(BUILD_STATIC_LIBRARY)
    146 
    147 # libsimpleperf host
    148 include $(CLEAR_VARS)
    149 LOCAL_MODULE := libsimpleperf
    150 LOCAL_MODULE_HOST_OS := darwin linux windows
    151 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    152 LOCAL_CFLAGS_darwin := $(simpleperf_cflags_host_darwin)
    153 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    154 LOCAL_CFLAGS_windows := $(simpleperf_cflags_host_windows)
    155 LOCAL_SRC_FILES := $(libsimpleperf_src_files)
    156 LOCAL_SRC_FILES_darwin := $(libsimpleperf_src_files_darwin)
    157 LOCAL_SRC_FILES_linux := $(libsimpleperf_src_files_linux)
    158 LOCAL_SRC_FILES_windows := $(libsimpleperf_src_files_windows)
    159 LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host)
    160 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    161 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    162 LOCAL_MULTILIB := both
    163 LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
    164 LOCAL_CXX_STL := libc++_static
    165 include $(LLVM_HOST_BUILD_MK)
    166 include $(BUILD_HOST_STATIC_LIBRARY)
    167 
    168 
    169 # simpleperf
    170 # =========================================================
    171 
    172 # simpleperf target
    173 include $(CLEAR_VARS)
    174 LOCAL_MODULE := simpleperf
    175 LOCAL_MODULE_TAGS := debug
    176 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
    177 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    178 LOCAL_SRC_FILES := main.cpp
    179 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_with_libc_target)
    180 ifdef TARGET_2ND_ARCH
    181 ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true)
    182 LOCAL_MULTILIB := both
    183 LOCAL_MODULE_STEM_32 := simpleperf32
    184 LOCAL_MODULE_STEM_64 := simpleperf
    185 endif
    186 endif
    187 LOCAL_FORCE_STATIC_EXECUTABLE := true
    188 include $(LLVM_DEVICE_BUILD_MK)
    189 include $(BUILD_EXECUTABLE)
    190 
    191 $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf.BUILT))
    192 ifdef TARGET_2ND_ARCH
    193 $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf$(TARGET_2ND_ARCH_MODULE_SUFFIX).BUILT))
    194 endif
    195 
    196 # simpleperf host
    197 include $(CLEAR_VARS)
    198 LOCAL_MODULE := simpleperf_host
    199 LOCAL_MODULE_HOST_OS := darwin linux windows
    200 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    201 LOCAL_CFLAGS_darwin := $(simpleperf_cflags_host_darwin)
    202 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    203 LOCAL_CFLAGS_windows := $(simpleperf_cflags_host_windows)
    204 LOCAL_SRC_FILES := main.cpp
    205 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    206 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    207 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    208 LOCAL_MULTILIB := both
    209 LOCAL_MODULE_STEM_32 := simpleperf32
    210 LOCAL_MODULE_STEM_64 := simpleperf
    211 LOCAL_CXX_STL := libc++_static
    212 include $(LLVM_HOST_BUILD_MK)
    213 include $(BUILD_HOST_EXECUTABLE)
    214 
    215 $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host.BUILT):simpleperf_host)
    216 ifdef HOST_2ND_ARCH
    217 $(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):simpleperf_host32)
    218 endif
    219 $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host.BUILT))
    220 ifdef HOST_CROSS_2ND_ARCH
    221 $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT))
    222 endif
    223 
    224 # libsimpleperf_record.a and libsimpleperf_record.so
    225 # They are linked to user's program, to get profile
    226 # counters and samples for specified code ranges.
    227 # =========================================================
    228 
    229 # libsimpleperf_record.a on target
    230 include $(CLEAR_VARS)
    231 LOCAL_MODULE := libsimpleperf_record
    232 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    233 LOCAL_SRC_FILES := record_lib_interface.cpp
    234 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target)
    235 LOCAL_MULTILIB := both
    236 LOCAL_CXX_STL := libc++_static
    237 LOCAL_LDLIBS := -Wl,--exclude-libs,ALL
    238 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    239 include $(LLVM_DEVICE_BUILD_MK)
    240 include $(BUILD_STATIC_LIBRARY)
    241 
    242 # libsimpleperf_record.so on target
    243 include $(CLEAR_VARS)
    244 LOCAL_MODULE := libsimpleperf_record
    245 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    246 LOCAL_SRC_FILES := record_lib_interface.cpp
    247 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target)
    248 LOCAL_MULTILIB := both
    249 LOCAL_CXX_STL := libc++_static
    250 LOCAL_LDLIBS := -Wl,--exclude-libs,ALL
    251 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    252 include $(LLVM_DEVICE_BUILD_MK)
    253 include $(BUILD_SHARED_LIBRARY)
    254 
    255 # libsimpleperf_record.a on host
    256 include $(CLEAR_VARS)
    257 LOCAL_MODULE := libsimpleperf_record
    258 LOCAL_MODULE_HOST_OS := linux
    259 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    260 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    261 LOCAL_SRC_FILES := record_lib_interface.cpp
    262 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    263 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    264 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
    265 LOCAL_MULTILIB := both
    266 LOCAL_CXX_STL := libc++_static
    267 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    268 include $(LLVM_HOST_BUILD_MK)
    269 include $(BUILD_HOST_STATIC_LIBRARY)
    270 
    271 # libsimpleperf_record.so on host
    272 include $(CLEAR_VARS)
    273 LOCAL_MODULE := libsimpleperf_record
    274 LOCAL_MODULE_HOST_OS := linux
    275 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    276 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    277 LOCAL_SRC_FILES := record_lib_interface.cpp
    278 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    279 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    280 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
    281 LOCAL_MULTILIB := both
    282 LOCAL_CXX_STL := libc++_static
    283 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    284 include $(LLVM_HOST_BUILD_MK)
    285 include $(BUILD_HOST_SHARED_LIBRARY)
    286 
    287 
    288 # libsimpleperf_report.so
    289 # It is the shared library used on host by python scripts
    290 # to report samples in different ways.
    291 # =========================================================
    292 include $(CLEAR_VARS)
    293 LOCAL_MODULE := libsimpleperf_report
    294 LOCAL_MODULE_HOST_OS := darwin linux windows
    295 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    296 LOCAL_CFLAGS_darwin := $(simpleperf_cflags_host_darwin)
    297 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    298 LOCAL_CFLAGS_windows := $(simpleperf_cflags_host_windows)
    299 LOCAL_SRC_FILES := report_lib_interface.cpp
    300 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    301 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    302 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
    303 LOCAL_MULTILIB := both
    304 LOCAL_CXX_STL := libc++_static
    305 include $(LLVM_HOST_BUILD_MK)
    306 include $(BUILD_HOST_SHARED_LIBRARY)
    307 
    308 $(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report.BUILT))
    309 ifdef HOST_2ND_ARCH
    310 $(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):libsimpleperf_report32.so)
    311 endif
    312 $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report.BUILT):libsimpleperf_report32.dll)
    313 ifdef HOST_CROSS_2ND_ARCH
    314 $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT))
    315 endif
    316 
    317 
    318 # libsimpleperf_inplace_sampler.so
    319 # It is the shared library linked with user's app and get samples from
    320 # signal handlers in each thread.
    321 # =========================================================
    322 
    323 # libsimpleperf_inplace_sampler.so on target
    324 include $(CLEAR_VARS)
    325 LOCAL_MODULE := libsimpleperf_inplace_sampler
    326 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    327 LOCAL_SRC_FILES := inplace_sampler_lib.cpp
    328 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target)
    329 LOCAL_MULTILIB := both
    330 LOCAL_CXX_STL := libc++_static
    331 LOCAL_LDLIBS := -Wl,--exclude-libs,ALL
    332 include $(LLVM_DEVICE_BUILD_MK)
    333 include $(BUILD_SHARED_LIBRARY)
    334 
    335 # libsimpleperf_inplace_sampler.so on host
    336 include $(CLEAR_VARS)
    337 LOCAL_MODULE := libsimpleperf_inplace_sampler
    338 LOCAL_MODULE_HOST_OS := linux
    339 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    340 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    341 LOCAL_SRC_FILES := inplace_sampler_lib.cpp
    342 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    343 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    344 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
    345 LOCAL_MULTILIB := both
    346 LOCAL_CXX_STL := libc++_static
    347 include $(LLVM_HOST_BUILD_MK)
    348 include $(BUILD_HOST_SHARED_LIBRARY)
    349 
    350 
    351 # simpleperf_unit_test
    352 # =========================================================
    353 simpleperf_unit_test_src_files := \
    354   cmd_kmem_test.cpp \
    355   cmd_report_test.cpp \
    356   cmd_report_sample_test.cpp \
    357   command_test.cpp \
    358   gtest_main.cpp \
    359   read_apk_test.cpp \
    360   read_elf_test.cpp \
    361   record_test.cpp \
    362   sample_tree_test.cpp \
    363   utils_test.cpp \
    364 
    365 simpleperf_unit_test_src_files_linux := \
    366   CallChainJoiner_test.cpp \
    367   cmd_debug_unwind_test.cpp \
    368   cmd_dumprecord_test.cpp \
    369   cmd_list_test.cpp \
    370   cmd_record_test.cpp \
    371   cmd_stat_test.cpp \
    372   environment_test.cpp \
    373   IOEventLoop_test.cpp \
    374   record_file_test.cpp \
    375   UnixSocket_test.cpp \
    376   workload_test.cpp \
    377 
    378 # simpleperf_unit_test target
    379 include $(CLEAR_VARS)
    380 LOCAL_MODULE := simpleperf_unit_test
    381 LOCAL_COMPATIBILITY_SUITE := device-tests
    382 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    383 LOCAL_SRC_FILES := \
    384   $(simpleperf_unit_test_src_files) \
    385   $(simpleperf_unit_test_src_files_linux) \
    386 
    387 LOCAL_STATIC_LIBRARIES += libsimpleperf $(simpleperf_static_libraries_with_libc_target)
    388 LOCAL_TEST_DATA := $(call find-test-data-in-subdirs,$(LOCAL_PATH),"*",testdata)
    389 LOCAL_MULTILIB := both
    390 LOCAL_FORCE_STATIC_EXECUTABLE := true
    391 include $(LLVM_DEVICE_BUILD_MK)
    392 include $(BUILD_NATIVE_TEST)
    393 
    394 # simpleperf_unit_test host
    395 include $(CLEAR_VARS)
    396 LOCAL_MODULE := simpleperf_unit_test
    397 LOCAL_MODULE_HOST_OS := darwin linux windows
    398 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    399 LOCAL_CFLAGS_darwin := $(simpleperf_cflags_host_darwin)
    400 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    401 LOCAL_CFLAGS_windows := $(simpleperf_cflags_host_windows)
    402 LOCAL_SRC_FILES := $(simpleperf_unit_test_src_files)
    403 LOCAL_SRC_FILES_linux := $(simpleperf_unit_test_src_files_linux)
    404 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    405 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    406 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    407 LOCAL_MULTILIB := both
    408 include $(LLVM_HOST_BUILD_MK)
    409 include $(BUILD_HOST_NATIVE_TEST)
    410 
    411 
    412 # simpleperf_cpu_hotplug_test
    413 # =========================================================
    414 simpleperf_cpu_hotplug_test_src_files := \
    415   cpu_hotplug_test.cpp \
    416 
    417 # simpleperf_cpu_hotplug_test target
    418 include $(CLEAR_VARS)
    419 LOCAL_MODULE := simpleperf_cpu_hotplug_test
    420 LOCAL_COMPATIBILITY_SUITE := device-tests
    421 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    422 LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files)
    423 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_with_libc_target)
    424 LOCAL_MULTILIB := both
    425 LOCAL_FORCE_STATIC_EXECUTABLE := true
    426 include $(LLVM_DEVICE_BUILD_MK)
    427 include $(BUILD_NATIVE_TEST)
    428 
    429 # simpleperf_cpu_hotplug_test linux host
    430 include $(CLEAR_VARS)
    431 LOCAL_MODULE := simpleperf_cpu_hotplug_test
    432 LOCAL_MODULE_HOST_OS := linux
    433 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    434 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    435 LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files)
    436 LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
    437 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    438 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    439 LOCAL_MULTILIB := first
    440 include $(LLVM_HOST_BUILD_MK)
    441 include $(BUILD_HOST_NATIVE_TEST)
    442 
    443 
    444 # libsimpleperf_cts_test
    445 # =========================================================
    446 libsimpleperf_cts_test_src_files := \
    447   $(libsimpleperf_src_files) \
    448   $(libsimpleperf_src_files_linux) \
    449   $(simpleperf_unit_test_src_files) \
    450   $(simpleperf_unit_test_src_files_linux) \
    451 
    452 # libsimpleperf_cts_test target
    453 include $(CLEAR_VARS)
    454 LOCAL_MODULE := libsimpleperf_cts_test
    455 LOCAL_CFLAGS := $(simpleperf_cflags_target) -DRUN_IN_APP_CONTEXT="\"com.android.simpleperf\""
    456 LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files)
    457 LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
    458 LOCAL_MULTILIB := both
    459 LOCAL_FORCE_STATIC_EXECUTABLE := true
    460 include $(LLVM_DEVICE_BUILD_MK)
    461 include $(BUILD_STATIC_TEST_LIBRARY)
    462 
    463 # libsimpleperf_cts_test linux host
    464 include $(CLEAR_VARS)
    465 LOCAL_MODULE := libsimpleperf_cts_test
    466 LOCAL_MODULE_HOST_OS := linux
    467 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    468 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    469 LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files)
    470 LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host)
    471 LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
    472 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    473 LOCAL_MULTILIB := both
    474 include $(LLVM_HOST_BUILD_MK)
    475 include $(BUILD_HOST_STATIC_TEST_LIBRARY)
    476 
    477 # simpleperf_record_test
    478 # ============================================================
    479 
    480 # simpleperf_record_test target
    481 include $(CLEAR_VARS)
    482 LOCAL_MODULE := simpleperf_record_test
    483 LOCAL_CFLAGS := $(simpleperf_cflags_target)
    484 LOCAL_SRC_FILES := record_lib_test.cpp
    485 LOCAL_SHARED_LIBRARIES := libsimpleperf_record
    486 LOCAL_MULTILIB := both
    487 include $(BUILD_NATIVE_TEST)
    488 
    489 # simpleperf_record_test linux host
    490 include $(CLEAR_VARS)
    491 LOCAL_MODULE := simpleperf_record_test
    492 LOCAL_MODULE_HOST_OS := linux
    493 LOCAL_CFLAGS := $(simpleperf_cflags_host)
    494 LOCAL_CFLAGS_linux := $(simpleperf_cflags_host_linux)
    495 LOCAL_SRC_FILES := record_lib_test.cpp
    496 LOCAL_SHARED_LIBRARIES := libsimpleperf_record
    497 LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
    498 LOCAL_MULTILIB := both
    499 include $(BUILD_HOST_NATIVE_TEST)
    500 
    501 
    502 # simpleperf_script.zip (for release in ndk)
    503 # ============================================================
    504 SIMPLEPERF_SCRIPT_LIST := \
    505     $(filter-out scripts/update.py,$(call all-named-files-under,*.py,scripts)) \
    506     scripts/inferno.sh \
    507     scripts/inferno.bat \
    508     scripts/inferno/inferno.b64 \
    509     $(call all-named-files-under,*,scripts/script_testdata) \
    510     $(call all-named-files-under,*.js,scripts) \
    511     $(call all-named-files-under,*.css,scripts) \
    512     $(call all-named-files-under,*,doc) \
    513     $(call all-named-files-under,app-profiling.apk,demo) \
    514     $(call all-named-files-under,*.so,demo) \
    515     $(call all-cpp-files-under,demo) \
    516     $(call all-java-files-under,demo) \
    517     $(call all-named-files-under,*.kt,demo) \
    518     testdata/perf_with_symbols.data \
    519     testdata/perf_with_trace_offcpu.data \
    520     testdata/perf_with_tracepoint_event.data
    521 
    522 SIMPLEPERF_SCRIPT_LIST := $(addprefix -f $(LOCAL_PATH)/,$(SIMPLEPERF_SCRIPT_LIST))
    523 
    524 SIMPLEPERF_SCRIPT_PATH := \
    525     $(call intermediates-dir-for,PACKAGING,simplerperf_script,HOST)/simpleperf_script.zip
    526 
    527 $(SIMPLEPERF_SCRIPT_PATH) : $(SOONG_ZIP)
    528 	$(hide) $(SOONG_ZIP) -d -o $@ -C system/extras/simpleperf $(SIMPLEPERF_SCRIPT_LIST)
    529 
    530 sdk: $(SIMPLEPERF_SCRIPT_PATH)
    531 
    532 $(call dist-for-goals,sdk,$(SIMPLEPERF_SCRIPT_PATH))
    533 
    534 include $(call first-makefiles-under,$(LOCAL_PATH))
    535