gdb-intro-kwlug/examples/stap-probe/1.c

42 lines
455 B
C

#include <sys/sdt.h>
struct baz
{
int a;
char b;
union
{
int c;
char d;
} u;
};
static void
foo (int a, const char *b)
{
STAP_PROBE2 (test, probefoo, a, b);
}
static void
bar (const struct baz *a)
{
STAP_PROBE1 (test, probebar, a);
}
int
main (int argc, char *argv[])
{
int i1 = 1;
const char *s = "String test";
struct baz b;
b.a = 49;
b.b = 'y';
b.u.d = 'a';
foo (i1, s);
bar (&b);
return 0;
}