aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2018-03-07 20:22:58 -0800
committerAndreas Gampe <agampe@google.com>2018-03-09 17:55:06 -0800
commit894ed1953498b645d1c1ead3311c47115ce4a5ff (patch)
tree05754414d7ca8d8e47c8e7f15b1c0a86edb72302
parent000c1b2b980a1814e8a1817bc030bbf47fbac4cc (diff)
downloadperf_data_converter-894ed1953498b645d1c1ead3311c47115ce4a5ff.tar.gz
PerfDataConverter: Switch to libbase for logging
Add androidbase, keep a thin layer for verbose logging (ignoring the level). Bug: 73175642 Test: mmma external/perf_data_converter/src/quipper Test: quipper-full_unit_tests Change-Id: Ibc7efc2681fb1a644b6d8b560846b31a0988b4b0
-rw-r--r--src/quipper/Android.bp12
-rw-r--r--src/quipper/androidbase/base/logging.cc11
-rw-r--r--src/quipper/androidbase/base/logging.h30
-rw-r--r--src/quipper/androidbase/base/macros.h10
4 files changed, 59 insertions, 4 deletions
diff --git a/src/quipper/Android.bp b/src/quipper/Android.bp
index 9e90c69..11a1257 100644
--- a/src/quipper/Android.bp
+++ b/src/quipper/Android.bp
@@ -30,14 +30,13 @@ cc_defaults {
"binary_data_utils.cc",
"buffer_reader.cc",
"buffer_writer.cc",
- // "compat/log_level.cc",
"data_reader.cc",
"data_writer.cc",
"dso.cc",
"file_reader.cc",
"file_utils.cc",
"huge_page_deducer.cc",
- "mybase/base/logging.cc",
+ "androidbase/base/logging.cc",
"perf_option_parser.cc",
"perf_data_utils.cc",
"perf_parser.cc",
@@ -56,7 +55,10 @@ cc_defaults {
],
local_include_dirs: [
"compat/non_cros",
- "mybase",
+ "androidbase",
+ ],
+ static_libs: [
+ "libbase",
],
whole_static_libs: [
"libcrypto", // For MD5.
@@ -66,7 +68,7 @@ cc_defaults {
export_include_dirs: [
".",
- "mybase",
+ "androidbase",
],
proto: {
canonical_path_from_root: true,
@@ -162,6 +164,8 @@ cc_test {
enabled: false,
static_libs: [
+ "libbase",
+ "liblog",
"libprotobuf-cpp-lite",
"libquipper",
],
diff --git a/src/quipper/androidbase/base/logging.cc b/src/quipper/androidbase/base/logging.cc
new file mode 100644
index 0000000..89df308
--- /dev/null
+++ b/src/quipper/androidbase/base/logging.cc
@@ -0,0 +1,11 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+
+namespace logging {
+
+bool gVlogEnabled = false;
+
+} // namespace logging
diff --git a/src/quipper/androidbase/base/logging.h b/src/quipper/androidbase/base/logging.h
new file mode 100644
index 0000000..f19babc
--- /dev/null
+++ b/src/quipper/androidbase/base/logging.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
+#define CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
+
+#include <errno.h> // for errno
+#include <string.h> // for strerror
+
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "android-base/logging.h"
+
+// Emulate Chrome-like logging.
+
+namespace logging {
+
+extern bool gVlogEnabled;
+
+} // namespace logging
+
+#define VLOG(level) ::logging::gVlogEnabled && LOG(INFO)
+
+#define DLOG(x) LOG(x)
+#define DVLOG(x) VLOG(x)
+
+#endif // CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
diff --git a/src/quipper/androidbase/base/macros.h b/src/quipper/androidbase/base/macros.h
new file mode 100644
index 0000000..be04d17
--- /dev/null
+++ b/src/quipper/androidbase/base/macros.h
@@ -0,0 +1,10 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_MACROS_H_
+#define CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_MACROS_H_
+
+#include "android-base/macros.h"
+
+#endif // CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_MACROS_H_