User: Password:
|
|
Subscribe / Log in / New account

perf trace: Add filter Suppport, V3

From:  Li Zefan <lizf@cn.fujitsu.com>
To:  Ingo Molnar <mingo@elte.hu>
Subject:  [PATCH 0/4] perf trace: Add filter Suppport, V3
Date:  Thu, 15 Oct 2009 11:19:20 +0800
Message-ID:  <4AD694B8.2020206@cn.fujitsu.com>
Cc:  Peter Zijlstra <peterz@infradead.org>, Frederic Weisbecker <fweisbec@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Tom Zanussi <tzanussi@gmail.com>, LKML <linux-kernel@vger.kernel.org>
Archive-link:  Article

This patchset adds filter support for perf event, so not all
profile events are recorded but only those match the filters
we set.

An example:

 #./perf record -R -f -e irq:irq_handler_entry --filter irq==18
 ^C
 # ./perf trace
            perf-4303  ... irq_handler_entry: irq=18 handler=eth0
            init-0     ... irq_handler_entry: irq=18 handler=eth0
            init-0     ... irq_handler_entry: irq=18 handler=eth0
            init-0     ... irq_handler_entry: irq=18 handler=eth0
            init-0     ... irq_handler_entry: irq=18 handler=eth0

The syntax of filter expressions can be found in
Documentation/trace/events.txt.

Major changes since V2:

- Remove struct perf_event::filter_active.

Major changes since V1:

- Make filters per perf event, instead of per tracepoint.

- Use "--filter" to set a filter for a trace event, instead of
  mixing it into "-e" option.

---
 include/linux/ftrace_event.h       |   11 ++-
 include/linux/perf_counter.h       |    1 +
 include/linux/perf_event.h         |    6 +
 kernel/perf_event.c                |   80 +++++++++-
 kernel/trace/trace.h               |    6 +-
 kernel/trace/trace_events_filter.c |  302 +++++++++++++++++++++---------------
 tools/perf/builtin-record.c        |   15 ++-
 tools/perf/util/parse-events.c     |   26 +++-
 tools/perf/util/parse-events.h     |    2 +
 9 files changed, 306 insertions(+), 143 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds