linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	williams@redhat.com,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 2/2] ftrace/x86/extable: Add is_ftrace_trampoline() function
Date: Tue, 18 Nov 2014 23:15:16 -0500	[thread overview]
Message-ID: <20141118231516.2c3a7bdb@gandalf.local.home> (raw)
In-Reply-To: <20141119034829.497125839@goodmis.org>

On Tue, 18 Nov 2014 22:33:33 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:


> +/*
> + * This is used by __kernel_text_address() to return true if the
> + * the address is on a dynamically allocated trampoline that would
> + * not return true for either core_kernel_text() or
> + * is_module_text_address().
> + */
> +bool is_ftrace_trampoline(unsigned long addr)
> +{
> +	struct ftrace_ops *op;
> +
> +	do_for_each_ftrace_op(op, ftrace_ops_list) {
> +		/*
> +		 * This is to check for dynamically allocated trampolines.
> +		 * Trampolines that are in kernel text will have
> +		 * core_kernel_text() return true.
> +		 */
> +		if (op->trampoline && op->trampoline_size)
> +			if (addr >= op->trampoline &&
> +			    addr < op->trampoline + op->trampoline_size)
> +				return true;
> +	} while_for_each_ftrace_op(op);
> +
> +	return false;
> +}
> +

Hmm, preemption should be disabled here. We can't guarantee that the
caller will have that. Will update.

-- Steve

  reply	other threads:[~2014-11-19  4:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  3:33 [PATCH 0/2] ftrace: Fix stack tracing issues Steven Rostedt
2014-11-19  3:33 ` [PATCH 1/2] ftrace/x86: Add frames pointers to trampoline as necessary Steven Rostedt
2014-11-19 18:26   ` Thomas Gleixner
2014-11-19 18:38     ` Steven Rostedt
2014-11-19  3:33 ` [PATCH 2/2] ftrace/x86/extable: Add is_ftrace_trampoline() function Steven Rostedt
2014-11-19  4:15   ` Steven Rostedt [this message]
2014-11-19  8:16   ` Namhyung Kim
2014-11-19 13:36     ` Steven Rostedt
2014-11-19 15:37     ` Steven Rostedt
2014-11-19 18:29       ` Thomas Gleixner
2014-11-19 18:39         ` Steven Rostedt

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=20141118231516.2c3a7bdb@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.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 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).