summaryrefslogtreecommitdiff
path: root/qa/src/tabort.c
blob: a99b5e1fac852a03c420edddc9e7338af02a627a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <pcp/trace.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{
    int	sts;

    if ((sts = pmtracebegin("foo")) < 0) {
	fprintf(stderr, "pmtracebegin failed: %s\n", pmtraceerrstr(sts));
	exit(1);
    }

    if ((sts = pmtraceabort("foo")) < 0) {
	fprintf(stderr, "pmtraceabort failed: %s\n", pmtraceerrstr(sts));
	exit(1);
    }

    if ((sts = pmtracebegin("foo")) < 0) {
	fprintf(stderr, "pmtraceabort isn't working properly!\n");
	exit(1);
    }

    if ((sts = pmtraceend("foo")) < 0) {
	fprintf(stderr, "pmtraceend failed: %s\n", pmtraceerrstr(sts));
	exit(1);
    }

    exit(0);
}