summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2020-02-02 17:45:30 -0800
committer Yiwei Zhang <zzyiwei@google.com> 2020-02-03 00:00:50 -0800
commitbaaef8871ca4ffa8593cac188fe85d7ea387ff9e (patch)
tree3a67f48b2a42aaed5269c1615166132a1da28f14 /services
parenta433f5d64ef36150e7a919bdc8b12f5789817257 (diff)
GpuStats: separate stats module as a separate library
Bug: 141392969 Test: build, flash and boot, adb shell cmd gpu vkjson Change-Id: If88e84c65cf6c0ee8a9c4daa8fe6807db5e1e32d
Diffstat (limited to 'services')
-rw-r--r--services/gpuservice/Android.bp2
-rw-r--r--services/gpuservice/GpuService.cpp3
-rw-r--r--services/gpuservice/gpustats/Android.bp21
-rw-r--r--services/gpuservice/gpustats/GpuStats.cpp2
-rw-r--r--services/gpuservice/gpustats/include/gpustats/GpuStats.h (renamed from services/gpuservice/gpustats/GpuStats.h)8
5 files changed, 28 insertions, 8 deletions
diff --git a/services/gpuservice/Android.bp b/services/gpuservice/Android.bp
index baba64fdf8..6eed24a17b 100644
--- a/services/gpuservice/Android.bp
+++ b/services/gpuservice/Android.bp
@@ -20,6 +20,7 @@ cc_defaults {
"libbase",
"libbinder",
"libcutils",
+ "libgfxstats",
"libgraphicsenv",
"liblog",
"libutils",
@@ -52,7 +53,6 @@ filegroup {
name: "libgpuservice_sources",
srcs: [
"GpuService.cpp",
- "gpustats/GpuStats.cpp"
],
}
diff --git a/services/gpuservice/GpuService.cpp b/services/gpuservice/GpuService.cpp
index be4a462d0a..116cd16c57 100644
--- a/services/gpuservice/GpuService.cpp
+++ b/services/gpuservice/GpuService.cpp
@@ -24,14 +24,13 @@
#include <binder/Parcel.h>
#include <binder/PermissionCache.h>
#include <cutils/properties.h>
+#include <gpustats/GpuStats.h>
#include <private/android_filesystem_config.h>
#include <utils/String8.h>
#include <utils/Trace.h>
#include <vkjson.h>
-#include "gpustats/GpuStats.h"
-
namespace android {
using base::StringAppendF;
diff --git a/services/gpuservice/gpustats/Android.bp b/services/gpuservice/gpustats/Android.bp
new file mode 100644
index 0000000000..49a98cc450
--- /dev/null
+++ b/services/gpuservice/gpustats/Android.bp
@@ -0,0 +1,21 @@
+cc_library_shared {
+ name: "libgfxstats",
+ srcs: [
+ "GpuStats.cpp",
+ ],
+ shared_libs: [
+ "libcutils",
+ "libgraphicsenv",
+ "liblog",
+ "libutils",
+ ],
+ export_include_dirs: ["include"],
+ cppflags: [
+ "-Wall",
+ "-Werror",
+ "-Wformat",
+ "-Wthread-safety",
+ "-Wunused",
+ "-Wunreachable-code",
+ ],
+}
diff --git a/services/gpuservice/gpustats/GpuStats.cpp b/services/gpuservice/gpustats/GpuStats.cpp
index 7fff6edc38..63723b6686 100644
--- a/services/gpuservice/gpustats/GpuStats.cpp
+++ b/services/gpuservice/gpustats/GpuStats.cpp
@@ -17,7 +17,7 @@
#define LOG_TAG "GpuStats"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-#include "GpuStats.h"
+#include <gpustats/GpuStats.h>
#include <cutils/properties.h>
#include <log/log.h>
diff --git a/services/gpuservice/gpustats/GpuStats.h b/services/gpuservice/gpustats/include/gpustats/GpuStats.h
index 656b181464..bdc9bf50b1 100644
--- a/services/gpuservice/gpustats/GpuStats.h
+++ b/services/gpuservice/gpustats/include/gpustats/GpuStats.h
@@ -16,15 +16,15 @@
#pragma once
-#include <mutex>
-#include <unordered_map>
-#include <vector>
-
#include <graphicsenv/GpuStatsInfo.h>
#include <graphicsenv/GraphicsEnv.h>
#include <utils/String16.h>
#include <utils/Vector.h>
+#include <mutex>
+#include <unordered_map>
+#include <vector>
+
namespace android {
class GpuStats {