diff options
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r-- | internal/syscallcompat/sys_common_test.go | 8 |
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") + } +} |