Arnaldo Carvalho de Melo
66dfc517e8
perf python: Don't stop building if python setuptools isn't installed
...
The python3-setuptools package is needed to build the python binding, so
that one can use things like:
# ~acme/git/perf/tools/perf/python/twatch.py
cpu: 6, pid: 4573, tid: 2184618 { type: exit, pid: 4573, ppid: 4172, tid: 2184618, ptid: 4172, time: 12563190090107}
cpu: 24, pid: 4573, tid: 4573 { type: fork, pid: 4573, ppid: 4573, tid: 2190991, ptid: 4573, time: 12563415289331}
cpu: 29, pid: 4573, tid: 2190991 { type: comm, pid: 4573, tid: 2190991, comm: StreamT~ns #401 }
cpu: 29, pid: 4573, tid: 2190991 { type: comm, pid: 4573, tid: 2190991, comm: StreamT~ns #401 }
^CTraceback (most recent call last):
File "/var/home/acme/git/perf/tools/perf/python/twatch.py", line 61, in <module>
main()
File "/var/home/acme/git/perf/tools/perf/python/twatch.py", line 33, in main
evlist.poll(timeout = -1)
KeyboardInterrupt
#
That have 'import perf;'.
But distros don't always have that python3-setuptools (or equivalent)
installed, which was breaking the build. Just check if it is installed
and emit a warning that such binding isn't being built and continue the
build without it:
With it:
$ rpm -q python3-setuptools
python3-setuptools-59.6.0-3.fc36.noarch
$ rm -rf /tmp/build/perf; mkdir -p /tmp/build/perf
$ make O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/var/home/acme/git/perf/tools/perf'
<SNIP>
... libpython: [ on ]
<SNIP>
GEN /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so
<SNIP>
$ ls -la /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so
-rwxr-xr-x. 1 acme acme 1609112 Dec 17 11:39 /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so
$
Without it:
$ sudo rpm -e python3-setuptools
$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf
$ make O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/var/home/acme/git/perf/tools/perf'
<SNIP>
... libpython: [ on ]
<SNIP>
$ ls -la /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so
ls: cannot access '/tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so': No such file or directory
$
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/Y53XHw3rlsaaUgOs@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-12-19 12:26:58 -03:00
..
2022-12-14 11:16:12 -03:00
2022-12-05 09:29:06 -03:00
2022-09-08 12:17:45 -03:00
2022-12-14 15:28:18 -03:00
2022-11-23 10:30:00 -03:00
2022-11-04 11:41:48 -03:00
2022-12-14 11:16:12 -03:00
2022-04-01 16:19:35 -03:00
2022-12-14 11:24:31 -03:00
2022-12-16 09:53:53 -03:00
2022-12-14 15:28:19 -03:00
2022-10-27 16:37:26 -03:00
2022-12-16 09:53:53 -03:00
2022-11-16 12:17:15 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 11:16:12 -03:00
2022-05-13 11:00:38 -03:00
2022-01-15 17:41:25 -03:00
2022-07-18 16:35:34 -03:00
2022-12-05 09:29:06 -03:00
2022-11-03 09:35:44 -03:00
2022-12-14 11:16:12 -03:00
2022-10-27 16:37:26 -03:00
2021-08-02 10:06:51 -03:00
2022-11-03 09:36:09 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 11:16:12 -03:00
2022-11-24 10:03:03 -03:00
2022-12-14 11:24:31 -03:00
2022-10-31 11:06:41 -03:00
2022-10-27 16:37:26 -03:00
2022-12-14 15:28:18 -03:00
2022-12-14 11:16:12 -03:00
2022-12-05 09:29:06 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 15:28:19 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 15:28:18 -03:00
2022-12-14 15:28:19 -03:00
2022-12-14 11:16:12 -03:00
2022-07-26 16:01:24 -03:00
2022-10-25 17:40:48 -03:00
2022-07-26 16:01:24 -03:00
2021-11-13 18:11:50 -03:00
2022-12-14 15:28:19 -03:00
2022-12-19 12:26:58 -03:00
2022-12-14 11:24:32 -03:00
2022-12-14 11:16:12 -03:00
2022-12-14 11:16:12 -03:00