Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760057AbbLCLMB (ORCPT ); Thu, 3 Dec 2015 06:12:01 -0500 Received: from mail-bl2on0062.outbound.protection.outlook.com ([65.55.169.62]:47328 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759018AbbLCLLy (ORCPT ); Thu, 3 Dec 2015 06:11:54 -0500 Authentication-Results: spf=none (sender IP is 192.88.168.50) smtp.helo=tx30smr01.am.freescale.net; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=; From: <> To: CC: , , , , , , , , , , Madalin Bucur , Ruxandra Ioana Radulescu Subject: [net-next v5 8/8] dpaa_eth: add trace points Date: Thu, 3 Dec 2015 14:09:06 +0200 Message-ID: <1449144546-25438-9-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1449144546-25438-1-git-send-email-madalin.bucur@freescale.com> References: <1449144546-25438-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Matching-Connectors: 130936147118022154;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD018;1:veVUR+PRkYO84l3IOO5EoyTuhouWhj1pACeWBqS557xGB0OhN7RRODyXdDGul9z/Tm3atLHf0tX1+aFF3lNDhDPGS52t167Z5ZTfD0CBfht/zy2mdO16tQxMnCtgqIVMW8Qm1jWJoi6yzM6qGdZb2T4dZsa3IgNR4wrpmX2UdCJA73kyNDHjscj2ou8w7x+iHlU3pFrFDpQtgfpwat+X+g6M8ZnbtJkGG8qgfweaJ6VL9FtqEGM0MUmhg7uziEsyiSnUp/g9R/sFxOrMzMJ+GWZ9k/g3l+W+PXjpRbddEZcVF+DFTQgtuSMIf1QpNdG1uN0wqeox0ZQduTtR3yOzqzVQ4cMcMu7ieMkMoyRi2/xZP3nmH4B1coXVZewXJJNsYCr4cjfu9Hvyxk3Il8JU4EvFRSuFUEKvTulD7j2InubZRpgOb6UBLvi+cay3Ve0M7HTD97MO6HnVgvVzsAcEJc3NwYx1D4iA+uIZPYU+xWc= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2970300002)(428002)(189002)(199003)(47776003)(6806005)(11100500001)(33646002)(87936001)(49486002)(960300001)(50986999)(5008740100001)(1096002)(2950100001)(48376002)(4001430100002)(50466002)(1220700001)(77096005)(104016004)(586003)(2351001)(229853001)(81156007)(97736004)(110136002)(19580395003)(19580405001)(36756003)(107886002)(189998001)(78992003)(5001960100002)(105586002)(5003940100001)(106466001)(5005630100001)(43066003)(76176999)(53806999)(101416001)(50226001)(60522002)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0301MB2116;H:tx30smr01.am.freescale.net;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:0;A:0;LANG:; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2116;2:tyj8B29/4FqV7DgIs1yyQoOaweRa9M9p/xeVU3xk13E4f23asPPRPFSeMx6Nk06vvOkdQoq8D0P/PEYlihSrFvVupg8WO9S1VheDpIBK10t3kJVcxLauRcIcC6nVokcNdeodj/f9+wTq5Ni0kWzctg==;3:IvdfdWxIhH43sjFNlIDktTKpanRDF+53GhDDGfraBEs4GekIQYTh67gQbvJhEUAsqZrpYPukQ02BSKFmM3nY4dbf3zSBDXBh1+6g8JheNmw52CqrgrzIZ9xKWkwG08UptVviYwcclPSt2fOgqVR6z/39HWIo1ziPzVjH8V7UjB5ZSIlsczn+8ReLyYNTQXFyGO3c7S1NXatzTxAWkq3aX2Q4MhKRXfzcIAaVaau+rVQ=;25:6UinMZO8/LHMnLMoRNnFehkr048W4jMsGKB9yus72bQLWgSu5Acy5xnnpaYuzPxiqknTEAWst5Z6H1b8v0X205sHHqcTPFWLhUEOUmC16lXifcc2S0b1HRmLRK5mq+CtA0aQLecHn6cEeRuabuD0yGl6kwOB9zWzmJ4PTa+fWlmW05xOF5CBbuGyR6wsLdkxNh7XBLgZEk9QHLR2rrhSJRnIahSDkNNOmHeyV/+6IcIUkMwOWjQWA5olv83ois1E4NUsW5t/2dd4X+Rvwol9cA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2116; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:BLUPR0301MB2116;BCL:0;PCL:0;RULEID:(400006);SRVR:BLUPR0301MB2116; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2116;4:GDQGKbS40+oQ8unBtlbk81dh45OirqgLmo4FPhUzAsSYqgbrscEKBxSCPfxYjTepBFpS0vdf/jy6/4M4FDhIPMs+oKD48PS7EnTis1roWdWr04RMaJ0hpGZ9nx8kRgOtPHIiwwWT+upduxU2mAw4Wty55bW8WXd4izeSxTPQ5mEAZ5FjdnGOQqBX8sZJt4nsr+fMLdkrrvrrRb+g/Whf1Pvrrnzbhs87FGHFDmVdjbDxNdbwjRLwzUNcg9yKPq/vaxSDsH5b59xqqWddwCTPcnJ1d6mOydW2PcgusgnDvMfeDXm7hJExdB9FvbCxkxy20o6bSj/s61d3tr9SU/VH9EAZmq/KTpeMc7aE3XS8jwH05vL9jGR2/5vzPs6iwalVM3HuU7ZSziIEnx6FYLf3vmzF9K3TTf6bFMfcvsSuZkva1+3fEETbPOvW51Zh6cGS X-Forefront-PRVS: 077929D941 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0301MB2116;23:U+CcsNeBqU7p2F24gxLXRAncXPpLw7QRUTjFPnx?= =?us-ascii?Q?11qXQaMT0qvXW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ogaonx9N?= =?us-ascii?Q?mFGnyx7RRKNb9GsNR7frcuxkjkskmYXzj4JoSA6eaO2brtSxoon7y7yCIKQP?= =?us-ascii?Q?1dzaSy76LtB7w/OwFZw2Oo9Tlx6syeP/0AFgaWrY94FRg/98g1WkMAisoZEP?= =?us-ascii?Q?x2MiNAZEUnOHsc0yUq2sU2nMqIWnDsOocBFo6kY07BCLI16cqU5LgG947Zn+?= =?us-ascii?Q?cllE5ytwOZYH67k0vGnyF5SJugLvkIBjR7AvQ+hnQXsHJ/H0/zEuzOjAs07i?= =?us-ascii?Q?c35D7yOEMR+fyH+XeB3Jdj9VNVniubhV3Gh1w?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2116;5:+ll0kL25xPk7iN8cfgcT9UoxyGtElhAzNFD7gQT7zoBEbj9GISU+fmh66LUjWI2vFvKZJDw8ISOk/6I70TG+QiObEcwSiBleUAIvV2/bJMTu0QiJDM/oZCpGMg99v2Vk7xIMsIDL5E5vHGhbhkzjjCVliA7CqvN+fGwWW+Fzxdw=;24:6gN4emwNyYjC4X/0wgXFrjk+EK6/ATOC8OfvLc+6hMIMcHbnPANUhWE5x4v0LGBeIfA9LabfRAyKLhlDrEfFVBNZOPaM+AdPj9vjiFlk+no= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 11:11:46.9193 (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: BLUPR0301MB2116 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8352 Lines: 236 From: Madalin Bucur 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/