[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-4d657e51dfc042216febd4a007c6f36881f9256d@git.kernel.org>
Date: Thu, 7 May 2009 09:23:04 GMT
From: tip-bot for Markus Metzger <markus.t.metzger@...el.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
markus.t.metzger@...el.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:tracing/core] x86, hw-branch-tracer: allocate selftest iterator on heap
Commit-ID: 4d657e51dfc042216febd4a007c6f36881f9256d
Gitweb: http://git.kernel.org/tip/4d657e51dfc042216febd4a007c6f36881f9256d
Author: Markus Metzger <markus.t.metzger@...el.com>
AuthorDate: Fri, 3 Apr 2009 16:43:41 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 7 Apr 2009 13:36:21 +0200
x86, hw-branch-tracer: allocate selftest iterator on heap
Allocate the trace_iterator for the hw-branch-tracer selftest on the heap.
Signed-off-by: Markus Metzger <markus.t.metzger@...el.com>
Cc: roland@...hat.com
Cc: eranian@...glemail.com
Cc: oleg@...hat.com
Cc: juan.villacis@...el.com
Cc: ak@...ux.jf.intel.com
LKML-Reference: <20090403144556.578777000@...el.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/trace_selftest.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 499d01c..00dd648 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -757,7 +757,7 @@ int
trace_selftest_startup_hw_branches(struct tracer *trace,
struct trace_array *tr)
{
- struct trace_iterator iter;
+ struct trace_iterator *iter;
struct tracer tracer;
unsigned long count;
int ret;
@@ -777,17 +777,21 @@ trace_selftest_startup_hw_branches(struct tracer *trace,
* The hw-branch tracer needs to collect the trace from the various
* cpu trace buffers - before tracing is stopped.
*/
- memset(&iter, 0, sizeof(iter));
+ iter = kzalloc(sizeof(*iter), GFP_KERNEL);
+ if (!iter)
+ return -ENOMEM;
+
memcpy(&tracer, trace, sizeof(tracer));
- iter.trace = &tracer;
- iter.tr = tr;
- iter.pos = -1;
- mutex_init(&iter.mutex);
+ iter->trace = &tracer;
+ iter->tr = tr;
+ iter->pos = -1;
+ mutex_init(&iter->mutex);
- trace->open(&iter);
+ trace->open(iter);
- mutex_destroy(&iter.mutex);
+ mutex_destroy(&iter->mutex);
+ kfree(iter);
tracing_stop();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists