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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux