summaryrefslogtreecommitdiff
path: root/net/rmnet_data
diff options
context:
space:
mode:
authorHarout Hedeshian <harouth@codeaurora.org>2014-01-31 09:12:50 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:05:09 -0700
commitce9d8001da16f3fb74fb54efc2030b7d28ef12ad (patch)
treedc4724a5db324c4e45262a19a8ce5bfb3d00d725 /net/rmnet_data
parent3988539fdd553115f85bf21243904f4e6d2fcc4c (diff)
net: rmnet_data: Add support for ftrace events
Adding initial support for ftrace events in order to help with profiling and debugging. This initial set of events covers the ingress and egress handlers. Change-Id: I296d6fb9d009d8fdc2061e17d25e1275ee0a8a12 Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
Diffstat (limited to 'net/rmnet_data')
-rw-r--r--net/rmnet_data/Makefile2
-rw-r--r--net/rmnet_data/rmnet_data_handlers.c4
-rw-r--r--net/rmnet_data/rmnet_data_main.c4
-rw-r--r--net/rmnet_data/rmnet_data_trace.h80
-rw-r--r--net/rmnet_data/rmnet_data_vnd.c2
5 files changed, 92 insertions, 0 deletions
diff --git a/net/rmnet_data/Makefile b/net/rmnet_data/Makefile
index 6422e33fda03..ccb8b5b76d6c 100644
--- a/net/rmnet_data/Makefile
+++ b/net/rmnet_data/Makefile
@@ -10,3 +10,5 @@ rmnet_data-y += rmnet_map_data.o
rmnet_data-y += rmnet_map_command.o
rmnet_data-y += rmnet_data_stats.o
obj-$(CONFIG_RMNET_DATA) += rmnet_data.o
+
+CFLAGS_rmnet_data_main.o := -I$(src)
diff --git a/net/rmnet_data/rmnet_data_handlers.c b/net/rmnet_data/rmnet_data_handlers.c
index 480e551d1d9b..c284f62a7cba 100644
--- a/net/rmnet_data/rmnet_data_handlers.c
+++ b/net/rmnet_data/rmnet_data_handlers.c
@@ -23,6 +23,7 @@
#include "rmnet_data_vnd.h"
#include "rmnet_map.h"
#include "rmnet_data_stats.h"
+#include "rmnet_data_trace.h"
RMNET_LOG_MODULE(RMNET_DATA_LOGMASK_HANDLER);
@@ -171,6 +172,7 @@ static rx_handler_result_t rmnet_bridge_handler(struct sk_buff *skb,
static rx_handler_result_t __rmnet_deliver_skb(struct sk_buff *skb,
struct rmnet_logical_ep_conf_s *ep)
{
+ trace___rmnet_deliver_skb(skb);
switch (ep->rmnet_mode) {
case RMNET_EPMODE_NONE:
return RX_HANDLER_PASS;
@@ -404,6 +406,7 @@ rx_handler_result_t rmnet_ingress_handler(struct sk_buff *skb)
BUG();
dev = skb->dev;
+ trace_rmnet_ingress_handler(skb);
rmnet_print_packet(skb, dev->name, 'r');
config = (struct rmnet_phys_ep_conf_s *)
@@ -538,6 +541,7 @@ void rmnet_egress_handler(struct sk_buff *skb,
rmnet_vnd_tx_fixup(skb, orig_dev);
rmnet_print_packet(skb, skb->dev->name, 't');
+ trace_rmnet_egress_handler(skb);
rc = dev_queue_xmit(skb);
if (rc != 0) {
LOGD("Failed to queue packet for transmission on [%s]",
diff --git a/net/rmnet_data/rmnet_data_main.c b/net/rmnet_data/rmnet_data_main.c
index d17211434b39..d1754df94bf1 100644
--- a/net/rmnet_data/rmnet_data_main.c
+++ b/net/rmnet_data/rmnet_data_main.c
@@ -22,6 +22,10 @@
#include "rmnet_data_config.h"
#include "rmnet_data_vnd.h"
+/* ***************** Trace Points ******************************************* */
+#define CREATE_TRACE_POINTS
+#include "rmnet_data_trace.h"
+
/* ***************** Module Parameters ************************************** */
unsigned int rmnet_data_log_level = RMNET_LOG_LVL_ERR | RMNET_LOG_LVL_HI;
module_param(rmnet_data_log_level, uint, S_IRUGO | S_IWUSR);
diff --git a/net/rmnet_data/rmnet_data_trace.h b/net/rmnet_data/rmnet_data_trace.h
new file mode 100644
index 000000000000..98d071af4e4d
--- /dev/null
+++ b/net/rmnet_data/rmnet_data_trace.h
@@ -0,0 +1,80 @@
+/* Copyright (c) 2014, 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 rmnet_data
+#define TRACE_INCLUDE_FILE rmnet_data_trace
+
+#if !defined(_TRACE_MSM_LOW_POWER_H_) || defined(TRACE_HEADER_MULTI_READ)
+#define _RMNET_DATA_TRACE_H_
+
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(rmnet_handler_template,
+
+ TP_PROTO(struct sk_buff *skb),
+
+ TP_ARGS(skb),
+
+ TP_STRUCT__entry(
+ __field(void *, skbaddr)
+ __field(unsigned int, len)
+ __string(name, skb->dev->name)
+ ),
+
+ TP_fast_assign(
+ __entry->skbaddr = skb;
+ __entry->len = skb->len;
+ __assign_str(name, skb->dev->name);
+ ),
+
+ TP_printk("dev=%s skbaddr=%p len=%u",
+ __get_str(name), __entry->skbaddr, __entry->len)
+)
+
+DEFINE_EVENT(rmnet_handler_template, rmnet_egress_handler,
+
+ TP_PROTO(struct sk_buff *skb),
+
+ TP_ARGS(skb)
+);
+
+DEFINE_EVENT(rmnet_handler_template, rmnet_ingress_handler,
+
+ TP_PROTO(struct sk_buff *skb),
+
+ TP_ARGS(skb)
+);
+
+DEFINE_EVENT(rmnet_handler_template, rmnet_vnd_start_xmit,
+
+ TP_PROTO(struct sk_buff *skb),
+
+ TP_ARGS(skb)
+);
+
+DEFINE_EVENT(rmnet_handler_template, __rmnet_deliver_skb,
+
+ TP_PROTO(struct sk_buff *skb),
+
+ TP_ARGS(skb)
+);
+
+#endif /* _RMNET_DATA_TRACE_H_ */
+
+/* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#include <trace/define_trace.h>
+
diff --git a/net/rmnet_data/rmnet_data_vnd.c b/net/rmnet_data/rmnet_data_vnd.c
index e1e57a3845e1..03b2d6f7fdf7 100644
--- a/net/rmnet_data/rmnet_data_vnd.c
+++ b/net/rmnet_data/rmnet_data_vnd.c
@@ -29,6 +29,7 @@
#include "rmnet_map.h"
#include "rmnet_data_vnd.h"
#include "rmnet_data_stats.h"
+#include "rmnet_data_trace.h"
RMNET_LOG_MODULE(RMNET_DATA_LOGMASK_VND);
@@ -168,6 +169,7 @@ static netdev_tx_t rmnet_vnd_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct rmnet_vnd_private_s *dev_conf;
+ trace_rmnet_vnd_start_xmit(skb);
dev_conf = (struct rmnet_vnd_private_s *) netdev_priv(dev);
if (dev_conf->local_ep.egress_dev) {
/* QoS header should come after MAP header */