[PATCH 07/11] perf: Handle injection iotcl for tracepoints from perf record

From: Frederic Weisbecker
Date: Wed Feb 03 2010 - 04:16:11 EST


Call the injection iotcl request for tracepoint events, in case
some of them support it.

Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Hitoshi Mitake <mitake@xxxxxxxxxxxxxxxxxxxxx>
Cc: Li Zefan <lizf@xxxxxxxxxxxxxx>
Cc: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Jens Axboe <jens.axboe@xxxxxxxxxx>
---
tools/perf/builtin-record.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index eea5691..da42519 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -386,6 +386,15 @@ try_again:
}

ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_ENABLE);
+
+ /*
+ * If a tracepoint has some events he wants us to catchup
+ * let's inject them. We may have such injectable event
+ * in several cpus, we want only one injection, so pick the
+ * first cpu
+ */
+ if (attr->type == PERF_TYPE_TRACEPOINT && !nr_cpu)
+ ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_INJECT);
}

static void open_counters(int cpu, pid_t pid)
--
1.6.2.3

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