kallsyms: make SpKallsyms more testable

This allows us to pass in the file to read from, and adds a quick test
case to view the parsed output. It also fixes a base-10 vs base-16
mistake in parsing addresses.
This commit is contained in:
Christian Hergert
2018-01-29 01:25:14 -08:00
parent af4eac025a
commit 911d51d447
6 changed files with 55 additions and 10 deletions

View File

@ -76,7 +76,7 @@ sysprofd_get_kernel_symbols (sd_bus_message *msg,
else if (r == 0)
return -EACCES;
if (!(kallsyms = sp_kallsyms_new ()))
if (!(kallsyms = sp_kallsyms_new (NULL)))
{
sd_bus_error_set (error,
SD_BUS_ERROR_FILE_NOT_FOUND,