Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / perf / tests / python-use.c
blob5d2df65ada6a74e7435a8e79ea0f90f0b4314645
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Just test if we can load the python binding.
4 */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <linux/compiler.h>
9 #include "tests.h"
11 extern int verbose;
13 int test__python_use(struct test *test __maybe_unused, int subtest __maybe_unused)
15 char *cmd;
16 int ret;
18 if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
19 PYTHONPATH, PYTHON, verbose > 0 ? "" : "2> /dev/null") < 0)
20 return -1;
22 ret = system(cmd) ? -1 : 0;
23 free(cmd);
24 return ret;