/test/dittosuite/src/ |
D | result.cpp | 41 Result::Result(const std::string& name, const int repeat) : name_(name), repeat_(repeat) {} in Result() 43 void Result::AddMeasurement(const std::string& name, const std::vector<double>& samples) { in AddMeasurement() 48 void Result::AddSubResult(std::unique_ptr<Result> result) { in AddSubResult() 49 sub_results_.push_back(std::move(result)); in AddSubResult() 52 std::vector<double> Result::GetSamples(const std::string& measurement_name) const { in GetSamples() 62 void Result::AnalyseMeasurement(const std::string& name) { in AnalyseMeasurement() 70 std::string Result::ComputeNextInstructionPath(const std::string& instruction_path) { in ComputeNextInstructionPath() 74 void Result::Print(const ResultsOutput results_output, const std::string& instruction_path) { in Print() 92 std::cout << std::setfill('-') << std::setw(kTableWidth) << "" << std::setfill(' '); in PrintTableBorder() 93 std::cout << '\n'; in PrintTableBorder() [all …]
|
D | parser.cpp | 36 std::unique_ptr<dittosuiteproto::Benchmark> Parser::__Parse( in __Parse() 37 std::string json_benchmark, const std::vector<std::string>& parameters) in __Parse() 40 std::unique_ptr<dittosuiteproto::Benchmark> benchmark = in __Parse() 41 std::make_unique<dittosuiteproto::Benchmark>(); in __Parse() 43 for (std::size_t i = 0; i < parameters.size(); i++) { in __Parse() 44 std::string to_replace("$PARAMETER_" + std::to_string(i + 1) + "$"); in __Parse() 46 if (position == std::string::npos) { in __Parse() 57 std::list<int> thread_ids({InstructionFactory::GenerateThreadId()}); in __Parse() 75 std::unique_ptr<dittosuiteproto::Benchmark> Parser::ParseEmbedded( in ParseEmbedded() 76 const std::string& embedded_benchmark, const std::vector<std::string>& parameters) { in ParseEmbedded() [all …]
|
D | multiprocessing.cpp | 27 std::vector<std::unique_ptr<Instruction>> instructions, in Multiprocessing() 28 std::vector<MultithreadingParams> thread_params) in Multiprocessing() 30 instructions_(std::move(instructions)), in Multiprocessing() 31 thread_params_(std::move(thread_params)) {} in Multiprocessing() 69 LOGD("Created pipe for: " + std::to_string(i)); in SetUpSingle() 84 LOGD("Child process created: " + std::to_string(instruction_id_) + in SetUpSingle() 85 " pid: " + std::to_string(getpid())); in SetUpSingle() 99 LOGD("Trying to set the name for instruction: " + std::to_string(instruction_id_) + in SetUpSingle() 100 "; process: " + std::to_string(getpid()) + in SetUpSingle() 111 LOGD("Process initializing instruction: " + std::to_string(instruction_id_) + in SetUpSingle() [all …]
|
D | instruction_set.cpp | 32 std::vector<std::unique_ptr<Instruction>> instructions, int list_key, in InstructionSet() 35 instructions_(std::move(instructions)), in InstructionSet() 44 std::vector<std::unique_ptr<Instruction>> instructions) in InstructionSet() 46 instructions_(std::move(instructions)), in InstructionSet() 66 std::visit(overloaded{[&](const std::vector<std::string>& list) { in RunSingle() 67 std::uniform_int_distribution<> uniform_distribution(0, in RunSingle() 69 for (std::size_t i = 0; i < list.size(); ++i) { in RunSingle() 87 [](const std::string&) { in RunSingle() 106 std::unique_ptr<Result> InstructionSet::CollectResults(const std::string& prefix) { in CollectResults() 107 auto result = std::make_unique<Result>(prefix + name_, repeat_); in CollectResults() [all …]
|
/test/dittosuite/include/ditto/ |
D | result.h | 37 explicit Result(const std::string& name, int repeat); 39 void AddMeasurement(const std::string& type, const std::vector<double>& samples); 40 void AddSubResult(std::unique_ptr<Result> result); 41 std::vector<double> GetSamples(const std::string& measurement_name) const; 43 void Print(ResultsOutput results_output, const std::string& instruction_path); 45 void SetStatistics(const std::string& name, const Statistics& stats); 48 static std::unique_ptr<Result> FromPb(const dittosuiteproto::Result &pb); 54 std::string name; 59 std::string name; 63 std::string name_; [all …]
|
D | parser.h | 30 std::unique_ptr<dittosuiteproto::Benchmark> ParseFile(const std::string& file_path, 31 const std::vector<std::string>& parameters); 32 std::unique_ptr<dittosuiteproto::Benchmark> ParseEmbedded( 33 const std::string& embedded_benchmark, const std::vector<std::string>& parameters); 34 std::unique_ptr<Instruction> GetInit(); 35 std::unique_ptr<Instruction> GetMain(); 36 std::unique_ptr<Instruction> GetCleanUp(); 39 std::unique_ptr<Instruction> init_; 40 std::unique_ptr<Instruction> main_; 41 std::unique_ptr<Instruction> clean_up_; [all …]
|
D | shared_variables.h | 27 typedef std::variant<int, std::string, std::vector<std::string>> Variant; 29 static int GetKey(const std::list<int>& thread_ids, const std::string& variable_name); 31 static Variant Get(const std::list<int>& thread_ids, const std::string& variable_name); 33 static void Set(const std::list<int>& thread_ids, const std::string& variable_name, 38 static std::vector<Variant> variables_; 39 static std::unordered_map<int, std::unordered_map<std::string, int>> keys_;
|
D | multithreading.h | 26 inline static const std::string kName = "multithreading"; 29 std::vector<std::unique_ptr<Instruction>> instructions, 30 std::vector<MultithreadingParams> thread_params); 32 std::unique_ptr<Result> CollectResults(const std::string& prefix) override; 39 std::vector<std::unique_ptr<Instruction>> instructions_; 40 std::vector<std::thread> threads_; 41 std::vector<MultithreadingParams> thread_params_;
|
D | multiprocessing.h | 28 inline static const std::string kName = "multiprocessing"; 31 std::vector<std::unique_ptr<Instruction>> instructions, 32 std::vector<MultithreadingParams> thread_params); 33 std::unique_ptr<Result> CollectResults(const std::string& prefix) override; 40 std::vector<std::unique_ptr<Instruction>> instructions_; 41 std::vector<MultithreadingParams> thread_params_; 42 std::vector<std::array<int, 2>> pipe_fds_;
|
D | tracer.h | 31 void StartSession(std::unique_ptr<dittosuiteproto::Benchmark> benchmark); 32 void Start(const std::string &splice); 33 void End(const std::string &splice); 36 std::ofstream trace_marker_; 37 std::string id_; 41 std::string trace_format__(const T& id) { in trace_format__() 42 return std::string("|") + id; in trace_format__() 46 std::string trace_format__(const T& id, Args... vars) { in trace_format__() 47 return std::string("|") + id + trace_format__(vars...); in trace_format__() 51 std::string trace_format(const T& id) { in trace_format() [all …]
|
D | instruction_set.h | 28 inline static const std::string kName = "instruction_set"; 31 std::vector<std::unique_ptr<Instruction>> instructions, int list_key, 34 std::vector<std::unique_ptr<Instruction>> instructions); 36 std::unique_ptr<Result> CollectResults(const std::string& prefix) override; 44 std::vector<std::unique_ptr<Instruction>> instructions_; 50 std::mt19937_64 gen_;
|
/test/dittosuite/test/ |
D | example_test.cpp | 21 bool string_has_suffix(const std::string& input, const std::string& suffix) { in string_has_suffix() 32 void __ditto_files_paths(std::vector<std::string>* ditto_paths, const std::string& base_path) { in __ditto_files_paths() 36 std::cout << "Recursing in: " << base_path << std::endl; in __ditto_files_paths() 38 std::string path = base_path + "/" + entry->d_name; in __ditto_files_paths() 39 std::cout << "Found: " << path << std::endl; in __ditto_files_paths() 48 if (std::string(".").compare(entry->d_name) && std::string("..").compare(entry->d_name)) { in __ditto_files_paths() 59 std::vector<std::string> ditto_files_paths() { in ditto_files_paths() 60 std::string base_path; in ditto_files_paths() 61 std::vector<std::string> paths; in ditto_files_paths() 73 class ExampleTest : public testing::TestWithParam<std::string> {}; [all …]
|
D | result.cpp | 21 class DittoResult : public testing::TestWithParam<std::tuple<ResultsOutput, std::string_view>> {}; 25 ASSERT_EQ(ArgToResultsOutput(std::get<1>(param)), (std::get<0>(param))); in TEST_P() 29 testing::Values(std::make_tuple(ResultsOutput::kReport, "report"), 30 std::make_tuple(ResultsOutput::kCsv, "csv"), 31 std::make_tuple(ResultsOutput::kPb, "pb"), 32 std::make_tuple(ResultsOutput::kNull, "null"))); 35 testing::Values(std::make_tuple(ResultsOutput::kReport, "0"), 36 std::make_tuple(ResultsOutput::kCsv, "1"), 37 std::make_tuple(ResultsOutput::kPb, "2"), 38 std::make_tuple(ResultsOutput::kNull, "-1"))); [all …]
|
D | logger_test.cpp | 37 std::cout << "My log level: " << static_cast<int>(Logger::GetInstance().GetLogLevel()) << '\n'; in TEST() 87 : public testing::TestWithParam<std::pair<std::string_view, dittosuite::LogLevel>> {}; 100 std::make_pair("VERBOSE", LogLevel::kVerbose), std::make_pair("DEBUG", LogLevel::kDebug), 101 std::make_pair("INFO", LogLevel::kInfo), std::make_pair("WARNING", LogLevel::kWarning), 102 std::make_pair("ERROR", LogLevel::kError), std::make_pair("FATAL", LogLevel::kFatal), 103 std::make_pair("5", LogLevel::kVerbose), std::make_pair("4", LogLevel::kDebug), 104 std::make_pair("3", LogLevel::kInfo), std::make_pair("2", LogLevel::kWarning), 105 std::make_pair("1", LogLevel::kError), std::make_pair("0", LogLevel::kFatal))); 108 testing::Values(std::make_pair("6", LogLevel::kInfo), 109 std::make_pair("-1", LogLevel::kInfo), [all …]
|
/test/vts-testcase/security/avb/ |
D | gsi_validation_utils.cpp | 45 bool HexToBytes(const std::string &hex, std::vector<uint8_t> *bytes) { in HexToBytes() 64 std::string BytesToHex(const std::vector<uint8_t> &bytes) { in BytesToHex() 65 std::string retval; in BytesToHex() 74 std::unique_ptr<ShaHasher> CreateShaHasher(const std::string &algorithm) { in CreateShaHasher() 76 return std::make_unique<ShaHasherImpl<SHA_CTX>>( in CreateShaHasher() 80 return std::make_unique<ShaHasherImpl<SHA256_CTX>>( in CreateShaHasher() 84 return std::make_unique<ShaHasherImpl<SHA512_CTX>>( in CreateShaHasher() 90 static std::optional<std::string> ReadCommandToString(const std::string &command) { in ReadCommandToString() 91 std::unique_ptr<FILE, decltype(&pclose)> cmd_out_stream(popen(command.c_str(), "re"), in ReadCommandToString() 96 return std::nullopt; in ReadCommandToString() [all …]
|
D | VtsSecurityAvbTest.cpp | 51 const std::vector<uint8_t> buffer(size, 0); in CalculateZeroDigest() 93 std::vector<uint8_t> calculating_hash_block; 116 static std::string VerifyHashtree(int image_fd, uint64_t image_size, in VerifyHashtree() 117 const std::vector<uint8_t> &salt, in VerifyHashtree() 122 const std::vector<uint8_t> &root_digest) { in VerifyHashtree() 137 std::list<HashtreeLevel> levels; in VerifyHashtree() 160 for (auto level = std::prev(levels.end()); level != levels.begin(); in VerifyHashtree() 162 std::prev(level)->comparing_tree_offset = in VerifyHashtree() 167 std::vector<uint8_t> padded_zero_digest(padded_digest_size, 0); in VerifyHashtree() 173 std::vector<uint8_t> data_block(data_block_size); in VerifyHashtree() [all …]
|
/test/mlts/benchmark/jni/ |
D | run_tflite.h | 43 std::vector<InferenceOutput> outputs; 44 std::function<bool(uint8_t*, size_t)> createInput; 48 using InferenceInOutSequence = std::vector<InferenceInOut>; 54 std::vector<float> meanSquareErrors; 56 std::vector<float> maxSingleErrors; 58 std::vector<std::vector<uint8_t>> inferenceOutputs; 64 std::vector<float> compileWithoutCacheTimeSec; 66 std::optional<std::vector<float>> saveToCacheTimeSec; 67 std::optional<std::vector<float>> prepareFromCacheTimeSec; 105 bool resizeInputTensors(std::vector<int> shape); [all …]
|
/test/dittosuite/ |
D | dittotrace.cpp | 27 std::string name; 28 std::vector<std::string> arguments; 29 std::string return_value; 33 std::vector<std::string> ReadLines(const std::string& file_path) { in ReadLines() 34 std::vector<std::string> lines; in ReadLines() 36 std::string line; in ReadLines() 37 std::ifstream input(file_path); in ReadLines() 38 while (std::getline(input, line)) { in ReadLines() 47 Syscall ProcessLine(const std::string& line) { in ProcessLine() 51 std::string raw_arguments = line.substr(line.find('(') + 1, line.find(')') - line.find('(') - 1); in ProcessLine() [all …]
|
/test/vts-testcase/kernel/gki/ |
D | generic_boot_image_test.cpp | 65 std::optional<std::string> get_config( in get_config() 66 const std::map<std::string, std::string>& configs, const std::string& key) { in get_config() 69 return std::nullopt; in get_config() 96 int firstApiLevel = std::stoi(android::base::GetProperty("ro.product.first_api_level", "0")); in SetUp() 101 std::shared_ptr<const RuntimeInfo> runtime_info; 113 const std::string& release = runtime_info->osRelease(); in TEST_F() 123 std::set<std::string> GetRequirementBySdkLevel(uint32_t target_sdk_level) { in GetRequirementBySdkLevel() 126 static const std::map<uint32_t, std::set<std::string>> required_by_level = { in GetRequirementBySdkLevel() 132 std::set<std::string> res; in GetRequirementBySdkLevel() 142 std::set<std::string> GetAllowListBySdkLevel(uint32_t target_sdk_level) { in GetAllowListBySdkLevel() [all …]
|
/test/vts-testcase/kernel/encryption/ |
D | utils.cpp | 42 static const std::vector<std::vector<uint8_t>> HwWrappedEncryptionKeyContexts = 56 static bool GetKdfContext(std::vector<uint8_t> *ctx) { in GetKdfContext() 57 std::string kdf = in GetKdfContext() 84 std::string Errno() { return std::string(": ") + strerror(errno); } in Errno() 87 void DeleteRecursively(const std::string &path) { in DeleteRecursively() 91 std::unique_ptr<DIR, int (*)(DIR *)> dirp(opendir(path.c_str()), closedir); in DeleteRecursively() 98 std::string filename(entry->d_name); in DeleteRecursively() 108 void RandomBytesForTesting(std::vector<uint8_t> &bytes) { in RandomBytesForTesting() 115 std::vector<uint8_t> GenerateTestKey(size_t size) { in GenerateTestKey() 116 std::vector<uint8_t> key(size); in GenerateTestKey() [all …]
|
D | vts_kernel_encryption.h | 30 bool Encrypt(const std::vector<uint8_t> &key, const uint8_t *iv, in Encrypt() 38 bool Decrypt(const std::vector<uint8_t> &key, const uint8_t *iv, in Decrypt() 90 std::string Errno(); 92 void DeleteRecursively(const std::string &path); 94 void RandomBytesForTesting(std::vector<uint8_t> &bytes); 96 std::vector<uint8_t> GenerateTestKey(size_t size); 98 std::string BytesToHex(const std::vector<uint8_t> &bytes); 101 static inline std::string BytesToHex(const uint8_t (&array)[N]) { in BytesToHex() 102 return BytesToHex(std::vector<uint8_t>(&array[0], &array[N])); in BytesToHex() 114 std::string fs_blk_device; [all …]
|
D | Keymaster.cpp | 40 static void zeroize_vector(std::vector<uint8_t>& vec) { in zeroize_vector() 46 const std::string& func_name) { in logKeystore2ExceptionIfPresent() 88 std::string* key) { in generateKey() 91 .alias = std::nullopt, in generateKey() 93 .blob = std::nullopt, in generateKey() 97 in_key, std::nullopt, inParams.vector_data(), 0, {}, &keyMetadata); in generateKey() 101 if (keyMetadata.key.blob == std::nullopt) { in generateKey() 107 std::string(keyMetadata.key.blob->begin(), keyMetadata.key.blob->end()); in generateKey() 114 const std::string& key, std::string* outKeyBlob) { in importKey() 117 .alias = std::nullopt, in importKey() [all …]
|
/test/mlts/benchmark/native/ |
D | multi_process_test.cpp | 68 std::string modelFileName(path); in canReadInputFile() 69 std::ifstream fstream(modelFileName); in canReadInputFile() 70 std::stringstream readBuffer; in canReadInputFile() 75 bool readInputData(const char* inputDataFileName, std::vector<int> input_shape, in readInputData() 77 std::vector<InferenceInOutSequence>* result) { in readInputData() 79 std::for_each( in readInputData() 84 std::ifstream dataFile; in readInputData() 90 std::function<bool(uint8_t*, size_t)> failToGenerateData = in readInputData() 93 std::unique_ptr<uint8_t[]> dataBuffer = in readInputData() 94 std::make_unique<uint8_t[]>(inputDataSizeBytes); in readInputData() [all …]
|
/test/vts-testcase/hal/thermal/V1_0/target_stress/ |
D | thermal_hidl_stress_test.cpp | 49 inline std::cv_status wait() { in wait() 50 std::unique_lock<std::mutex> lock(mtx_); in wait() 52 std::cv_status status = std::cv_status::no_timeout; in wait() 53 auto now = std::chrono::system_clock::now(); in wait() 55 status = cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); in wait() 56 if (status == std::cv_status::timeout) return status; in wait() 64 std::mutex mtx_; 65 std::condition_variable cv_; 76 std::unique_lock<std::mutex> lock(mtx_); in TEST_F() 80 EXPECT_EQ(std::cv_status::no_timeout, wait()); in TEST_F() [all …]
|
/test/vts-testcase/kernel/bow/ |
D | BowTest.cpp | 68 template <void (*Prepare)(std::string)> 79 loop_device_ = std::string("/dev/block/loop") + std::to_string(i); in SetUp() 96 const static std::string loop_file_; 101 std::string loop_device_; 104 template <void (*Prepare)(std::string)> 105 const std::string LoopbackTestFixture<Prepare>::loop_file_ = 108 void PrepareBowDefault(std::string) {} in PrepareBowDefault() 110 template <void (*PrepareLoop)(std::string), 111 void (*PrepareBow)(std::string) = PrepareBowDefault> 113 std::string GetTableStatus() { in GetTableStatus() [all …]
|