Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565AbbHEPoL (ORCPT ); Wed, 5 Aug 2015 11:44:11 -0400 Received: from mail-bn1bon0113.outbound.protection.outlook.com ([157.56.111.113]:19776 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753379AbbHEPn7 (ORCPT ); Wed, 5 Aug 2015 11:43:59 -0400 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; From: Madalin Bucur To: CC: , , , , , , , , , Madalin Bucur , Ruxandra Ioana Radulescu Subject: [v2 9/9] dpaa_eth: add trace points Date: Wed, 5 Aug 2015 18:41:29 +0300 Message-ID: <1438789289-16304-10-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> References: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD012;1:eANJZj3gcuWRroFUjq7qZ0qn63JJS0ikzucF2Ecf1TtqlZmvQMj6Jeo6wo3cRVxjqeriLYKAGrtoy+ChJlHibLTGvfsLK44hqg46ua9HohsFDx1vLDW0KDWecl6aj5a93/TkfAnCwzgfcNSK7oyYc5FpMXiknNsl4La1PHd49/bw8RJTdwdA8XGKlEbfhI8+K35C54ezo2rzulYxrlE77yCxlOyB/OJRjg7MxQyLrvHkq8GfKHXif8r+9k5/4DqMOVRMODNe94tzkYV47gClv9tpeQKeif77ANm3aqo6O+zJF7BZmpsHZHQgApZK1GZxNS+cP59uLQB5DM2SqRKBcA== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(48376002)(86362001)(50466002)(6806004)(62966003)(19580405001)(19580395003)(77156002)(87936001)(85426001)(50226001)(33646002)(104016003)(2351001)(229853001)(5001860100001)(5001830100001)(97736004)(81156007)(4001540100001)(110136002)(107886002)(5001960100002)(5003940100001)(189998001)(43066003)(47776003)(64706001)(2950100001)(77096005)(68736005)(46102003)(106466001)(105606002)(53806999)(76176999)(50986999)(36756003)(2004002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB505;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;BY2PR03MB505;2:X6vwzDgMWWRBbV3j8eB1SjLeiskYHLYXumpNd+jCtxMfTKEe+MJtx6miY4LlKcZkRsTL31mKtLqd00By9sQUORpxwkBNKOobnGH4hMIO/aEex4hpM+ZWc1SsK9l2noqVP+h+P18B77xSQ4fJmunU+P70YRHHGGn+HOGtb4J/lJ0=;3:sqmslcMbs2l+dLtNnGMp22O4nJp3nPg6MYg0RZ0kbnHW145Vbkc4q3H81T3c9CkqKiwRUfVQ2aPwve6Mg6t3Zi+v8e5IuBdPvWwkaDAOFFAZklQggElHPWNAkgMDPLfjjiiYVnm6DznGxoMRcGIZKgyOcM22XtsiWDYF2NYusU4pMuj91PY2iRmj4MbzU0FHx4iuVnkEFAccUSlOo8ZiComEH9ht4K1MlgIHPjIkLaw=;25:2r3xjPR7d1aUQz+ICuCk8mJ37dQjDV0B+4BWEZ/BhpJ+PWKo2JfrEJG38QKTURPw6x9lj9cY3A/K29Lp5ZIm6gL1/FvXI8Ou0iIgOB3Nzkb+ja9x7oaUKzMOuCvvSpJOOhevOM2NjAkfm2/6gNNRcrjhIW450MouAJU+Jum/NO3Q6Hmcgx0wwNUH8kzNk72TTK+VAL/WKEBMFD7wNzOkFwmhUHYOfod/K8sH9q0xRpFv8hCLkvncP3oz2V7xgnxIJBrnry50S1VCpp+Ok26CQg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB505; X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB505;20:E//CcscBWeTxQ1wOXnhV1d08hkGUs53h7R0Y/7s6oIEt5VekDB9FLM9TXqEqD2j5na5QtI5ESQgOF9I2EnToHAKSfutRUwWIu4QqvQGja5v6aUvVKBLb/H3bz0kuNUXOYQy0ZRT1VwdKhgjhO+Er7QT4NNIn4t6cW/g9W4aIzlhnHk7lg7zGe0rzJnjaIGxplGhcIHVqc+rphxnWWnl0vtg1TAnjk9Mj7svj9PBf8Z4S4mJ0edzUfeloUnla8zsD5+l1kWOOXoFfusK2GxRPXT3BIvypAyv//2Jk6OV5iNzfSQ6PvsY+ZM9RTo0kQeLH0UmSJMFTQhQfAxUuaOfK/EejBAGLLoYh0KMF4Jt6+WU=;4:WqwNObrbQNZisOLC55QWnpdcR+LRr5D+2FriV4KYKbfkaUIK1fltqbBBeZ++t6xnx42P7XZQrz4ZOr3DHSsc1+pqIHPh5N+seOBtroO88nS3W80IdKC1qf9VjaYoKqwxNI76/cAcsX38lE09g0svNdzKT0FIiTT86evoo+qiiN2jNveiJwM5iogYf5Oc2FJQ73qu52LkO9MYgbZe6D0fH1EN7mzLxr/Eab+2eUDucBh1eEGTELEHaGh73wixDgHYiVXzCn2+xavb/ve/wEgKSPiQ0IncL4PC/7HaukkViPI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY2PR03MB505;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB505; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR03MB505;23:pI8olysrD7PsLjwJgQSVTcALxv/IKH8yBIObs6ZhGi?= =?us-ascii?Q?HGOHbnknVcSpQWd2NJk61W4HB2+mnMoZj11njn/KppQ7WOekE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4grm4O6qsmvWg/U+Pi2OHUbE2l4x1uA8WhS7KB1q1G?= =?us-ascii?Q?48kesk9MFEAMGunbjtKsXO7Lm+04vS+d1YSNs3hfYop0lhIIZUy3ts9MjAq8?= =?us-ascii?Q?09ZntMshEGz3qh3YXObYW+lazCVnmjOVCB7DoQD2Yq6/bPPomF56iOJAV3kY?= =?us-ascii?Q?Wh/4q1QPeJc98sAOIM6xKSZHcfe3MOEwxiPdnM26jRkSQvmrOJlFiW6iN+fr?= =?us-ascii?Q?m0nW06sCvyZGo=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB505;5:jALUo6dkcMKj3HJuwcfyDDdgcviIrkw9JPyND5v7fMIiMD/vdE1DJpepQQ/EjKrwHyZt1Y+2OzHjZYlRgFWKHi+HSEP9qTu/8ZSIpvswAa6wxVlQJM++GevYJQ7jxoAn6KOj5JELod95+9AJcvVMZg==;24:pEJNEHKgvqHoIQTLJzWtOeat7M73+OigXaevFoq9j3iT3XXsYEYiEu4Z8d9uP3Ts3W/r26Ru/5z8xl3nlCv3D8UrVSKTbh17S76aOUyRm+g=;20:mNIWirvjzpKU+yyrrGKpARG1nVNyqtSHAKp95aOkaMbKCj4yVY8hc+BS8v/PtqI13v5rP2JaMPUtW0JcmLKoxw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 15:43:54.8924 (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: BY2PR03MB505 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8388 Lines: 237 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 3427de4..bf7248a 100644 --- a/drivers/net/ethernet/freescale/dpaa/Makefile +++ b/drivers/net/ethernet/freescale/dpaa/Makefile @@ -11,6 +11,7 @@ ccflags-y += -I$(FMAN)/flib 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) ifeq ($(CONFIG_FSL_DPAA_ETH_DEBUGFS),y) fsl_dpa-objs += dpaa_debugfs.o endif diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index ea25bf1..7f2413b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -61,6 +61,12 @@ #include "dpaa_debugfs.h" #endif /* CONFIG_FSL_DPAA_ETH_DEBUGFS */ +/* 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" + #define DPA_NAPI_WEIGHT 64 /* Valid checksum indication */ @@ -226,6 +232,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); @@ -282,6 +291,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 c66140e..4ac917a 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -36,6 +36,7 @@ #include "fm_ext.h" #include "mac.h" +#include "dpaa_eth_trace.h" extern int dpa_rx_extra_headroom; extern int dpa_max_frm; @@ -417,6 +418,9 @@ static inline int dpa_xmit(struct dpa_priv_s *priv, _dpa_get_tx_conf_queue(priv, egress_fq) ); + /* 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/