Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 315967e6 authored by Tri Vo's avatar Tri Vo
Browse files

trusty: coverage: Append .<pid>.sancov to sancov file names

Bug: 175221942
Test: adb shell ./trusty_gatekeeper_fuzzer -runs=0 corpus
Change-Id: Ic7a30b7531e8a327fb8ebe953fa02946e8539579
parent 2c56d833
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ namespace coverage {
using android::base::ErrnoError;
using android::base::Error;
using std::string;
using std::to_string;
using std::unique_ptr;

static inline uintptr_t RoundPageUp(uintptr_t val) {
@@ -54,11 +55,11 @@ CoverageRecord::CoverageRecord(string tipc_dev, struct uuid* uuid)
      shm_(NULL),
      shm_len_(0) {}

CoverageRecord::CoverageRecord(string tipc_dev, struct uuid* uuid, string sancov_filename)
CoverageRecord::CoverageRecord(string tipc_dev, struct uuid* uuid, string module_name)
    : tipc_dev_(std::move(tipc_dev)),
      coverage_srv_fd_(-1),
      uuid_(*uuid),
      sancov_filename_(sancov_filename),
      sancov_filename_(module_name + "." + to_string(getpid()) + ".sancov"),
      record_len_(0),
      shm_(NULL),
      shm_len_(0) {}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class CoverageRecord {
     * Create a coverage record interface. On destruction, write this coverage
     * to the given sancov filename.
     */
    CoverageRecord(std::string tipc_dev, struct uuid* uuid, std::string sancov_filename);
    CoverageRecord(std::string tipc_dev, struct uuid* uuid, std::string module_name);

    ~CoverageRecord();
    Result<void> Open();