All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	kan.liang@linux.intel.com, like.xu@linux.intel.com
Subject: Re: [BUG] Stack overflow when running perf and function tracer
Date: Fri, 30 Oct 2020 14:42:56 +0100	[thread overview]
Message-ID: <87v9ern82n.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <874kmcndy5.fsf@nanos.tec.linutronix.de>

On Fri, Oct 30 2020 at 12:36, Thomas Gleixner wrote:
> On Fri, Oct 30 2020 at 11:32, Peter Zijlstra wrote:
> So the real question is what else is on that stack which blows it up
> close to 4k? Btw, it would be massively helpful for this kind of crash
> to print the actual stack depth per entry in the backtrace.
>
> Here is the partial stack trace:
>                                                 Stack usage
>   ring_buffer_lock_reserve+0x12c/0x380          
>   trace_function+0x27/0x130
>   function_trace_call+0x133/0x180
>   perf_output_begin+0x4d/0x2d0                   64+
>   perf_log_throttle+0x9a/0x120                  470+
>   __perf_event_account_interrupt+0xa9/0x120
>   __perf_event_overflow+0x2b/0xf0               
>   __intel_pmu_pebs_event+0x2ec/0x3e0            760+
>   intel_pmu_drain_pebs_nhm+0x268/0x330          200+
>   handle_pmi_common+0xc2/0x2b0                  

So Steven provided a backtrace with the actual stack depth printed:

ring_buffer_lock_reserve+0x12c/0x380		0030  104
trace_function+0x27/0xf0			0098   56
function_trace_call+0x124/0x190			00d0  224 
__rcu_read_lock+0x5/0x20			01b0    8
perf_output_begin+0x4d/0x2d0			01b8  640
perf_log_throttle+0x9a/0x120			0438  624
__perf_event_account_interrupt+0xa6/0x120	06a8   32
__perf_event_overflow+0x2b/0xf0			06c8   48
__intel_pmu_pebs_event+0x2ec/0x3e0		06f8  960
intel_pmu_drain_pebs_nhm+0x268/0x330		0ab8  256
handle_pmi_common+0xc2/0x2b0			0bb8  584
intel_pmu_handle_irq+0xc8/0x160			0e00   64
perf_event_nmi_handler+0x28/0x50		0e40   32
nmi_handle+0x80/0x190				0e60   64
default_do_nmi+0x6b/0x170			0ea0   40
exc_nmi+0x15d/0x1a0				0ec8   40
end_repeat_nmi+0x16/0x55			0ef0  272

So I missed perf_output_begin and handle_pmi_common ...

  reply	other threads:[~2020-10-30 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30  4:27 [BUG] Stack overflow when running perf and function tracer Steven Rostedt
2020-10-30  9:00 ` Peter Zijlstra
2020-10-30 10:26   ` Thomas Gleixner
2020-10-30 10:32     ` Peter Zijlstra
2020-10-30 11:36       ` Thomas Gleixner
2020-10-30 13:42         ` Thomas Gleixner [this message]
2020-10-30 10:59     ` [PATCH] perf/arch: Remove perf_sample_data::regs_user_copy Peter Zijlstra
2020-10-30 12:33       ` Steven Rostedt
2020-10-30 11:19   ` [PATCH] perf/x86: Make dummy_iregs static Peter Zijlstra

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=87v9ern82n.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=kan.liang@linux.intel.com \
    --cc=like.xu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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 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.