From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: oprofile: Always allow backtraces
Date: Thu, 20 Jan 2011 09:42:24 -0000 [thread overview]
Message-ID: <000101cbb886$582f1480$088d3d80$@deacon@arm.com> (raw)
In-Reply-To: <1295470473-1095-1-git-send-email-kauppi@papupata.org>
Hi Ari,
> Always allow backtrace when using oprofile on ARM, even if a PMU
> isn't present.
>
> Restores functionality originally introduced in
> 1b7b56982fdcd9d85effd76f3928cf5d6eb26155 by Richard Purdie.
Well spotted, I'd forgotten we still want this for timer mode.
Comments inline.
> diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
> index 8aa9744..a23e5ae 100644
> --- a/arch/arm/oprofile/common.c
> +++ b/arch/arm/oprofile/common.c
> @@ -46,6 +46,7 @@ char *op_name_from_perf_id(void)
> return NULL;
> }
> }
> +#endif
>
> static int report_trace(struct stackframe *frame, void *d)
> {
> @@ -109,6 +110,7 @@ static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
> tail = user_backtrace(tail);
> }
>
> +#ifdef CONFIG_HW_PERF_EVENTS
Can you reorder the backtrace stuff so that we don't need the extra
#endif/#ifdef please?
> int __init oprofile_arch_init(struct oprofile_operations *ops)
> {
> ops->backtrace = arm_backtrace;
> @@ -124,6 +126,8 @@ void __exit oprofile_arch_exit(void)
> int __init oprofile_arch_init(struct oprofile_operations *ops)
> {
> pr_info("oprofile: hardware counters not available\n");
> + ops->backtrace = arm_backtrace;
> +
> return -ENODEV;
> }
> void __exit oprofile_arch_exit(void) {}
One thing worth mentioning is that the backtrace code relies on a
sensible frame pointer, which you might not have in ARM code and you
certainly won't have for Thumb-2 code.
Will
next prev parent reply other threads:[~2011-01-20 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 20:54 [PATCH] ARM: oprofile: Always allow backtraces Ari Kauppi
2011-01-20 9:42 ` Will Deacon [this message]
2011-01-20 9:52 ` Robert Richter
2011-01-20 9:57 ` Robert Richter
2011-01-20 10:02 ` Will Deacon
2011-01-20 10:17 ` Ari Kauppi
2011-01-20 10:46 ` Robert Richter
2011-01-20 12:31 ` Sergei Shtylyov
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='000101cbb886$582f1480$088d3d80$@deacon@arm.com' \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).