Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f151ed04 authored by Skylar Chang's avatar Skylar Chang Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: adding ftrace to ipa



updated ipa driver with ftrace logging
to debug tput and performance issues

Change-Id: Iba052b71c5b1835c7130cbc7c2698212490c6639
Acked-by: default avatarSunil Paidimarri <hisunil@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent ac6766f8
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,9 @@
#include <linux/rndis_ipa.h>
#include <linux/rndis_ipa.h>
#include <linux/workqueue.h>
#include <linux/workqueue.h>


#define CREATE_TRACE_POINTS
#include "rndis_ipa_trace.h"

#define DRV_NAME "RNDIS_IPA"
#define DRV_NAME "RNDIS_IPA"
#define DEBUGFS_DIR_NAME "rndis_ipa"
#define DEBUGFS_DIR_NAME "rndis_ipa"
#define DEBUGFS_AGGR_DIR_NAME "rndis_ipa_aggregation"
#define DEBUGFS_AGGR_DIR_NAME "rndis_ipa_aggregation"
@@ -912,6 +915,7 @@ static netdev_tx_t rndis_ipa_start_xmit(struct sk_buff *skb,
	}
	}


	skb = rndis_encapsulate_skb(skb);
	skb = rndis_encapsulate_skb(skb);
	trace_rndis_tx_dp(skb->protocol);
	ret = ipa_tx_dp(IPA_TO_USB_CLIENT, skb, NULL);
	ret = ipa_tx_dp(IPA_TO_USB_CLIENT, skb, NULL);
	if (ret) {
	if (ret) {
		RNDIS_IPA_ERROR("ipa transmit failed (%d)\n", ret);
		RNDIS_IPA_ERROR("ipa transmit failed (%d)\n", ret);
@@ -957,6 +961,8 @@ static void rndis_ipa_tx_complete_notify(void *private,


	NULL_CHECK_NO_RETVAL(private);
	NULL_CHECK_NO_RETVAL(private);


	trace_rndis_status_rcvd(skb->protocol);

	RNDIS_IPA_DEBUG("Tx-complete, len=%d, skb->prot=%d, outstanding=%d\n",
	RNDIS_IPA_DEBUG("Tx-complete, len=%d, skb->prot=%d, outstanding=%d\n",
		skb->len, skb->protocol,
		skb->len, skb->protocol,
		atomic_read(&rndis_ipa_ctx->outstanding_pkts));
		atomic_read(&rndis_ipa_ctx->outstanding_pkts));
@@ -1121,6 +1127,7 @@ static void rndis_ipa_packet_receive_notify(void *private,
		return;
		return;
	}
	}


	trace_rndis_netif_ni(skb->protocol);
	result = netif_rx_ni(skb);
	result = netif_rx_ni(skb);
	if (result)
	if (result)
		RNDIS_IPA_ERROR("fail on netif_rx_ni\n");
		RNDIS_IPA_ERROR("fail on netif_rx_ni\n");
+81 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM rndis_ipa
#define TRACE_INCLUDE_FILE rndis_ipa_trace

#if !defined(_RNDIS_IPA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _RNDIS_IPA_TRACE_H

#include <linux/tracepoint.h>

TRACE_EVENT(
	rndis_netif_ni,

	TP_PROTO(unsigned long proto),

	TP_ARGS(proto),

	TP_STRUCT__entry(
		__field(unsigned long,	proto)
	),

	TP_fast_assign(
		__entry->proto = proto;
	),

	TP_printk("proto =%lu\n", __entry->proto)
);

TRACE_EVENT(
	rndis_tx_dp,

	TP_PROTO(unsigned long proto),

	TP_ARGS(proto),

	TP_STRUCT__entry(
		__field(unsigned long,	proto)
	),

	TP_fast_assign(
		__entry->proto = proto;
	),

	TP_printk("proto =%lu\n", __entry->proto)
);

TRACE_EVENT(
	rndis_status_rcvd,

	TP_PROTO(unsigned long proto),

	TP_ARGS(proto),

	TP_STRUCT__entry(
		__field(unsigned long,	proto)
	),

	TP_fast_assign(
		__entry->proto = proto;
	),

	TP_printk("proto =%lu\n", __entry->proto)
);

#endif /* _RNDIS_IPA_TRACE_H */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#include <trace/define_trace.h>
+3 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,9 @@
#include "ipa_i.h"
#include "ipa_i.h"
#include "ipa_rm_i.h"
#include "ipa_rm_i.h"


#define CREATE_TRACE_POINTS
#include "ipa_trace.h"

#define IPA_SUMMING_THRESHOLD (0x10)
#define IPA_SUMMING_THRESHOLD (0x10)
#define IPA_PIPE_MEM_START_OFST (0x0)
#define IPA_PIPE_MEM_START_OFST (0x0)
#define IPA_PIPE_MEM_SIZE (0x0)
#define IPA_PIPE_MEM_SIZE (0x0)
+5 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/list.h>
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/netdevice.h>
#include "ipa_i.h"
#include "ipa_i.h"
#include "ipa_trace.h"


#define IPA_LAST_DESC_CNT 0xFFFF
#define IPA_LAST_DESC_CNT 0xFFFF
#define POLLING_INACTIVITY_RX 40
#define POLLING_INACTIVITY_RX 40
@@ -931,6 +932,7 @@ static void ipa_sps_irq_rx_notify(struct sps_event_notify *notify)
			}
			}
			ipa_inc_acquire_wakelock();
			ipa_inc_acquire_wakelock();
			atomic_set(&sys->curr_polling_state, 1);
			atomic_set(&sys->curr_polling_state, 1);
			trace_intr_to_poll(sys->ep->client);
			queue_work(sys->wq, &sys->work);
			queue_work(sys->wq, &sys->work);
		}
		}
		break;
		break;
