mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	Li Zefan <lizf@cn.fujitsu.com>, Zhaolei <zhaolei@cn.fujitsu.com>
Subject: [RFC PATCH 0/2] tracing/stat: stat entries self handling mode
Date: Mon,  1 Jun 2009 07:37:57 +0200	[thread overview]
Message-ID: <1243834679-19132-1-git-send-email-fweisbec@gmail.com> (raw)

Hi everyone,

This patchset introduce a new mode in stat tracing which handles the
stat entries instead of the tracer.

It's a bit like the role of the ring buffer when used by the tracing
except that it deals with stat entries using a hashlist and it's
much less elaborate :)

I guess it could bring some possibilities to plug it in
TRACE_EVENT() or using something similar.

Also it should (I hope) reduce the workqueue tracing code and probably
other future stat tracers as well, if any.

I've tried to minimize the locking.
We have one lock on the fastpath: while a entry is updated by
the tracer. Only the entry is locked here and I fear there
are few other alternatives.

Another lock protects the free entry picking: when a stat entry
has not yet been touched, a free entry is picked up from a list
which is protected with a spinlock too. It also protects against
concurrent removals on the hash list: the entry in turn come
back to the free nodes on removal.
This one doesn't worries me much: the free entry picking happens
only once for each stat entry. And the removals are rare.

Concerning the hash list walking, it is done through rcu.

Another annoying thing, I use raw_spinlock because I'm locking
in the tracing fastpath (entry update), so in case it is used
to trace the locks once day, it's more safe against tracing
recursion.

Thanks,
Frederic.


Frederic Weisbecker (2):
  tracing/stat: introduce new hashlist mode
  tracing/stat: provide a sample example to use the hashlist based stat
    tracing

 kernel/trace/Makefile     |    1 +
 kernel/trace/trace_stat.c |  329 ++++++++++++++++++++++++++++++++++++++++++++-
 kernel/trace/trace_stat.h |   27 ++++-
 kernel/trace/trace_test.c |  108 +++++++++++++++
 4 files changed, 462 insertions(+), 3 deletions(-)
 create mode 100644 kernel/trace/trace_test.c


             reply	other threads:[~2009-06-01  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01  5:37 Frederic Weisbecker [this message]
2009-06-01  5:37 ` [RFC PATCH 1/2] tracing/stat: introduce new hashlist mode Frederic Weisbecker
2009-06-01  6:10   ` Li Zefan
2009-06-01 16:31     ` Frederic Weisbecker
2009-06-01  5:37 ` [RFC PATCH 2/2] tracing/stat: provide a sample example to use the hashlist based stat tracing Frederic Weisbecker

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=1243834679-19132-1-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=zhaolei@cn.fujitsu.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

Powered by JetHome