/
githubmirror
/
strace
Обзор
Документация
Войти
/
githubmirror
/
strace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/filter_seccomp-perf.test
27 строк
861 B
Dmitry V. Levin
Update copyright headers
01 дек 2021, 11:00
01 дек 2021, 11:00
fd92d52
Код
Авторство
О чём код?
#!/bin/sh # # Check seccomp filter performance. # # Copyright (c) 2019 Paul Chaignon <paul.chaignon@gmail.com> # Copyright (c) 2018-2021 The strace developers. # All rights reserved. # # SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" . "${srcdir=.}/filter_seccomp.sh" args="-f -qq -e signal=none -e trace=fchdir ../$NAME" num_regular="$(run_strace $args)" mv "$LOG" "$LOG.regular" num_seccomp="$(run_strace --seccomp-bpf $args)" mv "$LOG" "$LOG.seccomp" match_diff "$LOG.regular" "$LOG.seccomp" min_ratio=5 # With seccomp filter enabled, we should be able to complete # at least $min_ratio times more chdir system calls. ratio="$((num_seccomp / num_regular))" if [ "$ratio" -lt "$min_ratio" ]; then fail_ "Only $ratio times more syscalls performed with seccomp filter enabled, expected at least $min_ratio times speedup" fi