Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  • Zhen Lei's avatar
    kallsyms: Add self-test facility · 30f3bb09
    Zhen Lei authored
    Added test cases for basic functions and performance of functions
    kallsyms_lookup_name(), kallsyms_on_each_symbol() and
    kallsyms_on_each_match_symbol(). It also calculates the compression rate
    of the kallsyms compression algorithm for the current symbol set.
    
    The basic functions test begins by testing a set of symbols whose address
    values are known. Then, traverse all symbol addresses and find the
    corresponding symbol name based on the address. It's impossible to
    determine whether these addresses are correct, but we can use the above
    three functions along with the addresses to test each other. Due to the
    traversal operation of kallsyms_on_each_symbol() is too slow, only 60
    symbols can be tested in one second, so let it test on average once
    every 128 symbols. The other two functions validate all symbols.
    
    If the basic functions test is passed, print only performance test
    results. If the test fails, print error information, but do not perform
    subsequent performance tests.
    
    S...
    30f3bb09