Add profile option to net scripts (#25624)

* add image option to cloud CreateInstaces

* add script to install perf

* add profile option to gce.sh

* add profile option for net.sh start

* Revert "add image option to cloud CreateInstaces"

This reverts commit fd63991861e632ae87e79281bca63a0f8173e201.

* remove imageName from gce.sh

* fix for gce.sh

* add comments on permissions setup

* remove profile option for gce.sh

* remove short arg
This commit is contained in:
kirill lykov 2022-06-21 18:28:15 +01:00 committed by GitHub
parent 4031a37521
commit cd01c1a4ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 1 deletions

View File

@ -807,6 +807,7 @@ $(
install-libssl-compatability.sh \
install-redis.sh \
install-rsync.sh \
install-perf.sh \
localtime.sh \
network-config.sh \
remove-docker-interface.sh \

View File

@ -193,9 +193,13 @@ build() {
buildVariant=--debug
fi
if $profileBuild; then
profilerFlags="RUSTFLAGS='-C force-frame-pointers=y -g ${RUSTFLAGS}'"
fi
$MAYBE_DOCKER bash -c "
set -ex
scripts/cargo-install-all.sh farf $buildVariant --validator-only
$profilerFlags scripts/cargo-install-all.sh farf $buildVariant --validator-only
"
)
@ -783,6 +787,7 @@ maybeAllowPrivateAddr=""
maybeAccountsDbSkipShrink=""
maybeSkipRequireTower=""
debugBuild=false
profileBuild=false
doBuild=true
gpuMode=auto
netemPartition=""
@ -869,6 +874,9 @@ while [[ -n $1 ]]; do
elif [[ $1 = --debug ]]; then
debugBuild=true
shift 1
elif [[ $1 = --profile ]]; then
profileBuild=true
shift 1
elif [[ $1 = --partition ]]; then
netemPartition=$2
shift 2

17
net/scripts/install-perf.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# perf setup
#
set -ex
[[ $(uname) = Linux ]] || exit 1
[[ $USER = root ]] || exit 1
# install perf
apt-get --assume-yes install linux-tools-common linux-tools-generic "linux-tools-$(uname -r)"
# setup permissions
# Impose no scope and access restrictions on using perf_events performance monitoring
echo -1 | tee /proc/sys/kernel/perf_event_paranoid
# Allow recording kernel reference relocation symbol to avoid skewing symbol resolution if relocation was used
echo 0 | tee /proc/sys/kernel/kptr_restrict