mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: Gregory Haskins <ghaskins@novell.com>
Cc: mingo@elte.hu, linux-rt-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Adds full stack to critical-section tracing
Date: Wed, 29 Aug 2007 17:48:12 -0700	[thread overview]
Message-ID: <1188434892.26038.23.camel@dhcp193.mvista.com> (raw)
In-Reply-To: <20070810141413.12966.13475.stgit@lsg>

On Fri, 2007-08-10 at 08:14 -0600, Gregory Haskins wrote:
> ---
> 
>  include/linux/sched.h  |    7 +++++--
>  kernel/latency_trace.c |   18 +++++++++++-------
>  2 files changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 8ebb43c..233d26c 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1306,10 +1306,13 @@ struct task_struct {
>  #endif
>  
>  #define MAX_PREEMPT_TRACE 25
> +#define MAX_PREEMPT_TRACE_DEPTH 5
>  
>  #ifdef CONFIG_PREEMPT_TRACE
> -	unsigned long preempt_trace_eip[MAX_PREEMPT_TRACE];
> -	unsigned long preempt_trace_parent_eip[MAX_PREEMPT_TRACE];
> +	struct {
> +		struct stack_trace trace;
> +		unsigned long      data[MAX_PREEMPT_TRACE_DEPTH];
> +	} preempt_trace[MAX_PREEMPT_TRACE];

These changes need some fixing .. The "struct stack_trace"
infrastructure is based on CONFIG_STACKTRACE , so at least you would
want to ifdef your changes on that config options ..

I modified you patch to include the ifdefs,

ftp://source.mvista.com/pub/dwalker/misc/debug-preempt-5-levels-of-stack-frames.patch

The other problem I noticed is that the save_stack_trace(trace); seems
kind of heavy weight to be calling from inside add_preempt_count. If
your only going to a depth of 5 you could potentially use there macros,

#ifdef CONFIG_FRAME_POINTER
# ifndef CONFIG_ARM
#  define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
#  define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
#  define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2))
#  define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3))
#  define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4))
#  define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5))
# else

Daniel


  reply	other threads:[~2007-08-30  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 14:14 [PATCH 0/2] RT: Enhance PREEMPT_TRACE with deeper stacks Gregory Haskins
2007-08-10 14:14 ` [PATCH 1/2] Adds full stack to critical-section tracing Gregory Haskins
2007-08-30  0:48   ` Daniel Walker [this message]
2007-08-10 14:14 ` [PATCH 2/2] Some stacks show up untracable, so fall back to old method in this case Gregory Haskins

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=1188434892.26038.23.camel@dhcp193.mvista.com \
    --to=dwalker@mvista.com \
    --cc=ghaskins@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®