get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/750533/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 750533,
    "url": "http://patchwork.ozlabs.org/api/patches/750533/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170413084555.6962-1-alice.michael@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170413084555.6962-1-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-04-13T08:45:44",
    "name": "[next,S70,01/12] i40e/i40evf: Add tracepoints",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "2be64eda2c4fa1dbd996d48862324c0e7832c976",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170413084555.6962-1-alice.michael@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/750533/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/750533/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3w3mvV5Xd1z9s8Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 14 Apr 2017 02:48:38 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2E3518A67B;\n\tThu, 13 Apr 2017 16:48:37 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id HXIbn40pgllA; Thu, 13 Apr 2017 16:48:34 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id E37998A67C;\n\tThu, 13 Apr 2017 16:48:33 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id B17CF1BFE90\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:31 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A8EC789BF0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:31 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id JJfAZaYvpf0h for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:29 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id A869389BDE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:29 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Apr 2017 09:48:28 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga002.jf.intel.com with ESMTP; 13 Apr 2017 09:48:28 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.37,195,1488873600\"; d=\"scan'208\";a=\"73711309\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 13 Apr 2017 04:45:44 -0400",
        "Message-Id": "<20170413084555.6962-1-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "Subject": "[Intel-wired-lan] [next PATCH S70 01/12] i40e/i40evf: Add\n\ttracepoints",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: \"Peterson, Scott D\" <scott.d.peterson@intel.com>\n\nThis patch adds tracepoints to the i40e and i40evf drivers to which\nBPF programs can be attached for feature testing and verification.\nIt's expected that an attached BPF program will identify and count or\nlog some interesting subset of traffic. The bcc-tools package is\nhelpful there for containing all the BPF arcana in a handy Python\nwrapper. Though you can make these tracepoints log trace messages, the\nmessages themselves probably won't be very useful (other to verify the\ntracepoint is being called while you're debugging your BPF program).\n\nThe idea here is that tracepoints have such low performance cost when\ndisabled that we can leave these in the upstream drivers. This may\neventually enable the instrumentation of unmodified customer systems\nshould the need arise to verify a NIC feature is working as expected.\nIn general this enables one set of feature verification tools to be\nused on these drivers whether they're built with the kernel or\nseparately.\n\nUsers are advised against using these tracepoints for anything other\nthan a diagnostic tool. They have a performance impact when enabled,\nand their exact placement and form may change as we see how well they\nwork in practice for the purposes above.\n\nSigned-off-by: Scott Peterson <scott.d.peterson@intel.com>\nChange-ID: Id6014a7322c0e6d08068114dd20bd156f2f6435e\n---\nTesting Hints:\n\nSee that performance is unaffected while tracepoints are present\nbut disabled (default state). Enable them all and see they appear in\n/sys/kernel/debug/tracing/trace when exercised.\n\nWhen disabled, a tracepoint reduces to a 5-byte no-op.\nWhen enabled, that code is patched to jump to the tracepoint clause,\nwhich is located somewhere nearby.  See include/linux/jump_label.h for\ninfo in static keys, and samples/trace-events/trace-events-samples.[ch]\nfor info on the trace events.\n\nTo test tracepoints:\ninsmod i40e and bring up a link\ncd /sys/kernel/debug/tracing\necho > trace\necho 1 > events/i40e/enable\nsend something over i40e\nmore trace\necho 0 > events/i40e/enable\n\ni40evf trace events are in events/i40evf, and enabled separately.\n\nA sample BPF program (CORE/example_tp_bpf.py) is available, but won't\nbe submitted upstream and so is not included in this patch.\n\nIt demonstrates how to access the structures pointed to by the tracepoint\nargs from BPF. See the comments in that script for details and usage. As\nis it will attach itself to one of these tracepoints and emit mostly\nuseless messages when the i40e_clean_rx_irq tracepoint is invoked. \n drivers/net/ethernet/intel/i40e/Makefile        |   3 +\n drivers/net/ethernet/intel/i40e/i40e_main.c     |   6 +\n drivers/net/ethernet/intel/i40e/i40e_trace.h    | 229 ++++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_txrx.c     |   9 +\n drivers/net/ethernet/intel/i40evf/Makefile      |   3 +\n drivers/net/ethernet/intel/i40evf/i40e_trace.h  | 229 ++++++++++++++++++++++++\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c   |   9 +\n drivers/net/ethernet/intel/i40evf/i40evf_main.c |   7 +\n 8 files changed, 495 insertions(+)\n create mode 100644 drivers/net/ethernet/intel/i40e/i40e_trace.h\n create mode 100644 drivers/net/ethernet/intel/i40evf/i40e_trace.h",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/Makefile b/drivers/net/ethernet/intel/i40e/Makefile\nindex 4f454d3..3da482c 100644\n--- a/drivers/net/ethernet/intel/i40e/Makefile\n+++ b/drivers/net/ethernet/intel/i40e/Makefile\n@@ -28,6 +28,9 @@\n # Makefile for the Intel(R) Ethernet Connection XL710 (i40e.ko) driver\n #\n \n+ccflags-y += -I$(src)\n+subdir-ccflags-y += -I$(src)\n+\n obj-$(CONFIG_I40E) += i40e.o\n \n i40e-objs := i40e_main.o \\\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 0c32304..4b507ce 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -32,6 +32,12 @@\n #include \"i40e.h\"\n #include \"i40e_diag.h\"\n #include <net/udp_tunnel.h>\n+/* All i40e tracepoints are defined by the include below, which\n+ * must be included exactly once across the whole kernel with\n+ * CREATE_TRACE_POINTS defined\n+ */\n+#define CREATE_TRACE_POINTS\n+#include \"i40e_trace.h\"\n \n const char i40e_driver_name[] = \"i40e\";\n static const char i40e_driver_string[] =\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h\nnew file mode 100644\nindex 0000000..d3e55f5\n--- /dev/null\n+++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h\n@@ -0,0 +1,229 @@\n+/*******************************************************************************\n+ *\n+ * Intel(R) 40-10 Gigabit Ethernet Connection Network Driver\n+ * Copyright(c) 2013 - 2017 Intel Corporation.\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms and conditions of the GNU General Public License,\n+ * version 2, as published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n+ * more details.\n+ *\n+ * The full GNU General Public License is included in this distribution in\n+ * the file called \"COPYING\".\n+ *\n+ * Contact Information:\n+ * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>\n+ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497\n+ *\n+ ******************************************************************************/\n+\n+/* Modeled on trace-events-sample.h */\n+\n+/* The trace subsystem name for i40e will be \"i40e\".\n+ *\n+ * This file is named i40e_trace.h.\n+ *\n+ * Since this include file's name is different from the trace\n+ * subsystem name, we'll have to define TRACE_INCLUDE_FILE at the end\n+ * of this file.\n+ */\n+#undef TRACE_SYSTEM\n+#define TRACE_SYSTEM i40e\n+\n+/* See trace-events-sample.h for a detailed description of why this\n+ * guard clause is different from most normal include files.\n+ */\n+#if !defined(_I40E_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)\n+#define _I40E_TRACE_H_\n+\n+#include <linux/tracepoint.h>\n+\n+/**\n+ * i40e_trace() macro enables shared code to refer to trace points\n+ * like:\n+ *\n+ * trace_i40e{,vf}_example(args...)\n+ *\n+ * ... as:\n+ *\n+ * i40e_trace(example, args...)\n+ *\n+ * ... to resolve to the PF or VF version of the tracepoint without\n+ * ifdefs, and to allow tracepoints to be disabled entirely at build\n+ * time.\n+ *\n+ * Trace point should always be referred to in the driver via this\n+ * macro.\n+ *\n+ * Similarly, i40e_trace_enabled(trace_name) wraps references to\n+ * trace_i40e{,vf}_<trace_name>_enabled() functions.\n+ */\n+#define _I40E_TRACE_NAME(trace_name) (trace_ ## i40e ## _ ## trace_name)\n+#define I40E_TRACE_NAME(trace_name) _I40E_TRACE_NAME(trace_name)\n+\n+#define i40e_trace(trace_name, args...) I40E_TRACE_NAME(trace_name)(args)\n+\n+#define i40e_trace_enabled(trace_name) I40E_TRACE_NAME(trace_name##_enabled)()\n+\n+/* Events common to PF and VF. Corresponding versions will be defined\n+ * for both, named trace_i40e_* and trace_i40evf_*. The i40e_trace()\n+ * macro above will select the right trace point name for the driver\n+ * being built from shared code.\n+ */\n+\n+/* Events related to a vsi & ring */\n+DECLARE_EVENT_CLASS(\n+\ti40e_tx_template,\n+\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf),\n+\n+\t/* The convention here is to make the first fields in the\n+\t * TP_STRUCT match the TP_PROTO exactly. This enables the use\n+\t * of the args struct generated by the tplist tool (from the\n+\t * bcc-tools package) to be used for those fields. To access\n+\t * fields other than the tracepoint args will require the\n+\t * tplist output to be adjusted.\n+\t */\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, ring)\n+\t\t__field(void*, desc)\n+\t\t__field(void*, buf)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->ring = ring;\n+\t\t__entry->desc = desc;\n+\t\t__entry->buf = buf;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s ring: %p desc: %p buf %p\",\n+\t\t__get_str(devname), __entry->ring,\n+\t\t__entry->desc, __entry->buf)\n+);\n+\n+DEFINE_EVENT(\n+\ti40e_tx_template, i40e_clean_tx_irq,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf));\n+\n+DEFINE_EVENT(\n+\ti40e_tx_template, i40e_clean_tx_irq_unmap,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf));\n+\n+DECLARE_EVENT_CLASS(\n+\ti40e_rx_template,\n+\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb),\n+\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, ring)\n+\t\t__field(void*, desc)\n+\t\t__field(void*, skb)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->ring = ring;\n+\t\t__entry->desc = desc;\n+\t\t__entry->skb = skb;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s ring: %p desc: %p skb %p\",\n+\t\t__get_str(devname), __entry->ring,\n+\t\t__entry->desc, __entry->skb)\n+);\n+\n+DEFINE_EVENT(\n+\ti40e_rx_template, i40e_clean_rx_irq,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb));\n+\n+DEFINE_EVENT(\n+\ti40e_rx_template, i40e_clean_rx_irq_rx,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb));\n+\n+DECLARE_EVENT_CLASS(\n+\ti40e_xmit_template,\n+\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring),\n+\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, skb)\n+\t\t__field(void*, ring)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->skb = skb;\n+\t\t__entry->ring = ring;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s skb: %p ring: %p\",\n+\t\t__get_str(devname), __entry->skb,\n+\t\t__entry->ring)\n+);\n+\n+DEFINE_EVENT(\n+\ti40e_xmit_template, i40e_xmit_frame_ring,\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring));\n+\n+DEFINE_EVENT(\n+\ti40e_xmit_template, i40e_xmit_frame_ring_drop,\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring));\n+\n+/* Events unique to the PF. */\n+\n+#endif /* _I40E_TRACE_H_ */\n+/* This must be outside ifdef _I40E_TRACE_H */\n+\n+/* This trace include file is not located in the .../include/trace\n+ * with the kernel tracepoint definitions, because we're a loadable\n+ * module.\n+ */\n+#undef TRACE_INCLUDE_PATH\n+#define TRACE_INCLUDE_PATH .\n+#undef TRACE_INCLUDE_FILE\n+#define TRACE_INCLUDE_FILE i40e_trace\n+#include <trace/define_trace.h>\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 5f04929..3288572 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -27,6 +27,7 @@\n #include <linux/prefetch.h>\n #include <net/busy_poll.h>\n #include \"i40e.h\"\n+#include \"i40e_trace.h\"\n #include \"i40e_prototype.h\"\n \n static inline __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size,\n@@ -765,6 +766,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\t/* prevent any other reads prior to eop_desc */\n \t\tread_barrier_depends();\n \n+\t\ti40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);\n \t\t/* we have caught up to head, no work left to do */\n \t\tif (tx_head == tx_desc)\n \t\t\tbreak;\n@@ -791,6 +793,8 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \n \t\t/* unmap remaining buffers */\n \t\twhile (tx_desc != eop_desc) {\n+\t\t\ti40e_trace(clean_tx_irq_unmap,\n+\t\t\t\t   tx_ring, tx_desc, tx_buf);\n \n \t\t\ttx_buf++;\n \t\t\ttx_desc++;\n@@ -2062,6 +2066,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tif (!size)\n \t\t\tbreak;\n \n+\t\ti40e_trace(clean_rx_irq, rx_ring, rx_desc, skb);\n \t\trx_buffer = i40e_get_rx_buffer(rx_ring, size);\n \n \t\t/* retrieve a buffer from the ring */\n@@ -2114,6 +2119,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tvlan_tag = (qword & BIT(I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) ?\n \t\t\t   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;\n \n+\t\ti40e_trace(clean_rx_irq_rx, rx_ring, rx_desc, skb);\n \t\ti40e_receive_skb(rx_ring, skb, vlan_tag, lpbk);\n \t\tskb = NULL;\n \n@@ -3247,6 +3253,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t/* prefetch the data, we'll need it later */\n \tprefetch(skb->data);\n \n+\ti40e_trace(xmit_frame_ring, skb, tx_ring);\n+\n \tcount = i40e_xmit_descriptor_count(skb);\n \tif (i40e_chk_linearize(skb, count)) {\n \t\tif (__skb_linearize(skb)) {\n@@ -3327,6 +3335,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \treturn NETDEV_TX_OK;\n \n out_drop:\n+\ti40e_trace(xmit_frame_ring_drop, first->skb, tx_ring);\n \tdev_kfree_skb_any(first->skb);\n \tfirst->skb = NULL;\n \treturn NETDEV_TX_OK;\ndiff --git a/drivers/net/ethernet/intel/i40evf/Makefile b/drivers/net/ethernet/intel/i40evf/Makefile\nindex 827c7a6..a393f4a 100644\n--- a/drivers/net/ethernet/intel/i40evf/Makefile\n+++ b/drivers/net/ethernet/intel/i40evf/Makefile\n@@ -29,6 +29,9 @@\n #\n #\n \n+ccflags-y += -I$(src)\n+subdir-ccflags-y += -I$(src)\n+\n obj-$(CONFIG_I40EVF) += i40evf.o\n \n i40evf-objs :=\ti40evf_main.o i40evf_ethtool.o i40evf_virtchnl.o \\\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_trace.h b/drivers/net/ethernet/intel/i40evf/i40e_trace.h\nnew file mode 100644\nindex 0000000..9a5100b\n--- /dev/null\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_trace.h\n@@ -0,0 +1,229 @@\n+/*******************************************************************************\n+ *\n+ * Intel(R) 40-10 Gigabit Ethernet Virtual Function Driver\n+ * Copyright(c) 2013 - 2017 Intel Corporation.\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms and conditions of the GNU General Public License,\n+ * version 2, as published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n+ * more details.\n+ *\n+ * The full GNU General Public License is included in this distribution in\n+ * the file called \"COPYING\".\n+ *\n+ * Contact Information:\n+ * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>\n+ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497\n+ *\n+ ******************************************************************************/\n+\n+/* Modeled on trace-events-sample.h */\n+\n+/* The trace subsystem name for i40evf will be \"i40evf\".\n+ *\n+ * This file is named i40e_trace.h.\n+ *\n+ * Since this include file's name is different from the trace\n+ * subsystem name, we'll have to define TRACE_INCLUDE_FILE at the end\n+ * of this file.\n+ */\n+#undef TRACE_SYSTEM\n+#define TRACE_SYSTEM i40evf\n+\n+/* See trace-events-sample.h for a detailed description of why this\n+ * guard clause is different from most normal include files.\n+ */\n+#if !defined(_I40E_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)\n+#define _I40E_TRACE_H_\n+\n+#include <linux/tracepoint.h>\n+\n+/**\n+ * i40e_trace() macro enables shared code to refer to trace points\n+ * like:\n+ *\n+ * trace_i40e{,vf}_example(args...)\n+ *\n+ * ... as:\n+ *\n+ * i40e_trace(example, args...)\n+ *\n+ * ... to resolve to the PF or VF version of the tracepoint without\n+ * ifdefs, and to allow tracepoints to be disabled entirely at build\n+ * time.\n+ *\n+ * Trace point should always be referred to in the driver via this\n+ * macro.\n+ *\n+ * Similarly, i40e_trace_enabled(trace_name) wraps references to\n+ * trace_i40e{,vf}_<trace_name>_enabled() functions.\n+ */\n+#define _I40E_TRACE_NAME(trace_name) (trace_ ## i40evf ## _ ## trace_name)\n+#define I40E_TRACE_NAME(trace_name) _I40E_TRACE_NAME(trace_name)\n+\n+#define i40e_trace(trace_name, args...) I40E_TRACE_NAME(trace_name)(args)\n+\n+#define i40e_trace_enabled(trace_name) I40E_TRACE_NAME(trace_name##_enabled)()\n+\n+/* Events common to PF and VF. Corresponding versions will be defined\n+ * for both, named trace_i40e_* and trace_i40evf_*. The i40e_trace()\n+ * macro above will select the right trace point name for the driver\n+ * being built from shared code.\n+ */\n+\n+/* Events related to a vsi & ring */\n+DECLARE_EVENT_CLASS(\n+\ti40evf_tx_template,\n+\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf),\n+\n+\t/* The convention here is to make the first fields in the\n+\t * TP_STRUCT match the TP_PROTO exactly. This enables the use\n+\t * of the args struct generated by the tplist tool (from the\n+\t * bcc-tools package) to be used for those fields. To access\n+\t * fields other than the tracepoint args will require the\n+\t * tplist output to be adjusted.\n+\t */\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, ring)\n+\t\t__field(void*, desc)\n+\t\t__field(void*, buf)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->ring = ring;\n+\t\t__entry->desc = desc;\n+\t\t__entry->buf = buf;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s ring: %p desc: %p buf %p\",\n+\t\t__get_str(devname), __entry->ring,\n+\t\t__entry->desc, __entry->buf)\n+);\n+\n+DEFINE_EVENT(\n+\ti40evf_tx_template, i40evf_clean_tx_irq,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf));\n+\n+DEFINE_EVENT(\n+\ti40evf_tx_template, i40evf_clean_tx_irq_unmap,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t struct i40e_tx_desc *desc,\n+\t\t struct i40e_tx_buffer *buf),\n+\n+\tTP_ARGS(ring, desc, buf));\n+\n+DECLARE_EVENT_CLASS(\n+\ti40evf_rx_template,\n+\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb),\n+\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, ring)\n+\t\t__field(void*, desc)\n+\t\t__field(void*, skb)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->ring = ring;\n+\t\t__entry->desc = desc;\n+\t\t__entry->skb = skb;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s ring: %p desc: %p skb %p\",\n+\t\t__get_str(devname), __entry->ring,\n+\t\t__entry->desc, __entry->skb)\n+);\n+\n+DEFINE_EVENT(\n+\ti40evf_rx_template, i40evf_clean_rx_irq,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb));\n+\n+DEFINE_EVENT(\n+\ti40evf_rx_template, i40evf_clean_rx_irq_rx,\n+\tTP_PROTO(struct i40e_ring *ring,\n+\t\t union i40e_32byte_rx_desc *desc,\n+\t\t struct sk_buff *skb),\n+\n+\tTP_ARGS(ring, desc, skb));\n+\n+DECLARE_EVENT_CLASS(\n+\ti40evf_xmit_template,\n+\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring),\n+\n+\tTP_STRUCT__entry(\n+\t\t__field(void*, skb)\n+\t\t__field(void*, ring)\n+\t\t__string(devname, ring->netdev->name)\n+\t),\n+\n+\tTP_fast_assign(\n+\t\t__entry->skb = skb;\n+\t\t__entry->ring = ring;\n+\t\t__assign_str(devname, ring->netdev->name);\n+\t),\n+\n+\tTP_printk(\n+\t\t\"netdev: %s skb: %p ring: %p\",\n+\t\t__get_str(devname), __entry->skb,\n+\t\t__entry->ring)\n+);\n+\n+DEFINE_EVENT(\n+\ti40evf_xmit_template, i40evf_xmit_frame_ring,\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring));\n+\n+DEFINE_EVENT(\n+\ti40evf_xmit_template, i40evf_xmit_frame_ring_drop,\n+\tTP_PROTO(struct sk_buff *skb,\n+\t\t struct i40e_ring *ring),\n+\n+\tTP_ARGS(skb, ring));\n+\n+/* Events unique to the VF. */\n+\n+#endif /* _I40E_TRACE_H_ */\n+/* This must be outside ifdef _I40E_TRACE_H */\n+\n+/* This trace include file is not located in the .../include/trace\n+ * with the kernel tracepoint definitions, because we're a loadable\n+ * module.\n+ */\n+#undef TRACE_INCLUDE_PATH\n+#define TRACE_INCLUDE_PATH .\n+#undef TRACE_INCLUDE_FILE\n+#define TRACE_INCLUDE_FILE i40e_trace\n+#include <trace/define_trace.h>\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 80931e3..34e96d9 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -28,6 +28,7 @@\n #include <net/busy_poll.h>\n \n #include \"i40evf.h\"\n+#include \"i40e_trace.h\"\n #include \"i40e_prototype.h\"\n \n static inline __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size,\n@@ -180,6 +181,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\t/* prevent any other reads prior to eop_desc */\n \t\tread_barrier_depends();\n \n+\t\ti40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);\n \t\t/* if the descriptor isn't done, no work yet to do */\n \t\tif (!(eop_desc->cmd_type_offset_bsz &\n \t\t      cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))\n@@ -207,6 +209,8 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \n \t\t/* unmap remaining buffers */\n \t\twhile (tx_desc != eop_desc) {\n+\t\t\ti40e_trace(clean_tx_irq_unmap,\n+\t\t\t\t   tx_ring, tx_desc, tx_buf);\n \n \t\t\ttx_buf++;\n \t\t\ttx_desc++;\n@@ -1329,6 +1333,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tif (!size)\n \t\t\tbreak;\n \n+\t\ti40e_trace(clean_rx_irq, rx_ring, rx_desc, skb);\n \t\trx_buffer = i40e_get_rx_buffer(rx_ring, size);\n \n \t\t/* retrieve a buffer from the ring */\n@@ -1382,6 +1387,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tvlan_tag = (qword & BIT(I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) ?\n \t\t\t   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;\n \n+\t\ti40e_trace(clean_rx_irq_rx, rx_ring, rx_desc, skb);\n \t\ti40e_receive_skb(rx_ring, skb, vlan_tag);\n \t\tskb = NULL;\n \n@@ -2223,6 +2229,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t/* prefetch the data, we'll need it later */\n \tprefetch(skb->data);\n \n+\ti40e_trace(xmit_frame_ring, skb, tx_ring);\n+\n \tcount = i40e_xmit_descriptor_count(skb);\n \tif (i40e_chk_linearize(skb, count)) {\n \t\tif (__skb_linearize(skb)) {\n@@ -2290,6 +2298,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \treturn NETDEV_TX_OK;\n \n out_drop:\n+\ti40e_trace(xmit_frame_ring_drop, first->skb, tx_ring);\n \tdev_kfree_skb_any(first->skb);\n \tfirst->skb = NULL;\n \treturn NETDEV_TX_OK;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 671913c..5915273 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -27,6 +27,13 @@\n #include \"i40evf.h\"\n #include \"i40e_prototype.h\"\n #include \"i40evf_client.h\"\n+/* All i40evf tracepoints are defined by the include below, which must\n+ * be included exactly once across the whole kernel with\n+ * CREATE_TRACE_POINTS defined\n+ */\n+#define CREATE_TRACE_POINTS\n+#include \"i40e_trace.h\"\n+\n static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter);\n static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter);\n static int i40evf_close(struct net_device *netdev);\n",
    "prefixes": [
        "next",
        "S70",
        "01/12"
    ]
}