mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
As we gain in usage, we need to be more careful about using a prefix that will not collide with other symbols. So version 3 of our ABI will change to using Sysprof/SYSPROF/sysprof as the various prefixes. The soname/api version bump will happen later on this branch so that things are easier to test up until then.
33 lines
611 B
C
33 lines
611 B
C
#include <glib.h>
|
|
#include <stdlib.h>
|
|
#include <sysprof.h>
|
|
|
|
int
|
|
main (gint argc,
|
|
gchar *argv[])
|
|
{
|
|
g_autoptr(SysprofKallsyms) kallsyms = NULL;
|
|
const gchar *name;
|
|
SysprofAddress addr = 0;
|
|
guint8 type;
|
|
|
|
if (argc < 2)
|
|
{
|
|
g_printerr ("usage: %s FILE\n", argv[0]);
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
kallsyms = sysprof_kallsyms_new (argv[1]);
|
|
|
|
while (sysprof_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;
|
|
}
|