linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paran Lee <p4ranlee@gmail.com>
To: Atish Patra <atish.patra@wdc.com>
Cc: linux-perf-users@vger.kernel.org, Ian Rogers <irogers@google.com>,
	Namhyung Kim <namhyung@kernel.org>
Subject: How to check RISC-V CPU sscofpmf extension in runtime?
Date: Thu, 6 Apr 2023 23:39:50 +0900	[thread overview]
Message-ID: <ceef5f31-ac35-d4a0-8cb2-80787aad7e1d@gmail.com> (raw)

Hello, Atish.
I have tested perf on Starfive Visionfive2 board.

I want to know how to check sscofpmf extension support in user program
or tools.

user@starfive:~/CppTest$ ~/starfive-visionfive2-linux/tools/perf/perf
record -g ./main.o
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument)
for event (cycles:u).
/bin/dmesg | grep -i perf may provide additional information.

[    2.356857] riscv-pmu-sbi: SBI PMU extension is available
[    2.362841] riscv-pmu-sbi: 16 firmware and 4 hardware counters
[    2.369302] riscv-pmu-sbi: Perf sampling/filtering is not supported
as sscof extension is not available

user@starfive:$ grep PERF_EVENT /boot/config-5.15.0-dirty
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_EVENTS=y

So, I find "sscof extension is not available" position of the code

drivers/perf/riscv_pmu_sbi.c
pmu_sbi_device_probe()

	ret = pmu_sbi_setup_irqs(pmu, pdev);

I think adding the result value to the logs will give us a mor detail.
I want to patch :)

I did perf test.

~/starfive-visionfive2-linux/tools/perf/perf test
 1: vmlinux symtab matches kallsyms            : FAILED!
 2: Detect openat syscall event                : FAILED!
 3: Detect openat syscall event on all cpus    : FAILED!
 4: Read samples using the mmap interface      : FAILED!
 5: Test data source output                    : Ok
 6: Parse event definition strings             : FAILED!
 7: Simple expression parser                   : Ok
 8: PERF_RECORD_* events & perf_sample fields  : FAILED!
 9: Parse perf pmu format                      : Ok
10: PMU events                                 :
10.1: PMU event table sanity                           : FAILED!
10.2: PMU event map aliases                            : FAILED!
10.3: Parsing of PMU event table metrics               : Ok
10.4: Parsing of PMU event table metrics with fake PMUs: Ok
11: DSO data read                              : Ok
12: DSO data cache                             : Ok
13: DSO data reopen                            : Ok
14: Roundtrip evsel->name                      : Ok
15: Parse sched tracepoints fields             : FAILED!
16: syscalls:sys_enter_openat event fields     : FAILED!
17: Setup struct perf_event_attr               : Skip
18: Match and link multiple hists              : Ok
19: 'import perf' in python                    : FAILED!
20: Breakpoint overflow signal handler         : FAILED!
21: Breakpoint overflow sampling               : FAILED!
22: Breakpoint accounting                      : Skip
23: Watchpoint                                 :
23.1: Read Only Watchpoint                     : FAILED!
23.2: Write Only Watchpoint                    : FAILED!
23.3: Read / Write Watchpoint                  : FAILED!
23.4: Modify Watchpoint                        : FAILED!
24: Number of exit events of a simple workload : FAILED!
25: Software clock events period values        : Ok
26: Object code reading                        : FAILED!
27: Sample parsing                             : Ok
28: Use a dummy software event to keep tracking: Skip
29: Parse with no sample_id_all bit set        : Ok
30: Filter hist entries                        : Ok
31: Lookup mmap thread                         : Ok
32: Share thread maps                          : Ok
33: Sort output of hist entries                : Ok
34: Cumulate child hist entries                : Ok
35: Track with sched_switch                    : Ok
36: Filter fds with revents mask in a fdarray  : Ok
37: Add fd to a fdarray, making it autogrow    : Ok
38: kmod_path__parse                           : Ok
39: Thread map                                 : Ok
40: LLVM search and compile                    :
40.1: Basic BPF llvm compile                    : Skip
40.2: kbuild searching                          : Skip
40.3: Compile source for BPF prologue generation: Skip
40.4: Compile source for BPF relocation         : Skip
41: Session topology                           : FAILED!
42: BPF filter                                 :
42.1: Basic BPF filtering                      : Skip
42.2: BPF pinning                              : Skip
43: Synthesize thread map                      : Ok
44: Remove thread map                          : Ok
45: Synthesize cpu map                         : Ok
46: Synthesize stat config                     : Ok
47: Synthesize stat                            : Ok
48: Synthesize stat round                      : Ok
49: Synthesize attr update                     : Ok
50: Event times                                : Skip
51: Read backward ring buffer                  : Skip
52: Print cpu map                              : Ok
53: Merge cpu map                              : Ok
54: Probe SDT events                           : Ok
55: is_printable_array                         : Ok
56: Print bitmap                               : Ok
57: perf hooks                                 : Ok
58: builtin clang support                      : Skip (not compiled in)
59: unit_number__scnprintf                     : Ok
60: mem2node                                   : Ok
61: time utils                                 : Ok
62: Test jit_write_elf                         : Skip
63: Test libpfm4 support                       : Skip (not compiled in)
64: Test api io                                : Ok
65: maps__merge_in                             : Ok
66: Demangle Java                              : Ok
67: Demangle OCaml                             : Ok
68: Parse and process metrics                  : Ok
69: PE file support                            : Skip
70: Event expansion for cgroups                : Ok
72: dlfilter C API                             : Ok
failed to open shell test directory:
/home/user/libexec/perf-core/tests/shell


BR
Paran Lee

                 reply	other threads:[~2023-04-06 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ceef5f31-ac35-d4a0-8cb2-80787aad7e1d@gmail.com \
    --to=p4ranlee@gmail.com \
    --cc=atish.patra@wdc.com \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).