syscallcompat: add Lgetxattr benchmark

This commit is contained in:
Jakob Unterwurzacher 2020-10-16 19:59:36 +02:00
parent d656574d08
commit 83a324a46b
1 changed files with 8 additions and 0 deletions

View File

@ -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")
}
}