blob: 248b34bdb93afc714d7957a6d1dfb7e8cbea2ff2 [file] [log] [blame]
// Copyright 2018 The Fuchsia 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 <lib/syslog/cpp/macros.h>
#include "intel_tests.h"
class UserFlagVerifier : public Verifier {
public:
static std::unique_ptr<Verifier> Create(const cpuperf::SessionResultSpec* spec) {
return std::make_unique<UserFlagVerifier>(spec);
}
UserFlagVerifier(const cpuperf::SessionResultSpec* spec) : Verifier(spec) {}
private:
bool VerifyRecord(const perfmon::SampleRecord& record) override {
// IWBN to verify we got a kernel pc here, but that doesn't always
// happen. There can be slippage to the time the event is reported.
return true;
}
bool VerifyTrace(const RecordCounts& counts) override {
if (counts.value_records != 0) {
FX_LOGS(ERROR) << "Found unexpected value records";
return false;
}
if (counts.pc_records == 0) {
FX_LOGS(ERROR) << "Expected pc records, none present";
return false;
}
return true;
}
};
const TestSpec kUserFlagSpec = {
"user-flag",
&UserFlagVerifier::Create,
};