All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Ian Rogers <irogers@google.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Sumanth Korikkar <sumanthk@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>, Jiri Olsa <jolsa@kernel.org>,
	James Clark <james.clark@arm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 06/18] perf s390 s390_cpumcfdg_dump: Don't scan all PMUs
Date: Tue, 29 Aug 2023 10:20:43 -0300	[thread overview]
Message-ID: <ZO3wq4qnkCCePtd2@kernel.org> (raw)
In-Reply-To: <c32809b4-353b-fecb-a7bf-b7bda1604574@linux.alibaba.com>

Em Tue, Aug 29, 2023 at 05:20:09PM +0800, Jing Zhang escreveu:
> 在 2023/8/29 上午8:59, Ian Rogers 写道:
> > On Mon, Aug 28, 2023 at 10:53 AM Arnaldo Carvalho de Melo
> > I can't explain this, how come the line numbers don't agree with?
> > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/pmu.c?h=tmp.perf-tools-next#n449
> > 
> > The values are coming from the json event data. I'd need to see the
> > generated pmu-events.c.

Its at:

http://vger.kernel.org/~acme/perf/pmu-events.c.txt
 
> I pulled the lastest tmp.perf-tools-next, and build with JEVENT_ARCH=all on ARM(KunPeng) system. The test 10 also fails.

acme@roc-rk3399-pc:~/git/perf-tools-next$ git log --oneline -10
3d63ae82aa12 (HEAD -> perf-tools-next, quaco/perf-tools-next, perf-tools-next/tmp.perf-tools-next, five/perf-tools-next) perf jevents: Use "default_core" for events with no Unit
686cca7e97eb perf test stat_bpf_counters_cgrp: Enhance perf stat cgroup BPF counter test
a77abc103942 perf test shell stat_bpf_counters: Fix test on Intel
db02f820603e perf test shell record_bpf_filter: Skip 6.2 kernel
c96b84e89f8a libperf: Get rid of attr.id field
ee6906d247f1 perf tools: Convert to perf_record_header_attr_id()
fd36ca012e0c libperf: Add perf_record_header_attr_id()
bb7eb7458e52 perf tools: Handle old data in PERF_RECORD_ATTR
982d23d6e5e6 perf pmus: Skip duplicate PMUs and don't print list suffix by default
a700b0367364 perf pmus: Sort pmus by name then suffix
acme@roc-rk3399-pc:~/git/perf-tools-next$

Trying to do everything from scratch, to maybe avoid some leftover file
from a previous build:

