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

Commit 7d67ad34 authored by Rob Barnes's avatar Rob Barnes Committed by android-build-merger
Browse files

Merge "Added standalone benchmark for keymaster."

am: 3f7f55b3

Change-Id: Ia66365ee626662395a4ef36274d5acbc7e29a4ad
parents 0d792129 3f7f55b3
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

cc_benchmark {
    name: "keymaster_benchmark",
    defaults: ["VtsHalTargetTestDefaults"],
    srcs: [
        "Benchmark.cpp",
    ],
    static_libs: [
        "android.hardware.keymaster@4.0",
        "libkeymaster4support",
        "libsoftkeymasterdevice",
        "libchrome"
    ],
}
+717 −0

File added.

Preview size limit exceeded, changes collapsed.

+19 −0
Original line number Diff line number Diff line
# Keymaster Benchmark

The Keymaster Benchmark is a standalone tool for measuring the performance of keymaster implementations.

## Building

Build:
`m  keymaster_benchmark`

Transfer to device/emulator:
`adb sync data`

The benchmark executable should will be located at `data/benchmarktest/keymaster_benchmark/keymaster_benchmark` on the device.

## Usage

Keymaster Benchmark is built on [Google microbenchmark library](https://github.com/google/benchmark).
All of the commandline arguments provided by the microbenchmark library are valid, such as `--benchmark_filter=<regex>` or `benchmark_out_format={json|console|csv}`.
In addition to the command line arguments provided by microbenchmark, `--service_name=<service_name>` is provided allow specification of the keymaster service name, e.g. specify `--service_name=strongbox` to benchmark strongbox.