2015-07-23 23:42:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-02-11 19:48:58 +00:00
|
|
|
# Copyright (c) 2014-present, Facebook, Inc.
|
2015-07-23 23:42:46 +00:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
source $SCRIPT_DIR/lib.sh
|
|
|
|
|
2016-01-12 03:32:33 +00:00
|
|
|
# Run the build function without the tests
|
|
|
|
build false
|
2015-07-23 23:42:46 +00:00
|
|
|
|
2016-01-12 03:32:33 +00:00
|
|
|
# NODE_LABELS is defined in the Jenkins environment, and provides a wasy for
|
2015-07-23 23:42:46 +00:00
|
|
|
# us to detect what type of box we are running on. (ie. osx10, centos6).
|
|
|
|
OUTDIR="$SCRIPT_DIR/../build/benchmarks"
|
|
|
|
NODE=$(echo $NODE_LABELS | awk '{print $NF}')
|
|
|
|
mkdir -p $OUTDIR
|
|
|
|
|
2015-07-29 23:50:19 +00:00
|
|
|
REPETITIONS=5
|
|
|
|
|
2016-01-12 03:32:33 +00:00
|
|
|
export BENCHMARK_TO_FILE="--benchmark_format=csv \
|
|
|
|
--benchmark_repetitions=$REPETITIONS :>$OUTDIR/$NODE-benchmark.csv"
|
2015-07-28 09:02:31 +00:00
|
|
|
make run-benchmark/fast
|
2015-07-23 23:42:46 +00:00
|
|
|
|
2016-01-12 03:32:33 +00:00
|
|
|
export BENCHMARK_TO_FILE="--benchmark_format=csv \
|
|
|
|
--benchmark_repetitions=$REPETITIONS :>$OUTDIR/$NODE-kernel-benchmark.csv"
|
2015-07-28 09:02:31 +00:00
|
|
|
make run-kernel-benchmark/fast
|
2015-07-23 23:42:46 +00:00
|
|
|
|
2015-07-29 22:10:20 +00:00
|
|
|
strip $(find $SCRIPT_DIR/../build -name "osqueryi" | xargs)
|
|
|
|
strip $(find $SCRIPT_DIR/../build -name "osqueryd" | xargs)
|
2016-01-12 03:32:33 +00:00
|
|
|
wc -c $(find $SCRIPT_DIR/../build -name "osqueryi" | xargs) \
|
|
|
|
| head -n 1 \
|
|
|
|
| awk '{print "\"EXECUTABLE_osqueryi_size\","$1",,,,,\""$2"\""}' \
|
|
|
|
>>$OUTDIR/$NODE-benchmark.csv
|
|
|
|
wc -c $(find $SCRIPT_DIR/../build -name "osqueryd" | xargs) \
|
|
|
|
| head -n 1 \
|
|
|
|
| awk '{print "\"EXECUTABLE_osqueryd_size\","$1",,,,,\""$2"\""}' \
|
|
|
|
>>$OUTDIR/$NODE-benchmark.csv
|
2015-07-23 23:42:46 +00:00
|
|
|
|
|
|
|
exit 0
|