All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Tim Bird <tim.bird@am.sony.com>,
	Ezequiel Garcia <elezegarcia@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [RFC/PATCH] scripts/tracing: Add trace_analyze.py tool
Date: Tue, 22 Jan 2013 15:41:19 +0200	[thread overview]
Message-ID: <CAOJsxLFFWPChApkuec17Z09Z11OS5Q+XSHo4U4mSc754dC1-ww@mail.gmail.com> (raw)
In-Reply-To: <1358848018-3679-1-git-send-email-ezequiel.garcia@free-electrons.com>

(Adding acme to CC.)

On Tue, Jan 22, 2013 at 11:46 AM, Ezequiel Garcia
<ezequiel.garcia@free-electrons.com> wrote:
> From: Ezequiel Garcia <elezegarcia@gmail.com>
>
> The purpose of trace_analyze.py tool is to perform static
> and dynamic memory analysis using a kmem ftrace
> log file and a built kernel tree.
>
> This script and related work has been done on the CEWG/2012 project:
> "Kernel dynamic memory allocation tracking and reduction"
> (More info here [1])
>
> It produces mainly two kinds of outputs:
>  * an account-like output, similar to the one given by Perf, example below.
>  * a ring-char output, examples here [2].
>
> $ ./scripts/tracing/trace_analyze.py -k linux -f kmem.log --account-file account.txt
> $ ./scripts/tracing/trace_analyze.py -k linux -f kmem.log -c account.txt
>
> This will produce an account file like this:
>
>     current bytes allocated:     669696
>     current bytes requested:     618823
>     current wasted bytes:         50873
>     number of allocs:              7649
>     number of frees:               2563
>     number of callers:              115
>
>      total    waste      net alloc/free  caller
>     ---------------------------------------------
>     299200        0   298928  1100/1     alloc_inode+0x4fL
>     189824        0   140544  1483/385   __d_alloc+0x22L
>      51904        0    47552   811/68    sysfs_new_dirent+0x4eL
>     [...]
>
> [1] http://elinux.org/Kernel_dynamic_memory_analysis
> [2] http://elinux.org/Kernel_dynamic_memory_analysis#Current_dynamic_footprint
>
> Cc: Pekka Enberg <penberg@kernel.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>

Looks really useful! Dunno if this makes most sense as a separate
script or as an extension perf.

                        Pekka

WARNING: multiple messages have this Message-ID (diff)
From: Pekka Enberg <penberg@kernel.org>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Tim Bird <tim.bird@am.sony.com>,
	Ezequiel Garcia <elezegarcia@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [RFC/PATCH] scripts/tracing: Add trace_analyze.py tool
Date: Tue, 22 Jan 2013 15:41:19 +0200	[thread overview]
Message-ID: <CAOJsxLFFWPChApkuec17Z09Z11OS5Q+XSHo4U4mSc754dC1-ww@mail.gmail.com> (raw)
In-Reply-To: <1358848018-3679-1-git-send-email-ezequiel.garcia@free-electrons.com>

(Adding acme to CC.)

On Tue, Jan 22, 2013 at 11:46 AM, Ezequiel Garcia
<ezequiel.garcia@free-electrons.com> wrote:
> From: Ezequiel Garcia <elezegarcia@gmail.com>
>
> The purpose of trace_analyze.py tool is to perform static
> and dynamic memory analysis using a kmem ftrace
> log file and a built kernel tree.
>
> This script and related work has been done on the CEWG/2012 project:
> "Kernel dynamic memory allocation tracking and reduction"
> (More info here [1])
>
> It produces mainly two kinds of outputs:
>  * an account-like output, similar to the one given by Perf, example below.
>  * a ring-char output, examples here [2].
>
> $ ./scripts/tracing/trace_analyze.py -k linux -f kmem.log --account-file account.txt
> $ ./scripts/tracing/trace_analyze.py -k linux -f kmem.log -c account.txt
>
> This will produce an account file like this:
>
>     current bytes allocated:     669696
>     current bytes requested:     618823
>     current wasted bytes:         50873
>     number of allocs:              7649
>     number of frees:               2563
>     number of callers:              115
>
>      total    waste      net alloc/free  caller
>     ---------------------------------------------
>     299200        0   298928  1100/1     alloc_inode+0x4fL
>     189824        0   140544  1483/385   __d_alloc+0x22L
>      51904        0    47552   811/68    sysfs_new_dirent+0x4eL
>     [...]
>
> [1] http://elinux.org/Kernel_dynamic_memory_analysis
> [2] http://elinux.org/Kernel_dynamic_memory_analysis#Current_dynamic_footprint
>
> Cc: Pekka Enberg <penberg@kernel.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>

Looks really useful! Dunno if this makes most sense as a separate
script or as an extension perf.

                        Pekka

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-01-22 13:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22  9:46 [RFC/PATCH] scripts/tracing: Add trace_analyze.py tool Ezequiel Garcia
2013-01-22  9:46 ` Ezequiel Garcia
2013-01-22 13:41 ` Pekka Enberg [this message]
2013-01-22 13:41   ` Pekka Enberg
2013-01-22 16:16   ` Ezequiel Garcia
2013-01-22 16:16     ` Ezequiel Garcia
2013-01-23  4:27 ` Minchan Kim
2013-01-23  4:27   ` Minchan Kim
2013-01-23 21:37   ` Ezequiel Garcia
2013-01-23 21:37     ` Ezequiel Garcia
2013-01-24  5:50     ` Minchan Kim
2013-01-24  5:50       ` Minchan Kim
2013-01-24 17:16       ` Ezequiel Garcia
2013-01-24 17:16         ` Ezequiel Garcia
2013-01-24 23:24         ` Minchan Kim
2013-01-24 23:24           ` Minchan Kim

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=CAOJsxLFFWPChApkuec17Z09Z11OS5Q+XSHo4U4mSc754dC1-ww@mail.gmail.com \
    --to=penberg@kernel.org \
    --cc=acme@redhat.com \
    --cc=elezegarcia@gmail.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tim.bird@am.sony.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 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.