From 9aec926f866f54a311bd898b5f51188f9890a357 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 31 Jan 2017 11:42:24 -0800 Subject: libmetricslogger: Refactor Tron metrics histogram logging out of bootstat. To be shared with other native components that want to log histograms. Bug: 34456830 Test: libmetricslogger_test Change-Id: I94a1a91c6d33e443d66bc480158dc2470d6c9031 --- libmetricslogger/Android.bp | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 libmetricslogger/Android.bp (limited to 'libmetricslogger/Android.bp') diff --git a/libmetricslogger/Android.bp b/libmetricslogger/Android.bp new file mode 100644 index 000000000..ca8af574a --- /dev/null +++ b/libmetricslogger/Android.bp @@ -0,0 +1,64 @@ +// Copyright 2017 The Android Open Source Project + +metricslogger_lib_src_files = [ + "metrics_logger.cpp", +] + +cc_defaults { + name: "metricslogger_defaults", + + clang: true, + host_supported: true, + + export_include_dirs: ["include"], + local_include_dirs: ["include"], + shared_libs: ["liblog"], + whole_static_libs: ["libgtest_prod"], + + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + + // 524291 corresponds to sysui_histogram, from + // frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags + "-DHISTOGRAM_LOG_TAG=524291", + ], +} + +// metricslogger shared library +// ----------------------------------------------------------------------------- +cc_library_shared { + name: "libmetricslogger", + srcs: metricslogger_lib_src_files, + defaults: ["metricslogger_defaults"], +} + +// metricslogger shared library, debug +// ----------------------------------------------------------------------------- +cc_library_shared { + name: "libmetricslogger_debug", + srcs: metricslogger_lib_src_files, + defaults: ["metricslogger_defaults"], + + target: { + host: { + cflags: ["-UNDEBUG"], + }, + }, +} + +// Native tests +// ----------------------------------------------------------------------------- +cc_test { + name: "metricslogger_tests", + defaults: ["metricslogger_defaults"], + shared_libs: [ + "libbase", + "libmetricslogger_debug", + ], + srcs: [ + "metrics_logger_test.cpp", + "testrunner.cpp", + ], +} -- cgit v1.2.3