diff options
| -rw-r--r-- | Android.bp | 6 | ||||
| -rw-r--r-- | OWNERS | 1 | ||||
| -rw-r--r-- | include/memtrack/memtrack.h | 27 | ||||
| -rw-r--r-- | memtrack.cpp | 10 |
4 files changed, 43 insertions, 1 deletions
@@ -1,5 +1,9 @@ // Copyright 2013 The Android Open Source Project +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + cc_library_shared { name: "libmemtrack", vendor_available: true, @@ -18,7 +22,7 @@ cc_library_shared { "libhidlbase", "libutils", "android.hardware.memtrack@1.0", - "android.hardware.memtrack-unstable-ndk_platform", + "android.hardware.memtrack-V1-ndk_platform", ], cflags: [ "-Wall", @@ -1 +1,2 @@ ccross@google.com +surenb@google.com
\ No newline at end of file diff --git a/include/memtrack/memtrack.h b/include/memtrack/memtrack.h index 2134a6f..91dd8c8 100644 --- a/include/memtrack/memtrack.h +++ b/include/memtrack/memtrack.h @@ -129,6 +129,33 @@ ssize_t memtrack_proc_other_total(struct memtrack_proc *p); */ ssize_t memtrack_proc_other_pss(struct memtrack_proc *p); +/** + * class DeviceInfo + * + * Contains the device id and name. + */ +namespace aidl { +namespace android { +namespace hardware { +namespace memtrack { + +class DeviceInfo; + +} // namespace memtrack +} // namespace hardware +} // namespace android +} // namespace aidl + +/** + * memtrack_gpu_device_info + * + * Populates the @device_info vector with the DeviceInfo for all GPU devices. + * + * Returns true on success and false otherwise. + */ +bool memtrack_gpu_device_info( + std::vector<aidl::android::hardware::memtrack::DeviceInfo>* device_info); + #ifdef __cplusplus } #endif diff --git a/memtrack.cpp b/memtrack.cpp index 807a5c3..297d8ce 100644 --- a/memtrack.cpp +++ b/memtrack.cpp @@ -104,6 +104,16 @@ static std::shared_ptr<V_aidl::IMemtrack> get_aidl_instance() { return V_aidl::IMemtrack::fromBinder(memtrack_binder); } +bool memtrack_gpu_device_info(std::vector<V_aidl::DeviceInfo>* device_info) { + std::shared_ptr<V_aidl::IMemtrack> service = get_aidl_instance(); + if (!service) { + return false; + } + + auto status = service->getGpuDeviceInfo(device_info); + return status.isOk(); +} + memtrack_proc *memtrack_proc_new(void) { return new memtrack_proc(); |
