Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754495AbbKBQtY (ORCPT ); Mon, 2 Nov 2015 11:49:24 -0500 Received: from mail-bl2on0120.outbound.protection.outlook.com ([65.55.169.120]:11210 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754219AbbKBQtH (ORCPT ); Mon, 2 Nov 2015 11:49:07 -0500 X-Greylist: delayed 908 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Nov 2015 11:49:06 EST Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; From: Madalin Bucur To: CC: , , , , , , , , , , , Madalin Bucur , Ruxandra Ioana Radulescu Subject: [net-next v4 8/8] dpaa_eth: add trace points Date: Mon, 2 Nov 2015 19:31:40 +0200 Message-ID: <1446485500-9782-9-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> References: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD043;1:xDt7fEpPRhdb5Qeb3H2TJ+u5T4PFf2Gu5e1VGOWQJlIr5OAcVragNQdMa6Jwk27IuYHSBVpvnzmX0vRV/LIUpLAv9eGrbzL09/3XBk80IXLJHlBia9/8pEO94xMvnDtFnJBTS1LrQ0fwhAUogpud/ji7x0KYqaEa24y6vKJMg8vteQsjUA233AEhtkERRH9vKuW6B4VNeSLYklk2PE2428Ao02xnlbm41tO/HG23eKo6nG6oZszt92WhL4tlrbeRchleh5fVwrjlaQL9J8W1bGhzmhOQd8ru5ywMvxdQE3laHuIwwAEpcONK+tc9EH+uxVY5dmYjE7w3vOKT148TIzLGYpXpIS4iDDpk8PAbV+1GAIXo7T6DdBM1zgnTTFDrIo2L/R4CC5xpOM7Y7yplbg== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5001960100002)(49486002)(33646002)(86362001)(77096005)(19580405001)(2950100001)(87936001)(53806999)(76176999)(85426001)(19580395003)(50986999)(81156007)(48376002)(50226001)(2351001)(97736004)(50466002)(47776003)(229853001)(43066003)(4001430100002)(105606002)(106466001)(36756003)(11100500001)(5008740100001)(107886002)(5007970100001)(189998001)(5003940100001)(6806005)(110136002)(104016004)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1274;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1274;2:IU04Vu2uheZDerf29a4DkQvjyDJH22Pk+SeTGJ5wQW5wp5RvVWeNBrb4cO3yksawCJ3uL5CvCv+o72era3cE9DcruFuNf5cKsc1nI7J8EjwFmrVHJofCb1sXhGXqz0OPCt2WcTO/+oJzSY396C+hbGKtps1d0nYnZ0zVf56rqts=;3:gRGwgQ0sYtRjnBdlhnseShvJlSsvvnTsYLWosIyoiiwYgyaHFbENgcB7tMkg28aWtgtK8bUE1hucIxLQhYBlzAnUHAhD0Uo6XvWB+LFTrhT4FdkhUFlfJuEkGwTmSt4z15EDblmXXeNUow9b59iDo4gT5BImtjiIF2DqgXHeli89I7k8CN+PoZyIHSRit6KjlF5LhGkc1jxA9QyFgP6478Rt7qQtCwVMPFZNVvRG2wA=;25:4IRGGr+pgQikky/SEk5nENDOyzO4PglnycTUaqfA1k+EqBCCT2/nDFA0l2Lj85Ty6WceJBVEXxuUWRxgaAdHoOtPAIdz3jk8k3cxifN5H7DDC/S7p8MDeCf1qVMV6iOydjjKozqpLIJKkXscQS2a7J67YtgXZgiDAX4aUXulhI8jei171sFfslQZ3ZWqZdJ0YWKIik5XwQRaJMkL0wO+00GmR0Cc4y8BqwZZ0gNd89g7blFKYOR9kEvq/x9JS0CLSMUPzYWDnq5W9k3RUPE6yA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1274; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1274;20:nsEFx/GGPFRg4l7Y6v+WnXO8+Drt6N43uJteomg0JpBJkSOH+3yY6WTNHcSGVevQti0/xGfZXSf+4VLSXzlnQ+5pojPSWEohrxEKdtITO9ZoxWDL2G1RJaVDS9keZpgwDwEH3DwzuX4vkVTSo/23H0OyLVW57StZrj4zh00VX6z4StZd0ahui8d6sxjW0pmeR/Pbc9MpP8vDhaw+VlAwVSWHNEOoqvEcsoZLbn7EdnOtFVjVJx1r2jqK6E1A6awCNLcsTJE01K2Xh2qov8k70CUSTf1msbonJGSw//AeXUtce9Nx6u4U9M9JNonaS1t1/9ws/eu3vpJzFBFiqi+P8d0YUNF280co1+DPzoRm2nc=;4:PoHjGsogIU2w9VpL7+Tj+XKYe2H7Nxs+qaZaFcumETJXw/xdo1QHMq+f7DWOuNj5shw8na6YbCtiJqvtPn/xlBanA+8pYnikx2Scr0id73EJJK6jndmLTUgcKaCmFngCzQhDqk09WD71EfIeiJxERa5hE6CSz3W+yPsN01rpWu7Vd6/Lvwv6NXFehajR9yQFLeUXV9WgMWgRudFrCTcPFjZ3wiY/JpohejPuxDmXiWidRkMESt59p4RyM0+LsUrJDwnoshmpA53G83oaOuPr9yyQ9R+Th/Vpa0QrNtEV/aJOTcIM90unlsbQhG/r/TTl1kwMesdEoL9nGwQzTfGf5LD2thQmiX+l2vhLn9+Hy4UymhSus4uNAXF6vnijjJMn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(3002001)(10201501046);SRVR:CY1PR0301MB1274;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1274; X-Forefront-PRVS: 0748FF9A04 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1274;23:wVZo6WOaz3/QFTb30o9sKqng6dK+Vs0dEKehX+Q?= =?us-ascii?Q?OEgPNwSCAT1RoU0etlIBVmU0dCFVM5cjBsyAArZA6HkRnr3isgA8cKekCD3u?= =?us-ascii?Q?phY4ZruzDPTmevQOQQBfdej8xuBBFvOIAih7c2PHGELTRYYnMIH4vRqg71wE?= =?us-ascii?Q?Hpka/teTUgU3lM+99+FxA3EQnnN9AimLMvkF02WxTyzURpqk1Wn9W4Tf8eXR?= =?us-ascii?Q?R/ibBVCZ6edUjVe+EjmLy/bDIeXuDifN0QaEeLmMLEEvZUMy+ZyC38s4SmhX?= =?us-ascii?Q?NeUHnKB6YzZPpN7Rc6T5WNdH9t3ij52csvuoqGlwElvHgxFNwExglHRi3ur0?= =?us-ascii?Q?18vASSGCGZUo0Qh3r8envrSQlWCD/fyMqlC32uGJk77T1hxLzVtW4HLZIoM5?= =?us-ascii?Q?aYHVydOEDguak5HHjeEOCJL+IgcpDDPGZcio++5gLCy4bIaW6hplaaIfWX8L?= =?us-ascii?Q?NRJBiWILXk34DB05zeTBv/5g63wOY5VzVuc7I1x0QVqzMgjIPbZcpy9SNJmQ?= =?us-ascii?Q?kalp7RAuDcrb5ojUUFTBFziu25kryJtGgqp4T85zNHfBQ1ua7SmLNMdR4Cbp?= =?us-ascii?Q?uWln4QPCHaUfTe6jCoqtyilxWoWV8GTz5TMKSIjQ15jBaYH0GvZOvJd8vCS5?= =?us-ascii?Q?hy0cZVKT0wAPufhmGauHtDKHSJLWkbp1gwWIaOUdY7WLIVpTg2CZ0KW0dJwQ?= =?us-ascii?Q?qeEf90IVpc/GsqgepcUOKCdMR2g33/KZ9cEtMgM76aL7Mtd3/UMOGcRqjuLV?= =?us-ascii?Q?/kNPdc/S4tMv1Ojq007HDN4Hb3Lgap0KKjxE+M41/2bZuRM4yovvVWdu40ER?= =?us-ascii?Q?4jH3VmeK+5sTTJS2J8nCwDzkapEK6frRS+YVFmPx6TR2bWa6qq4PL9DqMQt3?= =?us-ascii?Q?k2byCv6gWuC7UVwPL5lGgAihEhSeadYtvgb1Cwo26rmaoaDx1IfW2JVopF+B?= =?us-ascii?Q?WQbpYzLTxBCHDYEVSEx9g9xTkWDpLXDOwUOPEa0WUZH43DIgcNWjOdsPoxiS?= =?us-ascii?Q?3bpg9yY6YbmNF5FtR+S/mGK00zT2diK5LU/2VLgs2thDMufbfu3iIhd2BLI8?= =?us-ascii?Q?XnrWr4ptufSdi8z2M2k16/0OtiuRh6m4NfHyyBaMPHNeMGiDgInmWNztG0VE?= =?us-ascii?Q?JS4T/YeXjeklrKjudDur7snuaiyJj+SnF?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1274;5:fLUk4Lq0P2L+feXVbGsciWOtJ0JMkLNJsyjo8ZJ0FiL0uLG7vrUZVlDp7plfCNpIvsGL/n33YDi+yRBC3E8WWXz24G+C620Jl51/9u2T8gZaowWZ2jQjGj42zZCf+wp9REpY+OeG8IpzcIys8ETrWg==;24:JdtW/QoOJu3BnaRvIzLroWf4J9CshtDio5HyLZKgzF7riVaorpGTSa3piGC8qjPc2SR/9Yu4fa+NyQBIIwmaiLvYo2tpRdYVTm5TZ4uUnGo=;20:mh2FOc3m30WyotdeQnFsUgcIBpCkMwt4AuVgjBcpfCaYCo3WaaIcoLBfZjYyL5clx4dBBNp2+41GgewbxMnKWA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2015 16:34:16.4640 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1274 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8308 Lines: 234 Add trace points on the hot processing path. Signed-off-by: Ruxandra Ioana Radulescu --- drivers/net/ethernet/freescale/dpaa/Makefile | 1 + drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 12 ++ drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 4 + .../net/ethernet/freescale/dpaa/dpaa_eth_trace.h | 141 +++++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h diff --git a/drivers/net/ethernet/freescale/dpaa/Makefile b/drivers/net/ethernet/freescale/dpaa/Makefile index 141ade4..15ed1c4 100644 --- a/drivers/net/ethernet/freescale/dpaa/Makefile +++ b/drivers/net/ethernet/freescale/dpaa/Makefile @@ -9,3 +9,4 @@ ccflags-y += -I$(FMAN) obj-$(CONFIG_FSL_DPAA_ETH) += fsl_dpa.o fsl_dpa-objs += dpaa_eth.o dpaa_eth_sg.o dpaa_eth_common.o dpaa_ethtool.o dpaa_eth_sysfs.o +CFLAGS_dpaa_eth.o := -I$(src) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 3cd03f5..b939d9d 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -57,6 +57,12 @@ #include "dpaa_eth.h" #include "dpaa_eth_common.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 "dpaa_eth_trace.h" + /* Valid checksum indication */ #define DPA_CSUM_VALID 0xFFFF @@ -229,6 +235,9 @@ priv_rx_default_dqrr(struct qman_portal *portal, priv = netdev_priv(net_dev); dpa_bp = priv->dpa_bp; + /* Trace the Rx fd */ + trace_dpa_rx_fd(net_dev, fq, &dq->fd); + /* IRQ handler, non-migratable; safe to use raw_cpu_ptr here */ percpu_priv = raw_cpu_ptr(priv->percpu_priv); count_ptr = raw_cpu_ptr(dpa_bp->percpu_count); @@ -285,6 +294,9 @@ priv_tx_conf_default_dqrr(struct qman_portal *portal, net_dev = ((struct dpa_fq *)fq)->net_dev; priv = netdev_priv(net_dev); + /* Trace the fd */ + trace_dpa_tx_conf_fd(net_dev, fq, &dq->fd); + /* Non-migratable context, safe to use raw_cpu_ptr */ percpu_priv = raw_cpu_ptr(priv->percpu_priv); diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h index cdc7595..7dee8de 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -36,6 +36,7 @@ #include "fman.h" #include "mac.h" +#include "dpaa_eth_trace.h" extern int dpa_rx_extra_headroom; extern int dpa_max_frm; @@ -407,6 +408,9 @@ static inline int dpa_xmit(struct dpa_priv_s *priv, if (fd->bpid == 0xff) fd->cmd |= qman_fq_fqid(priv->conf_fqs[queue]); + /* Trace this Tx fd */ + trace_dpa_tx_fd(priv->net_dev, egress_fq, fd); + for (i = 0; i < 100000; i++) { err = qman_enqueue(egress_fq, fd, 0); if (err != -EBUSY) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h new file mode 100644 index 0000000..3b67477 --- /dev/null +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h @@ -0,0 +1,141 @@ +/* Copyright 2013-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 dpaa_eth + +#if !defined(_DPAA_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) +#define _DPAA_ETH_TRACE_H + +#include +#include +#include "dpaa_eth.h" +#include + +#define fd_format_name(format) { qm_fd_##format, #format } +#define fd_format_list \ + fd_format_name(contig), \ + fd_format_name(sg) + +/* This is used to declare a class of events. + * individual events of this type will be defined below. + */ + +/* Store details about a frame descriptor and the FQ on which it was + * transmitted/received. + */ +DECLARE_EVENT_CLASS(dpaa_eth_fd, + /* Trace function prototype */ + TP_PROTO(struct net_device *netdev, + struct qman_fq *fq, + const struct qm_fd *fd), + + /* Repeat argument list here */ + TP_ARGS(netdev, fq, 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(u32, fqid) + __field(u64, fd_addr) + __field(u8, fd_format) + __field(u16, fd_offset) + __field(u32, fd_length) + __field(u32, fd_status) + __string(name, netdev->name) + ), + + /* The function that assigns values to the above declared fields */ + TP_fast_assign( + __entry->fqid = fq->fqid; + __entry->fd_addr = qm_fd_addr_get64(fd); + __entry->fd_format = fd->format; + __entry->fd_offset = dpa_fd_offset(fd); + __entry->fd_length = dpa_fd_length(fd); + __entry->fd_status = fd->status; + __assign_str(name, netdev->name); + ), + + /* This is what gets printed when the trace event is triggered */ + TP_printk("[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u, status=0x%08x", + __get_str(name), __entry->fqid, __entry->fd_addr, + __print_symbolic(__entry->fd_format, fd_format_list), + __entry->fd_offset, __entry->fd_length, __entry->fd_status) +); + +/* 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(dpaa_eth_fd, dpa_tx_fd, + + TP_PROTO(struct net_device *netdev, + struct qman_fq *fq, + const struct qm_fd *fd), + + TP_ARGS(netdev, fq, fd) +); + +/* Rx fd */ +DEFINE_EVENT(dpaa_eth_fd, dpa_rx_fd, + + TP_PROTO(struct net_device *netdev, + struct qman_fq *fq, + const struct qm_fd *fd), + + TP_ARGS(netdev, fq, fd) +); + +/* Tx confirmation fd */ +DEFINE_EVENT(dpaa_eth_fd, dpa_tx_conf_fd, + + TP_PROTO(struct net_device *netdev, + struct qman_fq *fq, + const struct qm_fd *fd), + + TP_ARGS(netdev, fq, fd) +); + +/* 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 /* _DPAA_ETH_TRACE_H */ + +/* This must be outside ifdef _DPAA_ETH_TRACE_H */ +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE dpaa_eth_trace +#include -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/