mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 15:10:53 +00:00
tree: start on massive tree refactor
The big thing going on here is that we are going to split up the libraries a bit better, and remove GObject from the capture library. The libsysprof library will bring in the capture library statically, so we can export the symbols we want. Eventually, we will bump the version to sysprof-3, but not yet.
This commit is contained in:
34
src/tests/test-kallsyms.c
Normal file
34
src/tests/test-kallsyms.c
Normal file
@ -0,0 +1,34 @@
|
||||
#include "../shared/sp-address.h"
|
||||
#include "../shared/sp-kallsyms.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main (gint argc,
|
||||
gchar *argv[])
|
||||
{
|
||||
g_autoptr(SpKallsyms) kallsyms = NULL;
|
||||
const gchar *name;
|
||||
SpAddress addr = 0;
|
||||
guint8 type;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
g_printerr ("usage: %s FILE\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
kallsyms = sp_kallsyms_new (argv[1]);
|
||||
|
||||
while (sp_kallsyms_next (kallsyms, &name, &addr, &type))
|
||||
{
|
||||
g_assert (name != NULL);
|
||||
g_assert (addr != 0);
|
||||
g_assert (type != 0);
|
||||
|
||||
g_print ("%s %"G_GUINT64_FORMAT"x\n", name, addr);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user