gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

kasan: poor performance due to stack trace collection instrumentation #288

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here is the hottest function in profile:

    10.52%  foo  [kernel.kallsyms]    [k] __kasan_read8                     
            |
            --- __kasan_read8
               |          
               |--19.75%-- print_context_stack
               |          dump_trace
               |          save_stack_trace
               |          asan_compress_and_save_stack_trace
               |          |          
               |          |--52.16%-- asan_slab_free
               |          |          |          
               |          |          |--54.60%-- kfree
               |           --47.84%-- asan_slab_alloc
               |                     |          
               |                     |--51.28%-- kmem_cache_alloc

Almost all calls come from asan_compress_and_save_stack_trace <- kmalloc/kfree.
Stack collection must not be instrumented by kasan.

Original issue reported on code.google.com by dvyu...@google.com on 4 Apr 2014 at 7:45

GoogleCodeExporter commented 9 years ago

Original comment by dvyu...@google.com on 4 Apr 2014 at 7:46

GoogleCodeExporter commented 9 years ago
https://github.com/google/kasan/commit/5c4e1ced562cc718aaab7d6e591baf03487900cb

Original comment by pre...@google.com on 1 Aug 2014 at 11:12