aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash
blob: 2ed1bbe14428da4710c5b1320ae39e361c12b600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# Run a lmbench cache latency benchmark in a host and
# outputs in json format the array sizes in megabytes and
# load latency over all points in that array in nanosecods

set -e

REPETITON=$1
WARMUP=$2

# write the result to stdout in json format
output_json()
{
    read DATA
    echo $DATA | awk '{printf "{\"L1cache\": %s}", $5}'
}

/usr/lib/lmbench/bin/x86_64-linux-gnu/cache -W $WARMUP -N $REPETITON  2>&1 | output_json