From: Alan Kao <alankao@andestech.com>
To: Nick Kossifidis <mick@ics.forth.gr>
Cc: linux-riscv@lists.infradead.org
Subject: Re: Perf-related compilation issues
Date: Thu, 24 Oct 2019 07:52:57 +0800 [thread overview]
Message-ID: <20191023235257.GA7587@andestech.com> (raw)
In-Reply-To: <1bba622b-1f59-d21b-f396-d9c1a021dc3a@ics.forth.gr>
Hi Nick,
Thanks for pointing out this.
On Wed, Oct 23, 2019 at 06:15:43PM +0300, Nick Kossifidis wrote:
> Hello all,
>
> a) Compiling the current fixes branch with a minimal config I get the
> following error:
>
> riscv64-unknown-linux-gnu-ld: arch/riscv/kernel/perf_callchain.o: in
> function `.L0 ':
> perf_callchain.c:(.text+0x16a): undefined reference to `walk_stackframe'
> make: *** [Makefile:1074: vmlinux] Error 1
>
>
> I've removed the static delcaration of walk_stackframe on stackframe.c
> and marked walk_stackframe as extern on perf_callchain.c to fix the
> above issue.
>
>
> b) Then If I compile the kernel without CONFIG_RISCV_BASE_PMU I get
>
>
> ./arch/riscv/include/asm/perf_event.h:26:2: error: #error "Please
> provide a valid RISCV_MAX_COUNTERS for the PMU."
> #error "Please provide a valid RISCV_MAX_COUNTERS for the PMU."
>
The check was meant to warn new PMU developers that they should provide
this parameter for their PMU.
>
> I noticed that the only place where CONFIG_RISCV_BASE_PMU is checked is
> on perf_event.h and only for this parameter that's not defined anywhere
> else. So for now if one tries to compile the kernel without PMU the
> kernel won't compile + I don't see how unsetting this saves code size as
> the config description says.
Sorry for the inconvenience.
Will something like this help?
...
#ifdef CONFIG_RISCV_BASE_PMU
#define RISCV_MAX_COUNTERS 2
#endif
+ #ifndef CONFIG_PERF_EVENTS
+ #define RISCV_MAX_COUNTERS 0
+ #endif
#ifndef RISCV_MAX_COUNTERS
#error "Please provide a valid RISCV_MAX_COUNTERS for the PMU."
#endif
...
>
>
> Since I'm not familiar with the perf code how should I approach this ?
> Is the fix on a correct ? How should we handle b ?
>
> Thanks a lot in advance.
>
> Regards,
> Nick
> pub 2048R/F2823DEF 2019-05-13 Nick Kossifidis <mick@ics.forth.gr>
> sub 2048R/F84F263E 2019-05-13 [expires: 2020-05-12]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-10-23 23:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 15:15 Perf-related compilation issues Nick Kossifidis
2019-10-23 23:52 ` Alan Kao [this message]
2019-10-24 2:23 ` Paul Walmsley
2019-10-24 6:01 ` Mao Han
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=20191023235257.GA7587@andestech.com \
--to=alankao@andestech.com \
--cc=linux-riscv@lists.infradead.org \
--cc=mick@ics.forth.gr \
/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).