[RFC PATCH v1 2/4] selftests/landlock: Implement per-syscall microbenchmarks

Mikhail Ivanov ivanov.mikhail1 at huawei-partners.com
Wed Sep 4 12:56:29 UTC 2024


8/16/2024 3:59 AM, Mikhail Ivanov wrote:> diff --git 
a/tools/testing/selftests/landlock/bench/run.sh 
b/tools/testing/selftests/landlock/bench/run.sh
> index afbcbb2ba6aa..582313f689ad 100755
> --- a/tools/testing/selftests/landlock/bench/run.sh
> +++ b/tools/testing/selftests/landlock/bench/run.sh
> @@ -237,14 +242,48 @@ print_overhead()
>   	done < $BASE_TRACE_DUMP
>   }
>   
> +print_overhead_workload()
> +{
> +	print "\nTracing results\n"
> +	print "===============\n"
> +	print "cmd: "
> +	print "%s " $WORKLOAD
> +	print "\n"
> +	print "syscalls: %s\n" $TRACED_SYSCALLS
> +	print "access: %s\n" $ACCESS
> +
> +	print_overhead
> +}
> +
> +print_overhead_microbench()
> +{
> +	print "\nTracing results\n"
> +	print "===============\n"
> +	print "cmd: Microbenchmarks\n"
> +	print "syscalls: %s\n" $TRACED_SYSCALLS
> +
> +	print_overhead
> +}
> +
> +form_trace_cmd()
> +{
> +	trace_cmd=$TRACE_CMD
> +	trace_cmd+=" -e $1 -D $SANDBOX_DELAY -o $TMP_BUF"
> +	trace_cmd+=" $TASKSET -c $CPU_AFFINITY"
> +	trace_cmd+=" $NICE -n -19"
> +
> +	echo $trace_cmd
> +}
> +
>   run_traced_workload()
>   {
> +	trace_cmd=$(form_trace_cmd $TRACED_SYSCALLS)
> +
>   	if [ $1 == 0 ]; then
>   		output=$BASE_TRACE_DUMP
> -		sandbox_cmd=
>   	else
>   		output=$LL_TRACE_DUMP
> -		sandbox_cmd="$SANDBOXER_BIN $SANDBOXER_ARGS"
> +		trace_cmd+="$SANDBOXER_BIN $SANDBOXER_ARGS"

Missing space:
	trace_cmd+=" $SANDBOXER_BIN $SANDBOXER_ARGS"

>   	fi
>   
>   	echo '' > $output



More information about the Linux-security-module-archive mailing list