Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760191AbbLCMwt (ORCPT ); Thu, 3 Dec 2015 07:52:49 -0500 Received: from mail-bl2on0111.outbound.protection.outlook.com ([65.55.169.111]:50842 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759716AbbLCMwl (ORCPT ); Thu, 3 Dec 2015 07:52:41 -0500 Authentication-Results: spf=permerror (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 v5 8/8] dpaa_eth: add trace points Date: Thu, 3 Dec 2015 15:49:49 +0200 Message-ID: <1449150589-26253-9-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1449150589-26253-1-git-send-email-madalin.bucur@freescale.com> References: <1449150589-26253-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD033;1:rStNxqxjkB2K356suEss+Id0jSRHHCsm9Ml9QC3Fh+C0Nqlw/RxGFzUDRwnqLXPocaJA6Dve6YuAAf+h1ZISirWkB3SeSEEr9V4mC8/HovvxFk3LpXl3VgmsTsfIyIIpzd2M8QhOBoss+n6cHhQZqUZh2Il7R3C9/jFM2gXWFhn7kdtTN9kspzAnopfdGd36/e54ytgaTZFo1A3WJ7zDcG4ZOxNe8wea6RUtWF14DddE1kVZ0H5pKfTKpHSGrZdSPD+8AUHMaKojGYbjYRg0Qd/pwI1YAQiJmtrxYFqluyEaP2wNnGVbjC2JrW/pg79+YtRn7EFPtjqvaUuWFA3wqfeHLhnxsNAfmL/6JMzBztrrc5PnWBupuQs2Y53M5xCq2ox7qn0domajFtXpWBwbQbBquQGaTxwkXbLoe19Gdvk= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(36756003)(50226001)(1096002)(43066003)(586003)(189998001)(50466002)(5001960100002)(107886002)(110136002)(2950100001)(97736004)(1220700001)(53806999)(48376002)(81156007)(77096005)(4001430100002)(5008740100001)(11100500001)(6806005)(104016004)(86362001)(47776003)(76176999)(19580405001)(19580395003)(50986999)(106466001)(229853001)(5003940100001)(33646002)(2351001)(87936001)(49486002)(85326001)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1964;H:tx30smr01.am.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1964;2:X1vMTl7u7g3I246rqrJsbsW5e4+tQQe6hKg/d74+c5V8J8HIer6oZMGZBZ3Xejg7m2Hqfca9NFRR1X2bre5ix5GeIAcdYtxgLNHJhP8umOVNFllFSwq6Y5XyeBNFgN5QbVctanc18ZkixDDktnUeVg==;3:mhC1jE1RTOsJ4s9qebD0uyktu71FWiGSsy4j7UYmlVx0ef439NT63qODHGWPXpA9KHeYQH4ZiCP3lLAK0kCbXJqUL7f/H/VKcYnh3cPwfxMUT4rRcDc0hWYyh9Y55xNAFGl4Hs1v7oPkr6jb8Kou2s1NBRFMHAcic6VMuilE34dKw4jykSu3xGY7iz4f+hTbodHCmH3F+nP5hAVIOGB57/SLQ6tg9xv0HxMEvi+gyp8=;25:tT6IdLcCzQoxEiIgYC3EnSULdoDKw6M5d69fc8Wz42cgBafEhxmobr++jlmI0x6TfmgR3ZpEzVCw51DnWhcnADzO+P4fD9mA6Wvuza77PL67t+iwaFtwfVwtlhlh+ep6tD7G6U2IbZUHER+Nvxswu34efn5dhFJuy13b3HqjGSy0Th1L1rV6kqpTBJ8kCHkmCt5hApTe57iWRy8oKs9+xghxOJU/Bxb0rImLtakLVPxNoFE4QdB7YYAnKWLjeYtIbJWhOh7ka7uXs2+o9VR5ig== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1964; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1964;20:809DmCKjhIzgAGzgtRxk7YvyC3QicBjsojTQj+pmh3uxvMY+FNp24wUknMolpt3Cca4DNOLIjFqlHBuIvTFrtPyOBG26RkAFu/U/fzGRHDCzbbsD+H0VyHnhNtdAV+d84sg1bFcgHlAD1kMF57Lekc4W/Vxhr42I5jtgl8SuzrnlaJy/pd31x79izf7jFsgy0juq1iYI/yFTLucebSRl3zr1dFuVEtEO2m1vFg2LMT9yxyNTDxgmc42YJiMwKE+8nYsLzNo6Vk5z+lAiqgP2P2c1W6se0UUl0owzEhiMa5xx7K7vRrJgQ2yrXgc1mQZuABsasd3sE94qikELLXUqSAUFxx+6VYrOgRAQWOkjUts=;4:wh2nzT0YRhrq6wbXh1k3ErOipjNU9i02mYmAqf8YWU3J9kQ8epNpO6g3niZ9d5pERz53zh4TOjUgjVmdoHFNMWOzQM7kv3s+Ba/Q2ZlACVci7L2DVWAIFncsUR0pxea5jnCXDcMmc0FG+JoPzHqa1jzYTaEA5V2UVNESQIvhFaxigaVa/p+TNk/KXIsSsxsUnwOU2W2oShD4Pk4LvUvP0TGai9TssdTX0ICQz8niZoQNd1m64Ak1IUr1P1rcPFwr/E9BlngV2wM4PBE1YW+CyKNSPNGN99lIdsdo/WpwGXWzNe9MzdqLXGXXMlBg2wugJV1AWpqz3Snw148KZAaqmlY87Z77PGqnb3wrjPAY6kebRlukq7Q2uda1EExW7aSnHnDp6qJyIR6K08+Fkmw51lQ3VqKMyN7xzmN/tCEvOCfWdranFrXUS/edLG0NW4ww X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046);SRVR:CY1PR0301MB1964;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1964; X-Forefront-PRVS: 077929D941 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1964;23:wuOiaHwCj1djd+2CtHcns8eTOBwmhBTDqDGAGBl?= =?us-ascii?Q?gqwd+kHuD0W0hSDfINaaWyG6gZVRH+6KXWJ72SyG5GhWCxxVnRc6S/plppG9?= =?us-ascii?Q?H+EPVFtWCo0H+tokb2bhTBQq9C19AV8pqHfNiaqFk44zjT5hJ+XUQr5vAerF?= =?us-ascii?Q?lO3oR2gQrC2T8XIEmJ6+fe5CPN3fNJBEr14zSIBcK/vCM/SpE8F9B34mDZdw?= =?us-ascii?Q?RhEcbWHENEnnE1O9BuJtDvEBoiFy+zDce3ZyVvzX9UmJJ264g/2Nmog4gGcS?= =?us-ascii?Q?dLgn2QUsGGBvFGv8FXPIt3YCai7EBDVZ5Q5CcxqRtKC18dBzQeJ50jRXyAsj?= =?us-ascii?Q?Qhz0x1qfOqcLlwJhnGNbBRcklnJrc/gUBN9jB4sWuIgPO91ymHd+YjSpfNKX?= =?us-ascii?Q?A67xS68b29CmlcLml9GwYgatSUlB4Q4lABCz9rUrBUJ6tYNFAeNMDOuS9scU?= =?us-ascii?Q?4G99lTkEQ0HVQ1I9ykQE4dP8NDUhwRBdx/xUEV9LcmghJNKwhdJaQnxUj7Iw?= =?us-ascii?Q?NCn2lmGW64wR6lGsOzTbWTYtFKaQnoJhqNNeAB6usd/YRIpCXl7rleHYtvUM?= =?us-ascii?Q?dPKyOffDFDXBi4/gcptaVtJfbLUjlCBxcgwGOzKWyjf7hkdjLKtzLl8kMolt?= =?us-ascii?Q?Dzwf+uSNoiJb+5SCaMEZ7E65qARX0MprXna3fsvUSpGHLmBciF7Nfi8ef/Ds?= =?us-ascii?Q?qugPRCcBaJQqz3aC6Cmby0tjFsULS3kZ3lEWaY9I41nRz+DEIaKYXAcaKOMb?= =?us-ascii?Q?zPUzE9/cAO3P98nPMzW/tbxQIzh7FWe3kPAA2sidP9EXZJu/hKbHVyMoOPZT?= =?us-ascii?Q?QFg7UsEywxNuW1Ib32L6ORvpJzYTXjtQrYtxk0bXbWei51dURj9iA9eyYe/0?= =?us-ascii?Q?kz3XdM/w5XzR6hGh9fMDg191oZv4NZ1pkhM+Xu+0saOFb4uCgn7UqAoH4Fh7?= =?us-ascii?Q?DzBFIT9JBj1chyULdoMLNnlaHYPsday/HmtHraogORik/it25sDKEaOTWfOH?= =?us-ascii?Q?SB/E052yD+umj9Ft9m++n51rNJxNBKPKuAClZrvHU/xs9F9MwQL+E0hEkOXA?= =?us-ascii?Q?Ms2jS6uTPxzj8aCmy5CL95bgWPqNMt+FYQ0PD/sNN1ouzgYck4fF8u85tJrQ?= =?us-ascii?Q?HIxr4y97NqNk=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1964;5:AVjW4WoC26g8DXLwwjIw9PfoVzcvdo86BZzgH5ZzcrI0yp2wIJvyLaZoaUKWyhDdDz/EXlT7j/qCHOd2scIZJObQ3ytReinqpESf3OnRiYColVW3w4GhfM+qJBsELMgHKNX1MxhXOg24HkW2S+OxtQ==;24:utY8Mp8PJyZ47u6j1bPgCF2rUF0PX6DBZUJcrUqpJNGxt23lxrIC/oc/NaF7Q4qg9U6D65Hp3b1snotmq1k976qbKJJmfHjqf7+mw9fdU6E= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 12:52:32.3518 (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: CY1PR0301MB1964 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8301 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 7d4d21a..76df948 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 @@ -219,6 +225,9 @@ static enum qman_cb_dqrr_result 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); + percpu_priv = this_cpu_ptr(priv->percpu_priv); count_ptr = this_cpu_ptr(dpa_bp->percpu_count); @@ -272,6 +281,9 @@ static enum qman_cb_dqrr_result conf_dflt_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); + percpu_priv = this_cpu_ptr(priv->percpu_priv); if (dpaa_eth_napi_schedule(percpu_priv, portal)) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h index 9651e24..81a2abc 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; @@ -392,6 +393,9 @@ static inline int dpa_xmit(struct dpa_priv *priv, if (fd->bpid == FSL_DPAA_BPID_INV) 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/