acme@roc-rk3399-pc:~/git/perf-tools-next$ for a in tools/* ; do make -C $a clean; done
acme@roc-rk3399-pc:~/git/perf-tools-next$ rm -rf /tmp/build/$(basename $(pwd)) ; mkdir -p /tmp/build/$(basename $(pwd)) ;
acme@roc-rk3399-pc:~/git/perf-tools-next$ alias m='make -k DEBUG=1 BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools-next -C tools/perf install-bin && git status && perf test python'

Then run the 'm' alias to build it, then:

root@roc-rk3399-pc:~# perf test -v 10 |& tail -40
Matched metric-id cpa_cycles to cpa_cycles
Matched metric-id cpa_p1_wr_dat to cpa_p1_wr_dat
Matched metric-id cpa_p1_rd_dat_64b to cpa_p1_rd_dat_64b
Matched metric-id cpa_p1_rd_dat_32b to cpa_p1_rd_dat_32b
Result nan
test child finished with 0
---- end ----
PMU events subtest 3: Ok
 10.4: Parsing of PMU event table metrics with fake PMUs             :
--- start ---
test child forked, pid 12897
parsing '': '(unc_p_power_state_occupancy.cores_c0 / unc_p_clockticks) * 100.'
Using CPUID 0x00000000410fd082
perf: Segmentation fault
Obtained 16 stack frames.
perf(dump_stack+0x27) [0xaaaade0f19af]
perf(sighandler_dump_stack+0x33) [0xaaaade0f1a7f]
linux-vdso.so.1(+0x7a7) [0xffffa16967a7]
/lib/aarch64-linux-gnu/libc.so.6(__strcasecmp+0x2c) [0xffffa0841dac]
perf(+0x2233db) [0xaaaade1233db]
perf(+0x22364f) [0xaaaade12364f]
perf(+0x343143) [0xaaaade243143]
perf(pmu_events_table__find_event+0xa3) [0xaaaade24335f]
perf(+0x223a4b) [0xaaaade123a4b]
perf(+0x223f6b) [0xaaaade123f6b]
perf(+0x2232bb) [0xaaaade1232bb]
perf(perf_pmu__have_event+0x33) [0xaaaade1268f3]
perf(parse_events_multi_pmu_add+0x127) [0xaaaade0b7077]
perf(parse_events_parse+0xf3f) [0xaaaade120917]
perf(+0x1b7e6f) [0xaaaade0b7e6f]
perf(__parse_events+0xa3) [0xaaaade0b88c7]
test child interrupted
---- end ----
PMU events subtest 4: FAILED!
 10.5: Parsing of metric thresholds with fake PMUs                   :
--- start ---
test child forked, pid 12899
test child finished with 0
---- end ----
PMU events subtest 5: Ok
root@roc-rk3399-pc:~#

Doing it in gdb it doesn't crash, then I try with -F in gdb and it also
doesn't crash:

(gdb) run test -F 10
Starting program: /root/bin/perf test -F 10
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
 10: PMU events                                                      :
 10.1: PMU event table sanity                                        : Ok
 10.2: PMU event map aliases                                         : Ok
 10.3: Parsing of PMU event table metrics                            :failed: recursion detected for M1
failed: recursion detected for M2
failed: recursion detected for M3
 Ok
 10.4: Parsing of PMU event table metrics with fake PMUs             : Ok
 10.5: Parsing of metric thresholds with fake PMUs                   : Ok
[Inferior 1 (process 12925) exited normally]
(gdb)

root@roc-rk3399-pc:~# perf test -F 10
 10: PMU events                                                      :
 10.1: PMU event table sanity                                        : Ok
 10.2: PMU event map aliases                                         : Ok
 10.3: Parsing of PMU event table metrics                            :failed: recursion detected for M1
failed: recursion detected for M2
failed: recursion detected for M3
 Ok
 10.4: Parsing of PMU event table metrics with fake PMUs             : Ok
 10.5: Parsing of metric thresholds with fake PMUs                   : Ok
root@roc-rk3399-pc:~#

root@roc-rk3399-pc:~# perf test -v -F 10 |& grep ": Ok"
PMU events subtest 1: Ok
PMU events subtest 2: Ok
PMU events subtest 3: Ok
PMU events subtest 4: Ok
PMU events subtest 5: Ok
root@roc-rk3399-pc:~#

Will continue investigating later...

- Arnaldo
 
> The bad commit maybe is "edb217f perf pmu: Parse sysfs events directly from a file". Hope it helps.
> 
> #git log --oneline -1
> 3d63ae8 perf jevents: Use "default_core" for events with no Unit
> 
> #./perf test 10
>  10: PMU events                                                      :
>  10.1: PMU event table sanity                                        : Ok
>  10.2: PMU event map aliases                                         : Ok
>  10.3: Parsing of PMU event table metrics                            : FAILED!
>  10.4: Parsing of PMU event table metrics with fake PMUs             : FAILED!
>  10.5: Parsing of metric thresholds with fake PMUs                   : FAILED!

 
> Found metric 'tsx_aborted_cycles'
> metric expr (max(cycles\-t - cycles\-ct, 0) / cycles if has_event(cycles\-t) else 0) for tsx_aborted_cycles
> parsing metric: (max(cycles\-t - cycles\-ct, 0) / cycles if has_event(cycles\-t) else 0)
> perf: Segmentation fault
> Obtained 16 stack frames.
> ./perf() [0x514a23]
> linux-vdso.so.1(+0x7c3) [0xffff8ac847c3]
> ./perf() [0x52bb08]
> ./perf() [0x52ffc3]
> ./perf() [0x4e8cab]
> ./perf() [0x4ea27b]
> ./perf() [0x532137]
> ./perf() [0x53273b]
> ./perf() [0x533ed7]
> ./perf() [0x4ed58b]
> ./perf() [0x530763]
> ./perf() [0x4e8c47]
> ./perf() [0x4ea5e3]
> ./perf() [0x4eaa8f]
> ./perf() [0x595393]
> ./perf() [0x593753]
> test child interrupted
> ---- end ----
> PMU events subtest 3: FAILED!
>  10.4: Parsing of PMU event table metrics with fake PMUs             :
> --- start ---
> test child forked, pid 24107
> parsing '': '(unc_p_power_state_occupancy.cores_c0 / unc_p_clockticks) * 100.'
> parsing metric: (unc_p_power_state_occupancy.cores_c0 / unc_p_clockticks) * 100.
> Using CPUID 0x00000000481fd010
> perf: Segmentation fault
> Obtained 16 stack frames.
> ./perf() [0x514a23]
> linux-vdso.so.1(+0x7c3) [0xffff8ac847c3]
> ./perf() [0x52bb08]
> ./perf() [0x52ffc3]
> ./perf() [0x4e8cab]
> ./perf() [0x4ea27b]
> ./perf() [0x532137]
> ./perf() [0x53273b]
> ./perf() [0x533ed7]
> ./perf() [0x4ed58b]
> ./perf() [0x530763]
> ./perf() [0x4e8c47]
> ./perf() [0x4ea5e3]
> ./perf() [0x4a50b3]
> ./perf() [0x4a5343]
> ./perf() [0x48fef7]
> test child interrupted
> ---- end ----
> PMU events subtest 4: FAILED!
>  10.5: Parsing of metric thresholds with fake PMUs                   :
> --- start ---
> test child forked, pid 24108
> parsing 'tma_alloc_restriction': 'tma_alloc_restriction > 0.1'
> parsing metric: tma_alloc_restriction > 0.1
> Using CPUID 0x00000000481fd010
> perf: Segmentation fault
> Obtained 16 stack frames.
> ./perf() [0x514a23]
> linux-vdso.so.1(+0x7c3) [0xffff8ac847c3]
> ./perf() [0x52bb08]
> ./perf() [0x52ffc3]
> ./perf() [0x4e8cab]
> ./perf() [0x4ea27b]
> ./perf() [0x532137]
> ./perf() [0x53273b]
> ./perf() [0x533ed7]
> ./perf() [0x4ed58b]
> ./perf() [0x530763]
> ./perf() [0x4e8c47]
> ./perf() [0x4ea5e3]
> ./perf() [0x4a50b3]
> ./perf() [0x5dec0b]
> ./perf() [0x5df117]
> test child interrupted
> ---- end ----
> PMU events subtest 5: FAILED!

-- 

- Arnaldo

  reply	other threads:[~2023-08-29 13:21 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  4:13 [PATCH v2 00/18] Lazily load PMU data Ian Rogers
2023-08-24  4:13 ` [PATCH v2 01/18] perf pmu: Make the loading of formats lazy Ian Rogers
2023-08-24  4:13 ` [PATCH v2 02/18] perf pmu: Abstract alias/event struct Ian Rogers
2023-08-24  4:13 ` [PATCH v2 03/18] perf pmu-events: Add extra underscore to function names Ian Rogers
2023-08-24  4:13 ` [PATCH v2 04/18] perf jevents: Group events by PMU Ian Rogers
2023-08-29 15:28   ` James Clark
2023-08-29 15:34     ` Ian Rogers
2023-08-24  4:13 ` [PATCH v2 05/18] perf parse-events: Improve error message for double setting Ian Rogers
2023-08-24  4:13 ` [PATCH v2 06/18] perf s390 s390_cpumcfdg_dump: Don't scan all PMUs Ian Rogers
2023-08-24 13:59   ` Arnaldo Carvalho de Melo
2023-08-24 17:31     ` Ian Rogers
2023-08-25  8:19     ` Thomas Richter
2023-08-25 13:14       ` Ian Rogers
2023-08-25 14:39         ` Thomas Richter
2023-08-25 20:56           ` Arnaldo Carvalho de Melo
2023-08-25 22:56             ` Ian Rogers
2023-08-26  1:38               ` Arnaldo Carvalho de Melo
2023-08-26  6:28                 ` Ian Rogers
2023-08-28 17:44               ` Arnaldo Carvalho de Melo
2023-08-28 17:53                 ` Arnaldo Carvalho de Melo
2023-08-28 21:39                   ` Arnaldo Carvalho de Melo
2023-08-29  0:59                   ` Ian Rogers
2023-08-29  9:20                     ` Jing Zhang
2023-08-29 13:20                       ` Arnaldo Carvalho de Melo [this message]
2023-08-29 11:28                     ` Arnaldo Carvalho de Melo
2023-08-24  4:13 ` [PATCH v2 07/18] perf pmu-events: Reduce processed events by passing PMU Ian Rogers
2023-08-24  4:13 ` [PATCH v2 08/18] perf pmu-events: Add pmu_events_table__find_event Ian Rogers
2023-08-24  4:13 ` [PATCH v2 09/18] perf pmu: Parse sysfs events directly from a file Ian Rogers
2023-08-24  4:13 ` [PATCH v2 10/18] perf pmu: Prefer passing pmu to aliases list Ian Rogers
2023-08-24  4:13 ` [PATCH v2 11/18] perf pmu: Merge json events with sysfs at load time Ian Rogers
2023-08-24  4:13 ` [PATCH v2 12/18] perf pmu: Cache json events table Ian Rogers
2023-08-24  4:13 ` [PATCH v2 13/18] perf pmu: Lazily add json events Ian Rogers
2023-08-24  4:13 ` [PATCH v2 14/18] perf pmu: Scan type early to fail an invalid PMU quickly Ian Rogers
2023-08-24  4:13 ` [PATCH v2 15/18] perf pmu: Be lazy about loading event info files from sysfs Ian Rogers
2023-08-24  4:13 ` [PATCH v2 16/18] perf pmu: Lazily load sysfs aliases Ian Rogers
2023-08-24  4:13 ` [PATCH v2 17/18] perf jevents: Sort strings in the big C string to reduce faults Ian Rogers
2023-08-24  4:13 ` [PATCH v2 18/18] perf jevents: Don't append Unit to desc Ian Rogers
2023-08-24 14:52 ` [PATCH v2 00/18] Lazily load PMU data Arnaldo Carvalho de Melo
2023-08-24 18:01   ` Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZO3wq4qnkCCePtd2@kernel.org \
    --to=acme@kernel.org \
    --cc=hca@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=renyu.zj@linux.alibaba.com \
    --cc=sumanthk@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tmricht@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.