Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146128
b: refs/heads/master
c: 4d657e5
h: refs/heads/master
v: v3
  • Loading branch information
Markus Metzger authored and Ingo Molnar committed Apr 7, 2009
1 parent 74a4af0 commit fe66240
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de79f54f5347ad7ec6ff55ccbb6d4ab2a21f6a93
refs/heads/master: 4d657e51dfc042216febd4a007c6f36881f9256d
20 changes: 12 additions & 8 deletions trunk/kernel/trace/trace_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand Down

0 comments on commit fe66240

Please sign in to comment.