From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/12] perf record: Create events initially disabled and enable after init
Date: Fri, 23 Sep 2011 17:26:20 -0300 [thread overview]
Message-ID: <1316809586-28529-7-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1316809586-28529-1-git-send-email-acme@infradead.org>
From: David Ahern <dsahern@gmail.com>
perf-record currently creates events enabled. When doing a system wide
collection (-a arg) this causes data collection for perf's
initialization activities -- eg., perf_event__synthesize_threads().
For some events (e.g., context switch S/W event or tracepoints like
syscalls) perf's initialization causes a lot of events to be captured
frequently generating "Check IO/CPU overload!" warnings on larger
systems (e.g., 2 socket, quad core, hyperthreading).
perf's initialization phase can be skipped by creating events
disabled and then enabling them once the initialization is done.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1314289075-14706-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 3 +++
tools/perf/util/evlist.c | 13 +++++++++++++
tools/perf/util/evlist.h | 1 +
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 6b0519f..f4c3fbe 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -161,6 +161,7 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
struct perf_event_attr *attr = &evsel->attr;
int track = !evsel->idx; /* only the first counter needs these */
+ attr->disabled = 1;
attr->inherit = !no_inherit;
attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
PERF_FORMAT_TOTAL_TIME_RUNNING |
@@ -671,6 +672,8 @@ static int __cmd_record(int argc, const char **argv)
}
}
+ perf_evlist__enable(evsel_list);
+
/*
* Let the child rip
*/
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index c12bd47..72e9f48 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -113,6 +113,19 @@ void perf_evlist__disable(struct perf_evlist *evlist)
}
}
+void perf_evlist__enable(struct perf_evlist *evlist)
+{
+ int cpu, thread;
+ struct perf_evsel *pos;
+
+ for (cpu = 0; cpu < evlist->cpus->nr; cpu++) {
+ list_for_each_entry(pos, &evlist->entries, node) {
+ for (thread = 0; thread < evlist->threads->nr; thread++)
+ ioctl(FD(pos, cpu, thread), PERF_EVENT_IOC_ENABLE);
+ }
+ }
+}
+
int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
{
int nfds = evlist->cpus->nr * evlist->threads->nr * evlist->nr_entries;
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index ce85ae9..f349150 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -54,6 +54,7 @@ int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite);
void perf_evlist__munmap(struct perf_evlist *evlist);
void perf_evlist__disable(struct perf_evlist *evlist);
+void perf_evlist__enable(struct perf_evlist *evlist);
static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
struct cpu_map *cpus,
--
1.6.2.5
next prev parent reply other threads:[~2011-09-23 20:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 20:26 [GIT PULL 00/12] perf tools fixes Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 01/12] perf probe: Fix regression of variable finder Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 02/12] perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 03/12] perf symbols: /proc/kallsyms does not sort module symbols Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 04/12] perf symbols: Preserve symbol scope when parsing /proc/kallsyms Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 05/12] perf symbols: Add some heuristics for choosing the best duplicate symbol Arnaldo Carvalho de Melo
2011-09-23 20:26 ` Arnaldo Carvalho de Melo [this message]
2011-09-23 20:26 ` [PATCH 07/12] perf symbols: Synthesize anonymous mmap events Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 08/12] perf sort: Fix symbol sort output by separating unresolved samples by type Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 09/12] perf tool: Fix endianness handling of u32 data in samples Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 10/12] perf symbols: Fix issue with binaries using 16-bytes buildids (v2) Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 11/12] perf top: Fix userspace sample addr map offset Arnaldo Carvalho de Melo
2011-09-23 20:26 ` [PATCH 12/12] perf tools: Add support for disabling -Werror via WERROR=0 Arnaldo Carvalho de Melo
2011-09-23 21:03 ` [GIT PULL 00/12] perf tools fixes Linus Torvalds
2011-09-23 21:05 ` Arnaldo Carvalho de Melo
2011-09-23 21:05 ` Linus Torvalds
2011-09-23 21:11 ` Arnaldo Carvalho de Melo
2011-09-23 21:25 ` Arnaldo Carvalho de Melo
2011-09-23 23:12 ` Linus Torvalds
2011-09-23 23:31 ` Arnaldo Carvalho de Melo
2011-09-23 23:46 ` Arnaldo Carvalho de Melo
2011-09-24 3:46 ` David Ahern
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=1316809586-28529-7-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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®