Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CC = gcc
CFLAGS = -g -Wall -O0

all: function-test sdt-no-probe sdt-probe

function-test: function-test.o
$(CC) $(CFLAGS) -o function-test function-test.c

sdt-no-probe: sdt-no-probe.o
$(CC) $(CFLAGS) -o sdt-no-probe sdt-no-probe.c

sdt-probe: sdt-probe.o
$(CC) $(CFLAGS) -o sdt-probe sdt-probe.c

clean:
rm function-test sdt-no-probe sdt-probe *.o

11 changes: 11 additions & 0 deletions tests/function-test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
int return_val;

int test_function() {
return 1;
}

int main() {
return_val = test_function();

return 0;
}
6 changes: 6 additions & 0 deletions tests/sdt-no-probe.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
int main () {
int bidon;
bidon = 1;
bidon++;
return 0;
}
18 changes: 18 additions & 0 deletions tests/sdt-probe.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <sys/sdt.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
char* str = malloc(18);

puts("boop\n");
getchar();

STAP_PROBE(hello_provider, tracepoint_nargs_0);
STAP_PROBE1(hello_provider, tracepoint_nargs_1, 12);
STAP_PROBE2(hello_provider, tracepoint_nargs_2, "string", str);

return 0;
}

Loading