diff options
author | Jakob Unterwurzacher | 2020-10-16 19:59:36 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-10-16 20:04:22 +0200 |
commit | 83a324a46bec3332c078abc3a1986969c0f94fd2 (patch) | |
tree | d7097f73d1aff932e4e08e31c7c9ac702448d083 /internal/syscallcompat | |
parent | d656574d0800d152c70292cbd540593e68189a93 (diff) |
syscallcompat: add Lgetxattr benchmark
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") + } +} |