Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965515AbbGVQS3 (ORCPT ); Wed, 22 Jul 2015 12:18:29 -0400 Received: from mail-bl2on0120.outbound.protection.outlook.com ([65.55.169.120]:20973 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965444AbbGVQSZ (ORCPT ); Wed, 22 Jul 2015 12:18:25 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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: [PATCH 10/10] dpaa_eth: add trace points Date: Wed, 22 Jul 2015 19:16:46 +0300 Message-ID: <1437581806-17420-10-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1437581806-17420-9-git-send-email-madalin.bucur@freescale.com> References: <1437581806-17420-1-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-3-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-4-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-5-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-6-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-7-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-8-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-9-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD001;1:NQ5VcGwcayIlIkQrrtAscTMyNn93f0P9aGKbWi2hnnRJkRgtCHnAe1tFjnJ1KL/IleamJVtx07DYrnMKZ+e6+4yYGgHNrBpOaXYxAjR5g2JlWu9rt4FZ/P34aNbJ7fwRTDEgx3xo6XHouMzYxpFnAR2ko4VXnV8u9tl1Z+jKkY5ETfUhtyuttGDLRdkANAYrSR49nb6FwQ2ofgs/0D2gfqyovAeumYKwVDURwcldAjzAHhDa89eyUiTZVp46PfWwd1k2bcSmK9dkyCBgxXxWhOW7UITwlXq4m1aW1v1TtYFeKyHijSofUJ+EqV73gU4dFvzOr7vsTBOveLqwekV9ww== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(77156002)(229853001)(47776003)(85426001)(49486002)(62966003)(46102003)(106466001)(48376002)(19580395003)(19580405001)(93886004)(105606002)(33646002)(104016003)(2351001)(50466002)(36756003)(189998001)(43066003)(5003940100001)(53806999)(50986999)(5001960100002)(6806004)(107886002)(110136002)(76176999)(2950100001)(77096005)(86362001)(50226001)(87936001)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1473;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1473;2:WQKD0lpjeSbItJ/Eidd8CRFhmptca2s4mqEJewg6UK4qEVOmjKbKYqBtR7cgxcsN;3:DlLHllgXshbLMdczAcwjQrB3eaaVprrdNT3GW8eweS3TcvnOPGQrblMlm5u+mnRcyZ7m9kmOS0T6L+hjjbDlpEINLqxT+846WWywYwEnqjmUXGHEtyV1FzZGUTPn8+06Jd5c6cEPj1dNj9NtN5HI62DoXfu48M/sT/rO8xCUpuO6s5HJI33I5Y2uWnRp1QaJiGvgAVvdQyxjugAy2RfhfL+s6fwprpW2GHsWmBo4e34=;25:wd+OlCTNmhXtR1BxoPG8ngcHXG0tq6jgUzkv32z7VZREFq99Iw4N6Y8QOrKrlKiK+gUReKTKXMmwt3z68nrPdH7FgpV1I834euIgwcvapL/dCXhocf1YcW2mV0k6Zlcy85EXmrE6Ua+vbZIfw9e/mnED8h3b4X8QcEptZ/+tVfRuP+gVoBv2OIfunVpoLj4ZEs2KE9leWDqX/KMzEI4che/H4t/S3JFWpb2kFqcZPN1rso14Bt451Zoz9j75ksse58XCJsXTALBPaVADWKOUkg==;20:fCzYrpTKM6NI74qx92S75Gj9AXBxX3eVgCjuEhxaewaQcY0QgPWrw38sFsyV4vMFk8VeZ8jHiLKhEep4bFnqiyPAivse0rPI4uJpWd44N8qEFoI0Ay60CACDTppStqxqnhMX3ATIhHthWSVCYdUx//Hg6tkt2hdWQnKVEHuAbSRNQX+8RIB3bdeVW5WK228jiENoxTnzF60nLpsoNzIyRKv2EPxKU2VghzTu+OpQVGgkBT5L1Bx2xUPYFloMzgb8NdccuFLv7AyP0ggIm9kjciyT1tFwjMbKyumawoCDgspoAH59f4i0G3KIu/OA7mecR2XKQm+Qli3ZDbYL8uIcRuP7J5yiKRbfmccBU4M2igs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1473; BLUPR03MB1473: X-MS-Exchange-Organization-RulesExecuted 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:BLUPR03MB1473;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1473; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1473;4:qd4CdeRyk8RCFF9Yk+cbzFeWIWZQ3GLGw6ircObvoArsIoUB4EhrdOV400sBrGsj0R2MUT2ICdlfeaGwyEp7wYf2rkawn6+Aoh8yReCKw8fDKrRKHJdS8fvj3bkhWHR5FMmYs7ucE9P8CzzbeUbtIoS2lYpV15YSlLzUTuZYQ+06aoOcEjmikw1KAzu2Z6v6J1mgV0cHOfAywWa40ZFanFzkSsk1ilSLdEcEiVcx8A8D7ujmSXJuRCvz7RZbxwFhXU9kdPLCLT7+Y4Wa3pgKmhF02oh41u9iEn2U0dSQmqI= X-Forefront-PRVS: 0645BEB7AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB1473;23:17SzZhWaN87o1p66tl8/F60uyB7j+S2/ziSkA30UJ?= =?us-ascii?Q?GOfYWfxubASlPdXCirygxcx51X/mOfbywRxh5D2M9iT9se4SS6qPY7V8jKzW?= =?us-ascii?Q?sQneRx5Kg+ePV5MtxCJO8jpFYIzDE3SIe1ls4mAkzKbx3cp4Usa9oXgVHqGo?= =?us-ascii?Q?GcqTEIp/LWs9ztb2hUvCaCS/or3EQpXq/tG/+52kmbpmyOp+1EVNDYyViSkf?= =?us-ascii?Q?dCWFROPqAaxkRRXwq4gxyQJxpnwYeuJW8AmebWiJFEDBRy8iPXl712Ockgdr?= =?us-ascii?Q?pG8D9DilHmh3kkQ8llSVFnckdce9h79p8ACyYtJiV0GKDbjEHxxoDu3WNT4d?= =?us-ascii?Q?UTAUGXg3YShIN0QMLN4zaTV4YNaUIakW7i9mi6h/2mKyTxoUxBJk68LJS26d?= =?us-ascii?Q?t3CwAjy32L7ukhOT06P+W5jG9VU0x9oAODJH6d7L/nBimiuWtLtVil/r5dW4?= =?us-ascii?Q?S41mHVbZ0xLyNw5BJSyoA1iynbU9QLcCg6F+Zrs1F8Ek7JrSv/vOiNgf7XMV?= =?us-ascii?Q?OPQGx+HSMQ4IFIlizyO+us4Rbyp7qiDW3Z9svYFWM/P8ObYkUgOf05s4qeW7?= =?us-ascii?Q?6R0haqn9ydEcG7v/oMLzoPhjKKKhiIBrUmcFzU38vuiZ6IWeiE73z2MhEb+O?= =?us-ascii?Q?2hl1WnkfRETMBEVTHZMZbwRRzBEOKtlvy45+ZhHa3Hro7D+CT+7t/CDwta1w?= =?us-ascii?Q?7bak62JREpciVEvJsJJ324vG2Gc7YeGegSspuA4FDpkAfxoNhxkknimH7YnQ?= =?us-ascii?Q?YfxllaR0b7c49qxa8jDfde5gIZicm4KJsSZIAHUrFgVwPwF6lkQQLF7Y93Kt?= =?us-ascii?Q?2VSCIDZIpb1auzXxxptdr0DSzZiMX5qR3Q1wXyNU1yw8n3dFdZCKZOcqmbv8?= =?us-ascii?Q?2gqnZSpylVR91gvY35hFHLSJSIErjRNqi79fNsd0sM2X2BrWRXhxSdFNY0fR?= =?us-ascii?Q?6myTQPj+Tocr7jTuvRMK6HwkxiiQfvX+y6MJNvHo1JwUx/C/f1Ucvhxctarc?= =?us-ascii?Q?pihNdRPnEp/Dk+zKyHrwUgilTVVprsv3vlk7qS5P8JOtg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1473;5:lYl6njFkPYOp6M3SiIT0MBoecRJgHzm/NLNTfCSFqS6j9V1muAb7eWKE/43ed9Z0y+/4W9MdI/ztpzfDR2aHZ8dNTgrxUmeUXo7LFs5MuVe8GXWSY6aMQQHhirxdAvJkhEWRaqktrQaNhfQ6EP1pOQ==;24:nG+VWRPINZXg3kTloiUBJlHu3rdnK9yl/obijjEDmi80BbXZMwrhD8r+eMYfF7s5An5OJ/JZIfdRhS/herdQgaFTde2tiGVlYlNopYyQWzc=;20:HFV0o5AQnV6KkiEti7eM9pzho7kcqPqBQkjzl3IXaZ1KiU80Ggsg29gEe8eEj+1P14YBMDaH1PcBxN5tIYt1fg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2015 16:18:23.0532 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1473 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8396 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 59c8edc..f88e636 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 18dadf6..29ee23a 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; @@ -424,6 +425,9 @@ static inline int __hot 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/