]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - tools/perf/tests/python-use.c
Merge tag 'iommu-fix-v4.11-rc0-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / tools / perf / tests / python-use.c
CommitLineData
54359d33
ACM
1/*
2 * Just test if we can load the python binding.
3 */
4
5#include <stdio.h>
6#include <stdlib.h>
721a1f53 7#include <linux/compiler.h>
54359d33
ACM
8#include "tests.h"
9
10extern int verbose;
11
721a1f53 12int test__python_use(int subtest __maybe_unused)
54359d33
ACM
13{
14 char *cmd;
15 int ret;
16
000ae33f 17 if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
bb963e16 18 PYTHONPATH, PYTHON, verbose > 0 ? "" : "2> /dev/null") < 0)
54359d33
ACM
19 return -1;
20
21 ret = system(cmd) ? -1 : 0;
22 free(cmd);
23 return ret;
24}