From 20d611b4300d6e9e055255fbf36f1147f7b64f0c Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Sat, 8 Aug 2009 04:26:35 +0200 Subject: [PATCH] --- yaml --- r: 156631 b: refs/heads/master c: 10b8e3066066708f304e0fc5cfe658e05abf943d h: refs/heads/master i: 156629: 393aadaf84475f30a892aa419adc005162a6a358 156627: d89872c7641b458d4454bf000cf12534b2bed816 156623: 650de985dde38283c2c8506da14bfb7665f3bd27 v: v3 --- [refs] | 2 +- trunk/kernel/perf_counter.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index f3399b7abddb..6fb3e828c5c2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 25446036cbfc2c89faacdb4fb4603943d2197dc6 +refs/heads/master: 10b8e3066066708f304e0fc5cfe658e05abf943d diff --git a/trunk/kernel/perf_counter.c b/trunk/kernel/perf_counter.c index 615440ab9295..117622cb73a3 100644 --- a/trunk/kernel/perf_counter.c +++ b/trunk/kernel/perf_counter.c @@ -2646,7 +2646,7 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, u64 counter; } group_entry; struct perf_callchain_entry *callchain = NULL; - struct perf_tracepoint_record *tp; + struct perf_tracepoint_record *tp = NULL; int callchain_size = 0; u64 time; struct { @@ -2717,7 +2717,8 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, if (sample_type & PERF_SAMPLE_TP_RECORD) { tp = data->private; - header.size += tp->size; + if (tp) + header.size += tp->size; } ret = perf_output_begin(&handle, counter, header.size, nmi, 1); @@ -2783,7 +2784,7 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, } } - if (sample_type & PERF_SAMPLE_TP_RECORD) + if ((sample_type & PERF_SAMPLE_TP_RECORD) && tp) perf_output_copy(&handle, tp->record, tp->size); perf_output_end(&handle);