@@ -967,8 +969,10 @@ static void ipa_handle_rx(struct ipa_sys_context *sys)
		cnt = ipa_handle_rx_core(sys, true, true);
		cnt = ipa_handle_rx_core(sys, true, true);
		if (cnt == 0) {
		if (cnt == 0) {
			inactive_cycles++;
			inactive_cycles++;
			trace_idle_sleep_enter(sys->ep->client);
			usleep_range(POLLING_MIN_SLEEP_RX,
			usleep_range(POLLING_MIN_SLEEP_RX,
					POLLING_MAX_SLEEP_RX);
					POLLING_MAX_SLEEP_RX);
			trace_idle_sleep_exit(sys->ep->client);
		} else {
		} else {
			inactive_cycles = 0;
			inactive_cycles = 0;
		}
		}
@@ -982,6 +986,7 @@ static void ipa_handle_rx(struct ipa_sys_context *sys)


	} while (inactive_cycles <= POLLING_INACTIVITY_RX);
	} while (inactive_cycles <= POLLING_INACTIVITY_RX);


	trace_poll_to_intr(sys->ep->client);
	ipa_rx_switch_to_intr_mode(sys);
	ipa_rx_switch_to_intr_mode(sys);
	ipa_dec_client_disable_clks();
	ipa_dec_client_disable_clks();
}
}
+135 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM ipa
#define TRACE_INCLUDE_FILE ipa_trace

#if !defined(_IPA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _IPA_TRACE_H

#include <linux/tracepoint.h>

TRACE_EVENT(
	intr_to_poll,

	TP_PROTO(unsigned long client),

	TP_ARGS(client),

	TP_STRUCT__entry(
		__field(unsigned long,	client)
	),

	TP_fast_assign(
		__entry->client = client;
	),

	TP_printk("client=%lu", __entry->client)
);

TRACE_EVENT(
	poll_to_intr,

	TP_PROTO(unsigned long client),

	TP_ARGS(client),

	TP_STRUCT__entry(
		__field(unsigned long,	client)
	),

	TP_fast_assign(
		__entry->client = client;
	),

	TP_printk("client=%lu", __entry->client)
);

TRACE_EVENT(
	idle_sleep_enter,

	TP_PROTO(unsigned long client),

	TP_ARGS(client),

	TP_STRUCT__entry(
		__field(unsigned long,	client)
	),

	TP_fast_assign(
		__entry->client = client;
	),

	TP_printk("client=%lu", __entry->client)
);

TRACE_EVENT(
	idle_sleep_exit,

	TP_PROTO(unsigned long client),

	TP_ARGS(client),

	TP_STRUCT__entry(
		__field(unsigned long,	client)
	),

	TP_fast_assign(
		__entry->client = client;
	),

	TP_printk("client=%lu", __entry->client)
);

TRACE_EVENT(
	rmnet_ipa_netifni,

	TP_PROTO(unsigned long rx_pkt_cnt),

	TP_ARGS(rx_pkt_cnt),

	TP_STRUCT__entry(
		__field(unsigned long,	rx_pkt_cnt)
	),

	TP_fast_assign(
		__entry->rx_pkt_cnt = rx_pkt_cnt;
	),

	TP_printk("rx_pkt_cnt=%lu", __entry->rx_pkt_cnt)
);

TRACE_EVENT(
	rmnet_ipa_netifrx,

	TP_PROTO(unsigned long rx_pkt_cnt),

	TP_ARGS(rx_pkt_cnt),

	TP_STRUCT__entry(
		__field(unsigned long,	rx_pkt_cnt)
	),

	TP_fast_assign(
		__entry->rx_pkt_cnt = rx_pkt_cnt;
	),

	TP_printk("rx_pkt_cnt=%lu", __entry->rx_pkt_cnt)
);

#endif /* _IPA_TRACE_H */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#include <trace/define_trace.h>
Loading