mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
The first step to optimizing something is to measure it. This creates a `secbench` library which can benchmark the time it takes to run an application "Profile", which is a weighted-random set of syscall sequences, under a given `seccomp-bpf` filter. The `secbench` library runs two subprocesses which run the same set of system calls using this application profile. One of the subprocesses runs with the seccomp-bpf filter, and the other one runs without it. The library computes the difference, and reports this duration as the time it takes to run the seccomp-bpf filter for that system call. It also reports the overall time it takes to run the weighted-random set of system calls, useful as a general measure of the overhead that the application will see. PiperOrigin-RevId: 567704927
19 lines
456 B
Python
19 lines
456 B
Python
"""Defines secbench_test, a wrapper over go_test for secbench benchmarks."""
|
|
|
|
load("//tools:defs.bzl", "go_test")
|
|
|
|
def secbench_test(**kwargs):
|
|
"""Wrapper over go_test useful for secbench benchmarks.
|
|
|
|
Args:
|
|
**kwargs: Same as go_test arguments.
|
|
"""
|
|
kwargs["tags"] = kwargs.get("tags", []) + [
|
|
"local",
|
|
"manual",
|
|
"secbench",
|
|
]
|
|
kwargs["static"] = True
|
|
kwargs["timeout"] = "long"
|
|
go_test(**kwargs)
|