diff options
Diffstat (limited to 'tools/perf/tests/attr.c')
-rw-r--r-- | tools/perf/tests/attr.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c index 28d1605b0338..0e77b2cf61ec 100644 --- a/tools/perf/tests/attr.c +++ b/tools/perf/tests/attr.c @@ -18,19 +18,23 @@ * permissions. All the event text files are stored there. */ +#include <debug.h> +#include <errno.h> +#include <inttypes.h> #include <stdlib.h> #include <stdio.h> #include <linux/types.h> #include <linux/kernel.h> +#include <sys/param.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> #include "../perf.h" -#include "util.h" #include <subcmd/exec-cmd.h> #include "tests.h" #define ENV "PERF_TEST_ATTR" -extern int verbose; - static char *dir; void test_attr__init(void) @@ -132,8 +136,10 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, { int errno_saved = errno; - if (store_event(attr, pid, cpu, fd, group_fd, flags)) - die("test attr FAILED"); + if (store_event(attr, pid, cpu, fd, group_fd, flags)) { + pr_err("test attr FAILED"); + exit(128); + } errno = errno_saved; } @@ -144,7 +150,7 @@ static int run_dir(const char *d, const char *perf) int vcnt = min(verbose, (int) sizeof(v) - 1); char cmd[3*PATH_MAX]; - if (verbose) + if (verbose > 0) vcnt++; snprintf(cmd, 3*PATH_MAX, PYTHON " %s/attr.py -d %s/attr/ -p %s %.*s", |