diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2009-04-03 10:43:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 07:36:21 -0400 |
commit | 4d657e51dfc042216febd4a007c6f36881f9256d (patch) | |
tree | 3e95aa30f81737f6e30dbc046deb169e4b7426c6 /kernel | |
parent | de79f54f5347ad7ec6ff55ccbb6d4ab2a21f6a93 (diff) |
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@intel.com>
Cc: roland@redhat.com
Cc: eranian@googlemail.com
Cc: oleg@redhat.com
Cc: juan.villacis@intel.com
Cc: ak@linux.jf.intel.com
LKML-Reference: <20090403144556.578777000@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | 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 499d01c44cd1..00dd6485bdd7 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -757,7 +757,7 @@ int | |||
757 | trace_selftest_startup_hw_branches(struct tracer *trace, | 757 | trace_selftest_startup_hw_branches(struct tracer *trace, |
758 | struct trace_array *tr) | 758 | struct trace_array *tr) |
759 | { | 759 | { |
760 | struct trace_iterator iter; | 760 | struct trace_iterator *iter; |
761 | struct tracer tracer; | 761 | struct tracer tracer; |
762 | unsigned long count; | 762 | unsigned long count; |
763 | int ret; | 763 | int ret; |
@@ -777,17 +777,21 @@ trace_selftest_startup_hw_branches(struct tracer *trace, | |||
777 | * The hw-branch tracer needs to collect the trace from the various | 777 | * The hw-branch tracer needs to collect the trace from the various |
778 | * cpu trace buffers - before tracing is stopped. | 778 | * cpu trace buffers - before tracing is stopped. |
779 | */ | 779 | */ |
780 | memset(&iter, 0, sizeof(iter)); | 780 | iter = kzalloc(sizeof(*iter), GFP_KERNEL); |
781 | if (!iter) | ||
782 | return -ENOMEM; | ||
783 | |||
781 | memcpy(&tracer, trace, sizeof(tracer)); | 784 | memcpy(&tracer, trace, sizeof(tracer)); |
782 | 785 | ||
783 | iter.trace = &tracer; | 786 | iter->trace = &tracer; |
784 | iter.tr = tr; | 787 | iter->tr = tr; |
785 | iter.pos = -1; | 788 | iter->pos = -1; |
786 | mutex_init(&iter.mutex); | 789 | mutex_init(&iter->mutex); |
787 | 790 | ||
788 | trace->open(&iter); | 791 | trace->open(iter); |
789 | 792 | ||
790 | mutex_destroy(&iter.mutex); | 793 | mutex_destroy(&iter->mutex); |
794 | kfree(iter); | ||
791 | 795 | ||
792 | tracing_stop(); | 796 | tracing_stop(); |
793 | 797 | ||