Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752789AbcLFLHp (ORCPT ); Tue, 6 Dec 2016 06:07:45 -0500 Received: from mail-by2nam03on0047.outbound.protection.outlook.com ([104.47.42.47]:18446 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752629AbcLFLHi (ORCPT ); Tue, 6 Dec 2016 06:07:38 -0500 X-Greylist: delayed 5552 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Dec 2016 06:07:38 EST Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=fail action=none header.from=nxp.com; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:840;Count:10 From: Ioana Radulescu To: CC: , , , , , , , , Subject: [PATCH 6/8] staging: fsl-dpaa2/eth: Add trace points Date: Tue, 6 Dec 2016 03:34:40 -0600 Message-ID: <20161206093442.11362-7-ruxandra.radulescu@nxp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161206093442.11362-1-ruxandra.radulescu@nxp.com> References: <20161206093442.11362-1-ruxandra.radulescu@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131254904844282483;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(336004)(189002)(199003)(76176999)(50986999)(1076002)(2906002)(6916009)(50466002)(110136003)(5003940100001)(4326007)(48376002)(2950100002)(575784001)(86362001)(104016004)(68736007)(8676002)(2351001)(47776003)(106466001)(305945005)(39860400001)(39840400001)(39850400001)(92566002)(626004)(50226002)(356003)(189998001)(7416002)(77096006)(8936002)(81156014)(81166006)(39060400001)(105606002)(39380400001)(36756003)(39410400001)(39450400002)(33646002)(8666005)(97736004)(5660300001)(85426001)(38730400001)(39400400001)(7846002)(7059030)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2472;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD026;1:Hsl/pro0xbmOZ6wQwwi8E8gWciGDlGzuxYYXrtoWzU71yy4muF3RZkyNBrmU5q3zK8y92hWzIKbv41zPIDg+CKOgNZ4kAaW2elc9UyQtHvdPfAcCwr+lqfJkASiIz0IDgfrKnMoCFxPQ4eiZ0JCtAE+KP6jJl+dg0iD2OJDu2lou+mGevVqHSMa8KMiXL6ODCuiMV+YSOeTdhIMelqR37pJOGlucGC9bW8OoSjaB7QG1nhkoYUXxAHZ70lpGhD+oHuujNFvHUIwUiWfy1k+g6Vtud7Fc49BO6d7knXhsrD0ElMXZ1kMbx5sFyfTCAIXVKesbgiVHH/iihChoRbsqrEKQjsbEyfsIVs18Un859VAE48YFhPJ/S3zPaJpJ7FsdynTTTVETlF/Gt4eUNJ/pouxyhTceTxLXiO6hG7g07yOsTzwjbhOf2x8Tg76+EjpXTCCzD6KX/JI/Yy41C1rPExCxBy+VF3y1qsFvgfWARcVVypb7s0Y++1LoE7OWy8ZWGiE1XuAp+qZSWCTFwRFfWOLdP638t+5DurAo4VXIPRQW4JOuDlRYnKKiBqoRnd9sUJHqAbscCF3zWfbytN1H+Lrj9iJ9AZP+q2ZWTggZn12PyR7xEaB1Rc1juypnJj7S MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a51d81cf-7627-44bc-0912-08d41dbb1cba X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2472;3:SIJTTs2N048ddUHkQXcLxj21EYDeIdSEMEjXK6b6X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3s9597pIecfAxRzrWyH7YrctZKH52Qj5ld1wUptUjrm8/YZU5EulClxDogzwgklJGXTmm1WrQsGhgoLykoN4QK4M35NT+FbwihBbQS053tIwbO/ygR7duk= X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2472;31:4oZ4nmX+kbQrSwHz1KByi3GY3ifsjLrq9OwlSoFv+ynlqZNURP3AmhENVCnG7mQqYgkJYaodey6tOriagpACdQMUnPqAN9hjkwFt8iPG8VI+ESuAooe4irztxwz4/CngX/NBFn2bj9/37ffJRpG22p7CoLhdzFEfu1CoJIMtIlpRosYDt06Rqex2W5RrGDGkhxjMaRfOUZzl7RKp54bIkPesj2PVprUO8O3nb4QCbsiHi2qZoVt4tMdliHrVZGHihbbCiiuGqxgtsCtViBM2bA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095060)(601004)(2401047)(13023025)(5005006)(8121501046)(13015025)(13017025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123556025)(20161123561025)(20161123563025)(20161123565025);SRVR:CY4PR03MB2472;BCL:0;PCL:0;RULEID:(400006);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2472;4:oXzeSbjvRZVMFr4n7DzAWAOKwr8kUuz8MgyhT5jHWGROQtAU2PfPV1A74vpweMMHiKco1Jr57J/MrOTGt8iJZ9GUKu7wasV50ihc2JLDKO1VFj+9Huu7SWj0hb/D/cdV1TY9h0RrMM6jyzx4vcmZekBhNQUGVaDOTC1P/KO04NfyZLb94sDpDbcP86WAaH/E3GGmwEms4dongYxEkwTGKgVyPEEWfsMOnrYCSI7doHy54mrZjTq9vdybfyogAvRhca3z+cdF1bImBL7Id/nVJ5nLPNaT/8u1g8oHW851eJEw78pUSuN+bCxvjApEya6T7WrNfmU2Z4D6RZXhFHRf9Lq9KxdBX+BGrTGlSLeYAAUa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9eCCJgEwdqPfH59dGFBDJibN76RcZh+nUCOQnU+bSMZ9UyUl0E1jMNMpmO8HR9YUC/G2bRGtHylIFyH3MN2VP3b461OyfYJ8EjjVuHf7q3MayBdZrlImm8Tha/xeTJQr668z/xJliOOKyRT8EYVyt/PWvkgY2soJu5fwFBd2+ZpAbZrkkU9K5Qdr7FQMPUjAxwM24CPSmBX5HNhyFErQXG1ymQUJJgeiHQfwnKUK5T3NfR5o2UPwpiyO9UgHRyoEICf4uzT1C7P2ycsTUZ/+AqRgEZ4LKKmfPDIaiiMDOuprmGjGRI4IQI5nd3vDmntdmCzYJJ082aJzp8g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 09:34:44.2254 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2472 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9890 Lines: 289 Add trace events in significant places of the data path. Useful for debuggging. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/Makefile | 3 + .../staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h | 185 ++++++++++++++++++++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 21 +++ drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 2 + 4 files changed, 211 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile b/drivers/staging/fsl-dpaa2/ethernet/Makefile index 4327ebe..77b0b74 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/Makefile +++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile @@ -5,3 +5,6 @@ obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o + +# Needed by the tracing framework +CFLAGS_dpaa2-eth.o := -I$(src) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h new file mode 100644 index 0000000..3b040e8 --- /dev/null +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h @@ -0,0 +1,185 @@ +/* Copyright 2014-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM dpaa2_eth + +#if !defined(_DPAA2_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) +#define _DPAA2_ETH_TRACE_H + +#include +#include +#include "dpaa2-eth.h" +#include + +#define TR_FMT "[%s] fd: addr=0x%llx, len=%u, off=%u" +/* trace_printk format for raw buffer event class */ +#define TR_BUF_FMT "[%s] vaddr=%p size=%zu dma_addr=%pad map_size=%zu bpid=%d" + +/* This is used to declare a class of events. + * individual events of this type will be defined below. + */ + +/* Store details about a frame descriptor */ +DECLARE_EVENT_CLASS(dpaa2_eth_fd, + /* Trace function prototype */ + TP_PROTO(struct net_device *netdev, + const struct dpaa2_fd *fd), + + /* Repeat argument list here */ + TP_ARGS(netdev, fd), + + /* A structure containing the relevant information we want + * to record. Declare name and type for each normal element, + * name, type and size for arrays. Use __string for variable + * length strings. + */ + TP_STRUCT__entry( + __field(u64, fd_addr) + __field(u32, fd_len) + __field(u16, fd_offset) + __string(name, netdev->name) + ), + + /* The function that assigns values to the above declared + * fields + */ + TP_fast_assign( + __entry->fd_addr = dpaa2_fd_get_addr(fd); + __entry->fd_len = dpaa2_fd_get_len(fd); + __entry->fd_offset = dpaa2_fd_get_offset(fd); + __assign_str(name, netdev->name); + ), + + /* This is what gets printed when the trace event is + * triggered. + */ + TP_printk(TR_FMT, + __get_str(name), + __entry->fd_addr, + __entry->fd_len, + __entry->fd_offset) +); + +/* Now declare events of the above type. Format is: + * DEFINE_EVENT(class, name, proto, args), with proto and args same as for class + */ + +/* Tx (egress) fd */ +DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_fd, + TP_PROTO(struct net_device *netdev, + const struct dpaa2_fd *fd), + + TP_ARGS(netdev, fd) +); + +/* Rx fd */ +DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd, + TP_PROTO(struct net_device *netdev, + const struct dpaa2_fd *fd), + + TP_ARGS(netdev, fd) +); + +/* Tx confirmation fd */ +DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_conf_fd, + TP_PROTO(struct net_device *netdev, + const struct dpaa2_fd *fd), + + TP_ARGS(netdev, fd) +); + +/* Log data about raw buffers. Useful for tracing DPBP content. */ +TRACE_EVENT(dpaa2_eth_buf_seed, + /* Trace function prototype */ + TP_PROTO(struct net_device *netdev, + /* virtual address and size */ + void *vaddr, + size_t size, + /* dma map address and size */ + dma_addr_t dma_addr, + size_t map_size, + /* buffer pool id, if relevant */ + u16 bpid), + + /* Repeat argument list here */ + TP_ARGS(netdev, vaddr, size, dma_addr, map_size, bpid), + + /* A structure containing the relevant information we want + * to record. Declare name and type for each normal element, + * name, type and size for arrays. Use __string for variable + * length strings. + */ + TP_STRUCT__entry( + __field(void *, vaddr) + __field(size_t, size) + __field(dma_addr_t, dma_addr) + __field(size_t, map_size) + __field(u16, bpid) + __string(name, netdev->name) + ), + + /* The function that assigns values to the above declared + * fields + */ + TP_fast_assign( + __entry->vaddr = vaddr; + __entry->size = size; + __entry->dma_addr = dma_addr; + __entry->map_size = map_size; + __entry->bpid = bpid; + __assign_str(name, netdev->name); + ), + + /* This is what gets printed when the trace event is + * triggered. + */ + TP_printk(TR_BUF_FMT, + __get_str(name), + __entry->vaddr, + __entry->size, + &__entry->dma_addr, + __entry->map_size, + __entry->bpid) +); + +/* If only one event of a certain type needs to be declared, use TRACE_EVENT(). + * The syntax is the same as for DECLARE_EVENT_CLASS(). + */ + +#endif /* _DPAA2_ETH_TRACE_H */ + +/* This must be outside ifdef _DPAA2_ETH_TRACE_H */ +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE dpaa2-eth-trace +#include diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index 9033b70..2daa90f 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -41,6 +41,12 @@ #include #include "dpaa2-eth.h" +/* CREATE_TRACE_POINTS only needs to be defined once. Other dpa files + * using trace events only need to #include + */ +#define CREATE_TRACE_POINTS +#include "dpaa2-eth-trace.h" + MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Freescale Semiconductor, Inc"); MODULE_DESCRIPTION("Freescale DPAA2 Ethernet Driver"); @@ -212,6 +218,9 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, struct dpaa2_fas *fas; u32 status = 0; + /* Tracing point */ + trace_dpaa2_rx_fd(priv->net_dev, fd); + dma_unmap_single(dev, addr, DPAA2_ETH_RX_BUF_SIZE, DMA_FROM_DEVICE); vaddr = phys_to_virt(addr); @@ -584,6 +593,9 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) goto err_build_fd; } + /* Tracing point */ + trace_dpaa2_tx_fd(net_dev, &fd); + /* TxConf FQ selection primarily based on cpu affinity; this is * non-migratable context, so it's safe to call smp_processor_id(). */ @@ -624,6 +636,9 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv, struct dpaa2_eth_drv_stats *percpu_extras; u32 status = 0; + /* Tracing point */ + trace_dpaa2_tx_conf_fd(priv->net_dev, fd); + percpu_extras = this_cpu_ptr(priv->percpu_extras); percpu_extras->tx_conf_frames++; percpu_extras->tx_conf_bytes += dpaa2_fd_get_len(fd); @@ -708,6 +723,12 @@ static int add_bufs(struct dpaa2_eth_priv *priv, u16 bpid) goto err_map; buf_array[i] = addr; + + /* tracing point */ + trace_dpaa2_eth_buf_seed(priv->net_dev, + buf, DPAA2_ETH_BUF_RAW_SIZE, + addr, DPAA2_ETH_RX_BUF_SIZE, + bpid); } release_bufs: diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h index c330927..1d23eb4 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h @@ -41,6 +41,8 @@ #include "dpni.h" #include "dpni-cmd.h" +#include "dpaa2-eth-trace.h" + #define DPAA2_ETH_STORE_SIZE 16 /* Maximum number of scatter-gather entries in an ingress frame, -- 1.7.3.4