Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: Iad6e481a8b737353f20b4c6d4d0fb4f11fe65012
Change-Id: I5f9db227945e3dc55b7b2b68fc1959a3a9f1899a
diff --git a/fuzzing/system_fuzzers/libwatchdog_perf_service/Android.bp b/fuzzing/system_fuzzers/libwatchdog_perf_service/Android.bp
index 1193d18..16e3a14 100644
--- a/fuzzing/system_fuzzers/libwatchdog_perf_service/Android.bp
+++ b/fuzzing/system_fuzzers/libwatchdog_perf_service/Android.bp
@@ -22,6 +22,7 @@
"libwatchdog_perf_service",
],
shared_libs: [
+ "android.hardware.automotive.vehicle@2.0",
"libbase",
],
}
diff --git a/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp b/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
index 4de3b0e..816945b 100644
--- a/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
+++ b/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
@@ -14,13 +14,15 @@
* limitations under the License.
*/
-#include "IoPerfCollection.h"
-#include "UidIoStats.h"
-
#include <android-base/file.h>
#include <fuzzer/FuzzedDataProvider.h>
+
#include <iostream>
+#include "IoPerfCollection.h"
+#include "ProcStat.h"
+#include "UidIoStatsCollector.h"
+
namespace android {
namespace automotive {
namespace watchdog {
@@ -41,7 +43,7 @@
std::string uidIoStatsSnapshot;
std::string procStatsSnapshot;
- // Prepare for UidIOStats data
+ // Prepare for UidIoStatsCollector data
int count = 0;
while (fdp.remaining_bytes() > (size / 2)) {
uint64_t val = fdp.ConsumeIntegral<uint64_t>();
@@ -76,18 +78,18 @@
}
if (uidIoStatsSnapshot.size() > 0 && procStatsSnapshot.size() > 0) {
- // Test UidIoStats
- TemporaryFile tf1;
- WriteStringToFile(uidIoStatsSnapshot, tf1.path);
- UidIoStats uidIoStats(tf1.path);
- assert(uidIoStats.enabled() == true);
- uidIoStats.collect();
- // Test ProcStats
- TemporaryFile tf2;
- WriteStringToFile(procStatsSnapshot, tf2.path);
- ProcStat procStat(tf2.path);
- assert(procStat.enabled() == true);
- procStat.collect();
+ // Test UidIoStatsCollector
+ TemporaryFile tf1;
+ WriteStringToFile(uidIoStatsSnapshot, tf1.path);
+ UidIoStatsCollector uidIoStatsCollector(tf1.path);
+ assert(uidIoStatsCollector.enabled() == true);
+ uidIoStatsCollector.collect();
+ // Test ProcStat
+ TemporaryFile tf2;
+ WriteStringToFile(procStatsSnapshot, tf2.path);
+ ProcStat procStat(tf2.path);
+ assert(procStat.enabled() == true);
+ procStat.collect();
}
return 0;
}