Re: [PATCH 2/6] tools/perf/json: Add cache metrics for s390 z16

From: Arnaldo Carvalho de Melo
Date: Thu Mar 23 2023 - 08:59:38 EST


Em Thu, Mar 23, 2023 at 11:06:15AM +0100, Heiko Carstens escreveu:
> On Thu, Mar 23, 2023 at 10:51:16AM +0100, Thomas Richter wrote:
> > On 3/22/23 21:59, Arnaldo Carvalho de Melo wrote:
> > > While trying to cross build to s390 on:
> > >
> > > ubuntu:18.04
> > >
> > > using python3
> > >
> > >
> > > CC /tmp/build/perf/tests/parse-events.o
> > > Exception processing pmu-events/arch/s390/cf_z16/extended.json
> > > Traceback (most recent call last):
> > > File "pmu-events/jevents.py", line 997, in <module>
> > > main()
> > > File "pmu-events/jevents.py", line 979, in main
> > > ftw(arch_path, [], preprocess_one_file)
> > > File "pmu-events/jevents.py", line 935, in ftw
> > > ftw(item.path, parents + [item.name], action)
> > > File "pmu-events/jevents.py", line 933, in ftw
> > > action(parents, item)
> > > File "pmu-events/jevents.py", line 514, in preprocess_one_file
> > > for event in read_json_events(item.path, topic):
> > > File "pmu-events/jevents.py", line 388, in read_json_events
> > > events = json.load(open(path), object_hook=JsonEvent)
> > > File "/usr/lib/python3.6/json/__init__.py", line 296, in load
> > > return loads(fp.read(),
> > > File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
> > > return codecs.ascii_decode(input, self.errors)[0]
> > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4271: ordinal not in range(128)
> > >
> > >
> >
> > Hmmm, this is very strange. After reading this mail I installed Ubuntu 18.04
> > on my s390 system. The build works fine, no errors at all.
> >
> >
> > # pmu-events/jevents.py s390 all pmu-events/arch pmu-events/pmu-events.c
> > # ll pmu-events/pmu-events.c
> > -rw-r--r-- 1 root root 317284 Mar 23 10:46 pmu-events/pmu-events.c
> > #
> >
> > The file has the correct contents and the build works fine too.
> > # make
>
> The file contains UTF-8 characters, which were already present before
> your patch. Guess you need to provide an addon patch which converts to
> plain ASCII.

Yeah, and in this s390 perf test build container in the past I didn't
have the needed python3-dev package needed to build jevents.py, so it
was being disabled and the problem was left unnoticed.

Now that it is a opt-out feature, I installed python3-dev, jevents.py
got built and then this failure surfaced.

- Arnaldo