[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAExMFzgmcQqnVSBj9+YVr2UAkUg8CHdpLjQJF6CuOaWdcMbqDQ@mail.gmail.com>
Date: Tue, 2 May 2023 22:27:32 -0400
From: Jinli Xiao <jinli.xiao@....edu>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Leo Yan <leo.yan@...aro.org>,
Suzuki Poulouse <suzuki.poulose@....com>,
James Clark <james.clark@....com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf python: Set error messages on call failure
Thanks for the prompt response!
On Tue, May 2, 2023 at 4:37 PM Ian Rogers <irogers@...gle.com> wrote:
>
> Nice! Would it be possible to test this? We could do a shell test
All my changes in this patch is just setting the error message that
can be interpreted by Python just before the bindings return.
I am not sure about shell test, but I can do something like
[root@...-lexis linux]# export PYTHONPATH=~jinli/linux/tools/perf/python/
[root@...-lexis linux]# python3
Python 3.11.2 (main, Feb 8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red
Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import perf
>>> thread_map = perf.thread_map(9999) # a non-existent pid in /proc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory
whereas the original output is
>>> thread_map = perf.thread_map(9999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: <class 'perf.thread_map'> returned NULL without setting
an exception
Upon testing I did find some of the changes unnecessary. I will submit
a new patch to this.
This is my first time contributing so please let me know if I did
anything wrong :)
Best wishes,
Jinli
Powered by blists - more mailing lists