Skip to contentSkip to conversation

selftests/seccomp: Add simple seccomp overhead benchmark

PATCH New Kees Cook 1 participant 1 message Aug 14, 2017

Subsystems (3)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 selftests/seccomp: Add simple seccomp overhead benchmark

This attempts to produce a comparison between native getpid() and a RET_ALLOW-filtered getpid(), to measure the overhead cost of using seccomp().

---
As with the other, I'd like this to go via the seccomp tree. Getting an Ack would be great. :) Thanks!

---
 tools/testing/selftests/seccomp/Makefile           | 18 ++--
 .../testing/selftests/seccomp/seccomp_benchmark.c  | 99 ++++++++++++++++++++++
 2 files changed, 112 insertions(+), 5 deletions(-)
 create mode 100644 tools/testing/selftests/seccomp/seccomp_benchmark.c
tools/testing/selftests/seccomp/Makefile +13 -5
index aeb0c805f3ca..553d870b4ca9 100644
@@ -1,8 +1,16 @@
-TEST_GEN_PROGS := seccomp_bpf
-CFLAGS += -Wl,-no-as-needed -Wall
-LDFLAGS += -lpthread
+all:
 
 include ../lib.mk
 
-$(TEST_GEN_PROGS): seccomp_bpf.c ../kselftest_harness.h
-	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+.PHONY: all clean
+
+BINARIES := seccomp_bpf seccomp_benchmark
+CFLAGS += -Wl,-no-as-needed -Wall
+
+seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
+	$(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@
+
+TEST_PROGS += $(BINARIES)
+EXTRA_CLEAN := $(BINARIES)
+
+all: $(BINARIES)
tools/testing/selftests/seccomp/seccomp_benchmark.c new file +99 -0

99 lines not on this page · raw message

Signature · 10 lines
2.7.4


-- 
Kees Cook
Pixel Security
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html