diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/perf_counter.c | 18 | ||||
-rw-r--r-- | kernel/trace/trace.c | 1 | ||||
-rw-r--r-- | kernel/trace/trace.h | 4 |
3 files changed, 18 insertions, 5 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 52eb4b68d34f..868102172aa4 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -2646,6 +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 | int callchain_size = 0; | 2650 | int callchain_size = 0; |
2650 | u64 time; | 2651 | u64 time; |
2651 | struct { | 2652 | struct { |
@@ -2714,6 +2715,11 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, | |||
2714 | header.size += sizeof(u64); | 2715 | header.size += sizeof(u64); |
2715 | } | 2716 | } |
2716 | 2717 | ||
2718 | if (sample_type & PERF_SAMPLE_TP_RECORD) { | ||
2719 | tp = data->private; | ||
2720 | header.size += tp->size; | ||
2721 | } | ||
2722 | |||
2717 | ret = perf_output_begin(&handle, counter, header.size, nmi, 1); | 2723 | ret = perf_output_begin(&handle, counter, header.size, nmi, 1); |
2718 | if (ret) | 2724 | if (ret) |
2719 | return; | 2725 | return; |
@@ -2777,6 +2783,9 @@ static void perf_counter_output(struct perf_counter *counter, int nmi, | |||
2777 | } | 2783 | } |
2778 | } | 2784 | } |
2779 | 2785 | ||
2786 | if (sample_type & PERF_SAMPLE_TP_RECORD) | ||
2787 | perf_output_copy(&handle, tp->record, tp->size); | ||
2788 | |||
2780 | perf_output_end(&handle); | 2789 | perf_output_end(&handle); |
2781 | } | 2790 | } |
2782 | 2791 | ||
@@ -3703,11 +3712,18 @@ static const struct pmu perf_ops_task_clock = { | |||
3703 | }; | 3712 | }; |
3704 | 3713 | ||
3705 | #ifdef CONFIG_EVENT_PROFILE | 3714 | #ifdef CONFIG_EVENT_PROFILE |
3706 | void perf_tpcounter_event(int event_id, u64 addr, u64 count) | 3715 | void perf_tpcounter_event(int event_id, u64 addr, u64 count, void *record, |
3716 | int entry_size) | ||
3707 | { | 3717 | { |
3718 | struct perf_tracepoint_record tp = { | ||
3719 | .size = entry_size, | ||
3720 | .record = record, | ||
3721 | }; | ||
3722 | |||
3708 | struct perf_sample_data data = { | 3723 | struct perf_sample_data data = { |
3709 | .regs = get_irq_regs(), | 3724 | .regs = get_irq_regs(), |
3710 | .addr = addr, | 3725 | .addr = addr, |
3726 | .private = &tp, | ||
3711 | }; | 3727 | }; |
3712 | 3728 | ||
3713 | if (!data.regs) | 3729 | if (!data.regs) |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 8930e39b9d8c..c22b40f8f576 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -848,6 +848,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, | |||
848 | ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) | | 848 | ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) | |
849 | (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0); | 849 | (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0); |
850 | } | 850 | } |
851 | EXPORT_SYMBOL_GPL(tracing_generic_entry_update); | ||
851 | 852 | ||
852 | struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, | 853 | struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, |
853 | int type, | 854 | int type, |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 3548ae5cc780..8b9f4f6e9559 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -438,10 +438,6 @@ struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, | |||
438 | struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, | 438 | struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, |
439 | int *ent_cpu, u64 *ent_ts); | 439 | int *ent_cpu, u64 *ent_ts); |
440 | 440 | ||
441 | void tracing_generic_entry_update(struct trace_entry *entry, | ||
442 | unsigned long flags, | ||
443 | int pc); | ||
444 | |||
445 | void default_wait_pipe(struct trace_iterator *iter); | 441 | void default_wait_pipe(struct trace_iterator *iter); |
446 | void poll_wait_pipe(struct trace_iterator *iter); | 442 | void poll_wait_pipe(struct trace_iterator *iter); |
447 | 443 | ||