aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-10-16 19:59:36 +0200
committerJakob Unterwurzacher2020-10-16 20:04:22 +0200
commit83a324a46bec3332c078abc3a1986969c0f94fd2 (patch)
treed7097f73d1aff932e4e08e31c7c9ac702448d083 /internal
parentd656574d0800d152c70292cbd540593e68189a93 (diff)
syscallcompat: add Lgetxattr benchmark
Diffstat (limited to 'internal')
-rw-r--r--internal/syscallcompat/sys_common_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_common_test.go b/internal/syscallcompat/sys_common_test.go
index bbb6dbc..f53b0d2 100644
--- a/internal/syscallcompat/sys_common_test.go
+++ b/internal/syscallcompat/sys_common_test.go
@@ -313,3 +313,11 @@ func TestFstatat(t *testing.T) {
t.Errorf("symlink size: expected=%d, got=%d", expectedSize, st.Size)
}
}
+
+// BenchmarkLgetxattr benchmarks Lgetxattr. Lgetxattr is very hot as the kernel
+// queries security.capabilities for every file access.
+func BenchmarkLgetxattr(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ Lgetxattr("/", "this.attr.does.not.exist")
+ }
+}