aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 15:03:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 15:03:20 -0400
commit468fc7ed5537615efe671d94248446ac24679773 (patch)
tree27bc9de792e863d6ec1630927b77ac9e7dabb38a /kernel/events
parent08fd8c17686c6b09fa410a26d516548dd80ff147 (diff)
parent36232012344b8db67052432742deaf17f82e70e6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) Unified UDP encapsulation offload methods for drivers, from Alexander Duyck. 2) Make DSA binding more sane, from Andrew Lunn. 3) Support QCA9888 chips in ath10k, from Anilkumar Kolli. 4) Several workqueue usage cleanups, from Bhaktipriya Shridhar. 5) Add XDP (eXpress Data Path), essentially running BPF programs on RX packets as soon as the device sees them, with the option to mirror the packet on TX via the same interface. From Brenden Blanco and others. 6) Allow qdisc/class stats dumps to run lockless, from Eric Dumazet. 7) Add VLAN support to b53 and bcm_sf2, from Florian Fainelli. 8) Simplify netlink conntrack entry layout, from Florian Westphal. 9) Add ipv4 forwarding support to mlxsw spectrum driver, from Ido Schimmel, Yotam Gigi, and Jiri Pirko. 10) Add SKB array infrastructure and convert tun and macvtap over to it. From Michael S Tsirkin and Jason Wang. 11) Support qdisc packet injection in pktgen, from John Fastabend. 12) Add neighbour monitoring framework to TIPC, from Jon Paul Maloy. 13) Add NV congestion control support to TCP, from Lawrence Brakmo. 14) Add GSO support to SCTP, from Marcelo Ricardo Leitner. 15) Allow GRO and RPS to function on macsec devices, from Paolo Abeni. 16) Support MPLS over IPV4, from Simon Horman. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1622 commits) xgene: Fix build warning with ACPI disabled. be2net: perform temperature query in adapter regardless of its interface state l2tp: Correctly return -EBADF from pppol2tp_getname. net/mlx5_core/health: Remove deprecated create_singlethread_workqueue net: ipmr/ip6mr: update lastuse on entry change macsec: ensure rx_sa is set when validation is disabled tipc: dump monitor attributes tipc: add a function to get the bearer name tipc: get monitor threshold for the cluster tipc: make cluster size threshold for monitoring configurable tipc: introduce constants for tipc address validation net: neigh: disallow transition to NUD_STALE if lladdr is unchanged in neigh_update() MAINTAINERS: xgene: Add driver and documentation path Documentation: dtb: xgene: Add MDIO node dtb: xgene: Add MDIO node drivers: net: xgene: ethtool: Use phy_ethtool_gset and sset drivers: net: xgene: Use exported functions drivers: net: xgene: Enable MDIO driver drivers: net: xgene: Add backward compatibility drivers: net: phy: xgene: Add MDIO driver ...
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c68
-rw-r--r--kernel/events/internal.h25
2 files changed, 66 insertions, 27 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 79dae188a987..09ae27b353c1 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5617,16 +5617,26 @@ void perf_output_sample(struct perf_output_handle *handle,
5617 } 5617 }
5618 5618
5619 if (sample_type & PERF_SAMPLE_RAW) { 5619 if (sample_type & PERF_SAMPLE_RAW) {
5620 if (data->raw) { 5620 struct perf_raw_record *raw = data->raw;
5621 u32 raw_size = data->raw->size; 5621
5622 u32 real_size = round_up(raw_size + sizeof(u32), 5622 if (raw) {
5623 sizeof(u64)) - sizeof(u32); 5623 struct perf_raw_frag *frag = &raw->frag;
5624 u64 zero = 0; 5624
5625 5625 perf_output_put(handle, raw->size);
5626 perf_output_put(handle, real_size); 5626 do {
5627 __output_copy(handle, data->raw->data, raw_size); 5627 if (frag->copy) {
5628 if (real_size - raw_size) 5628 __output_custom(handle, frag->copy,
5629 __output_copy(handle, &zero, real_size - raw_size); 5629 frag->data, frag->size);
5630 } else {
5631 __output_copy(handle, frag->data,
5632 frag->size);
5633 }
5634 if (perf_raw_frag_last(frag))
5635 break;
5636 frag = frag->next;
5637 } while (1);
5638 if (frag->pad)
5639 __output_skip(handle, NULL, frag->pad);
5630 } else { 5640 } else {
5631 struct { 5641 struct {
5632 u32 size; 5642 u32 size;
@@ -5751,14 +5761,28 @@ void perf_prepare_sample(struct perf_event_header *header,
5751 } 5761 }
5752 5762
5753 if (sample_type & PERF_SAMPLE_RAW) { 5763 if (sample_type & PERF_SAMPLE_RAW) {
5754 int size = sizeof(u32); 5764 struct perf_raw_record *raw = data->raw;
5755 5765 int size;
5756 if (data->raw) 5766
5757 size += data->raw->size; 5767 if (raw) {
5758 else 5768 struct perf_raw_frag *frag = &raw->frag;
5759 size += sizeof(u32); 5769 u32 sum = 0;
5770
5771 do {
5772 sum += frag->size;
5773 if (perf_raw_frag_last(frag))
5774 break;
5775 frag = frag->next;
5776 } while (1);
5777
5778 size = round_up(sum + sizeof(u32), sizeof(u64));
5779 raw->size = size - sizeof(u32);
5780 frag->pad = raw->size - sum;
5781 } else {
5782 size = sizeof(u64);
5783 }
5760 5784
5761 header->size += round_up(size, sizeof(u64)); 5785 header->size += size;
5762 } 5786 }
5763 5787
5764 if (sample_type & PERF_SAMPLE_BRANCH_STACK) { 5788 if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
@@ -7398,7 +7422,7 @@ static struct pmu perf_swevent = {
7398static int perf_tp_filter_match(struct perf_event *event, 7422static int perf_tp_filter_match(struct perf_event *event,
7399 struct perf_sample_data *data) 7423 struct perf_sample_data *data)
7400{ 7424{
7401 void *record = data->raw->data; 7425 void *record = data->raw->frag.data;
7402 7426
7403 /* only top level events have filters set */ 7427 /* only top level events have filters set */
7404 if (event->parent) 7428 if (event->parent)
@@ -7454,8 +7478,10 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
7454 struct perf_event *event; 7478 struct perf_event *event;
7455 7479
7456 struct perf_raw_record raw = { 7480 struct perf_raw_record raw = {
7457 .size = entry_size, 7481 .frag = {
7458 .data = record, 7482 .size = entry_size,
7483 .data = record,
7484 },
7459 }; 7485 };
7460 7486
7461 perf_sample_data_init(&data, 0, 0); 7487 perf_sample_data_init(&data, 0, 0);
@@ -7596,7 +7622,7 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
7596 prog = event->tp_event->prog; 7622 prog = event->tp_event->prog;
7597 if (prog) { 7623 if (prog) {
7598 event->tp_event->prog = NULL; 7624 event->tp_event->prog = NULL;
7599 bpf_prog_put_rcu(prog); 7625 bpf_prog_put(prog);
7600 } 7626 }
7601} 7627}
7602 7628
diff --git a/kernel/events/internal.h b/kernel/events/internal.h
index 05f9f6d626df..486fd78eb8d5 100644
--- a/kernel/events/internal.h
+++ b/kernel/events/internal.h
@@ -123,21 +123,19 @@ static inline unsigned long perf_aux_size(struct ring_buffer *rb)
123 return rb->aux_nr_pages << PAGE_SHIFT; 123 return rb->aux_nr_pages << PAGE_SHIFT;
124} 124}
125 125
126#define DEFINE_OUTPUT_COPY(func_name, memcpy_func) \ 126#define __DEFINE_OUTPUT_COPY_BODY(advance_buf, memcpy_func, ...) \
127static inline unsigned long \
128func_name(struct perf_output_handle *handle, \
129 const void *buf, unsigned long len) \
130{ \ 127{ \
131 unsigned long size, written; \ 128 unsigned long size, written; \
132 \ 129 \
133 do { \ 130 do { \
134 size = min(handle->size, len); \ 131 size = min(handle->size, len); \
135 written = memcpy_func(handle->addr, buf, size); \ 132 written = memcpy_func(__VA_ARGS__); \
136 written = size - written; \ 133 written = size - written; \
137 \ 134 \
138 len -= written; \ 135 len -= written; \
139 handle->addr += written; \ 136 handle->addr += written; \
140 buf += written; \ 137 if (advance_buf) \
138 buf += written; \
141 handle->size -= written; \ 139 handle->size -= written; \
142 if (!handle->size) { \ 140 if (!handle->size) { \
143 struct ring_buffer *rb = handle->rb; \ 141 struct ring_buffer *rb = handle->rb; \
@@ -152,6 +150,21 @@ func_name(struct perf_output_handle *handle, \
152 return len; \ 150 return len; \
153} 151}
154 152
153#define DEFINE_OUTPUT_COPY(func_name, memcpy_func) \
154static inline unsigned long \
155func_name(struct perf_output_handle *handle, \
156 const void *buf, unsigned long len) \
157__DEFINE_OUTPUT_COPY_BODY(true, memcpy_func, handle->addr, buf, size)
158
159static inline unsigned long
160__output_custom(struct perf_output_handle *handle, perf_copy_f copy_func,
161 const void *buf, unsigned long len)
162{
163 unsigned long orig_len = len;
164 __DEFINE_OUTPUT_COPY_BODY(false, copy_func, handle->addr, buf,
165 orig_len - len, size)
166}
167
155static inline unsigned long 168static inline unsigned long
156memcpy_common(void *dst, const void *src, unsigned long n) 169memcpy_common(void *dst, const void *src, unsigned long n)
157{ 170{