diff options
| -rw-r--r-- | kernel/perf_counter.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 615440ab9295..117622cb73a3 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
| @@ -2646,7 +2646,7 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, | |||
| 2646 | u64 counter; | 2646 | u64 counter; |
| 2647 | } group_entry; | 2647 | } group_entry; |
| 2648 | struct perf_callchain_entry *callchain = NULL; | 2648 | struct perf_callchain_entry *callchain = NULL; |
| 2649 | struct perf_tracepoint_record *tp; | 2649 | struct perf_tracepoint_record *tp = NULL; |
| 2650 | int callchain_size = 0; | 2650 | int callchain_size = 0; |
| 2651 | u64 time; | 2651 | u64 time; |
| 2652 | struct { | 2652 | struct { |
| @@ -2717,7 +2717,8 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, | |||
| 2717 | 2717 | ||
| 2718 | if (sample_type & PERF_SAMPLE_TP_RECORD) { | 2718 | if (sample_type & PERF_SAMPLE_TP_RECORD) { |
| 2719 | tp = data->private; | 2719 | tp = data->private; |
| 2720 | header.size += tp->size; | 2720 | if (tp) |
| 2721 | header.size += tp->size; | ||
| 2721 | } | 2722 | } |
| 2722 | 2723 | ||
| 2723 | ret = perf_output_begin(&handle, counter, header.size, nmi, 1); | 2724 | 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, | |||
| 2783 | } | 2784 | } |
| 2784 | } | 2785 | } |
| 2785 | 2786 | ||
| 2786 | if (sample_type & PERF_SAMPLE_TP_RECORD) | 2787 | if ((sample_type & PERF_SAMPLE_TP_RECORD) && tp) |
| 2787 | perf_output_copy(&handle, tp->record, tp->size); | 2788 | perf_output_copy(&handle, tp->record, tp->size); |
| 2788 | 2789 | ||
| 2789 | perf_output_end(&handle); | 2790 | perf_output_end(&handle); |
