mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Mel Gorman <mel@csn.ul.ie>, Jason Baron <jbaron@redhat.com>,
	Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>,
	linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org,
	alexn@dsv.su.se, akpm@linux-foundation.org, alexn@telia.com,
	apw@shadowen.org, cl@linux-foundation.org, haveblue@us.ibm.com,
	kamezawa.hiroyu@jp.fujitu.com,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	Fr?d?ric Weisbecker <fweisbec@gmail.com>
Subject: Re: + page-owner-tracking.patch added to -mm tree
Date: Wed, 1 Apr 2009 17:22:51 +0200	[thread overview]
Message-ID: <20090401152251.GB23390@elte.hu> (raw)
In-Reply-To: <1238597398.23857.11.camel@penberg-laptop>


* Pekka Enberg <penberg@cs.helsinki.fi> wrote:

> On Wed, 2009-04-01 at 15:49 +0200, Ingo Molnar wrote:
> > And this info could be added to that, and it would sure be nice to 
> > hook it up to kmemtrace primarily, which does a lot of similar 
> > looking work in the slab space. (but Eduard and Pekka will know how 
> > feasible/interesting this is to them.)
> 
> Yup, makes sense to me. Something like this is probably a good 
> starting point for a proper patch.

looks like an excellent starting point.

> +kmemtrace_print_page_alloc_user(struct trace_iterator *iter,
> +				struct kmemtrace_page_alloc_entry *entry)
> +{
> +	struct kmemtrace_user_event_page_alloc *ev_alloc;
> +	struct trace_seq *s = &iter->seq;
> +	struct kmemtrace_user_event *ev;
> +
> +	ev = trace_seq_reserve(s, sizeof(*ev));
> +	if (!ev)
> +		return TRACE_TYPE_PARTIAL_LINE;
> +
> +	ev->event_id		= KMEMTRACE_USER_PAGE_ALLOC;
> +	ev->type_id		= entry->type_id;
> +	ev->event_size		= sizeof(*ev) + sizeof(*ev_alloc);
> +	ev->cpu			= iter->cpu;
> +	ev->timestamp		= iter->ts;
> +	ev->call_site		= 0ULL;	/* FIXME */
> +	ev->ptr			= 0ULL;	/* FIXME */

Here we could call save_stack_trace(), in a way like this, to save 
up to 8 entries of the allocation back-trace:

#define NR_ENTRIES		8

struct kmemtrace_user_event {
...
        unsigned long		entries[NR_ENTRIES];
...
};

        struct stack_trace trace;

        trace.nr_entries	= 0;
        trace.max_entries	= NR_ENTRIES;
        trace.entries		= ev->entries;
        trace.skip		= 2;

        save_stack_trace(&trace);

( the '2' for skip will skip the useless tracer-internal backtrace 
  bits. )

ftrace has built-in stacktrace capabilities as well - but they are 
not hooked up to the binary-tracing pathway yet - right Steve?

	Ingo

  reply	other threads:[~2009-04-01 15:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200903312321.n2VNLAMI006236@imap1.linux-foundation.org>
2009-04-01 11:15 ` Ingo Molnar
2009-04-01 12:55   ` Mel Gorman
2009-04-01 13:17     ` Ingo Molnar
2009-04-01 13:32       ` Mel Gorman
2009-04-01 13:49         ` Ingo Molnar
2009-04-01 14:49           ` Pekka Enberg
2009-04-01 15:22             ` Ingo Molnar [this message]
2009-04-02  7:12               ` Pekka Enberg
2009-04-03  4:21                 ` Eduard - Gabriel Munteanu
2009-04-03 14:17                   ` Ingo Molnar
2009-04-03 14:36                     ` Pekka Enberg
2009-04-03 14:43                       ` Ingo Molnar
2009-04-04 14:08                         ` Eduard - Gabriel Munteanu
2009-04-06  7:12                         ` Pekka Enberg

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=20090401152251.GB23390@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alexn@dsv.su.se \
    --cc=alexn@telia.com \
    --cc=apw@shadowen.org \
    --cc=cl@linux-foundation.org \
    --cc=eduard.munteanu@linux360.ro \
    --cc=fweisbec@gmail.com \
    --cc=haveblue@us.ibm.com \
    --cc=jbaron@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=mm-commits@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --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 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®