Skip to contentSkip to conversation

mac80211: Move message tracepoints to their own header

PATCH In review Steven Rostedt 3 participants 12 messages Apr 7, 2015 – Apr 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Move message tracepoints to their own header

Every tracing file must have its own TRACE_SYSTEM defined. The mac80211 tracepoint header broke this and add in the middle of the file had:

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mac80211_msg

Unfortunately, this broke new code in the ftrace infrastructure. Moving the mac80211_msg into its own trace file with its own TRACE_SYSTEM defined fixes the issue.

---
 net/mac80211/trace.c     |  1 +
 net/mac80211/trace.h     | 38 ----------------------------------
 net/mac80211/trace_msg.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 38 deletions(-)
 create mode 100644 net/mac80211/trace_msg.h
net/mac80211/trace.c +1 -0
index 386e45d8a958..edfe0c170a1c 100644
@@ -8,6 +8,7 @@
 #include "debug.h"
 #define CREATE_TRACE_POINTS
 #include "trace.h"
+#include "trace_msg.h"
 
 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
 void __sdata_info(const char *fmt, ...)
net/mac80211/trace.h +0 -38
index 263a9561eb26..755a5388dbca 100644
@@ -2312,44 +2312,6 @@ TRACE_EVENT(drv_tdls_recv_channel_switch,
 	)
 );
 
-#ifdef CONFIG_MAC80211_MESSAGE_TRACING
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM mac80211_msg
-
-#define MAX_MSG_LEN	100
-
-DECLARE_EVENT_CLASS(mac80211_msg_event,
-	TP_PROTO(struct va_format *vaf),
-
-	TP_ARGS(vaf),
-
-	TP_STRUCT__entry(
-		__dynamic_array(char, msg, MAX_MSG_LEN)
-	),
-
-	TP_fast_assign(
-		WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
-				       MAX_MSG_LEN, vaf->fmt,
-				       *vaf->va) >= MAX_MSG_LEN);
-	),
-
-	TP_printk("%s", __get_str(msg))
-);
-
-DEFINE_EVENT(mac80211_msg_event, mac80211_info,
-	TP_PROTO(struct va_format *vaf),
-	TP_ARGS(vaf)
-);
-DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
-	TP_PROTO(struct va_format *vaf),
-	TP_ARGS(vaf)
-);
-DEFINE_EVENT(mac80211_msg_event, mac80211_err,
-	TP_PROTO(struct va_format *vaf),
-	TP_ARGS(vaf)
-);
-#endif
-
 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
 
 #undef TRACE_INCLUDE_PATH
net/mac80211/trace_msg.h new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined.

Oh, that requirement is new to me. I also have the same in iwlwifi, with even more TRACE_SYSTEMs.

Quoted 6 lines

The mac80211 tracepoint header broke this and add in the middle of the file had:

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mac80211_msg

Quoted 8 lines

Unfortunately, this broke new code in the ftrace infrastructure. Moving the mac80211_msg into its own trace file with its own TRACE_SYSTEM defined fixes the issue.

Looks fine to me.

I could merge through my tree but I guess you'll want to put it through a different one to be able to change the code that depends on this move.

johannes

#2 lore raw
Quoted 5 lines · On Tue, 07 Apr 2015 08:58:58 +0200 Johannes Berg <[email protected]>…
Quoted 1 line · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined.

Oh, that requirement is new to me. I also have the same in iwlwifi, with even more TRACE_SYSTEMs.

Well, it's new now :-) I never expected people to use more than one
TRACE_SYSTEM in a single file, so I never documented that it shouldn't be done.

I'm more worried about people using the same TRACE_SYSTEM in different files, which will probably break now too.

I should update the comments about that.

Hmm, I must have missed the iwlwifi part, as that should have not built with an allmodconfig :-/

Quoted 13 lines
Quoted 10 lines

The mac80211 tracepoint header broke this and add in the middle of the file had:

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mac80211_msg

Unfortunately, this broke new code in the ftrace infrastructure. Moving the mac80211_msg into its own trace file with its own TRACE_SYSTEM defined fixes the issue.

Quoted 6 lines
Quoted 2 lines

Looks fine to me.

Thanks!

Quoted 4 lines

I could merge through my tree but I guess you'll want to put it through a different one to be able to change the code that depends on this move.

Right, I'll need to pull this in my tree, as I have a set of patches dependent on this.

-- Steve

maintainer
#3 lore raw
Quoted 2 lines · Steven Rostedt

Hmm, I must have missed the iwlwifi part, as that should have not built with an allmodconfig :-/

Dunno, it seems that should be selected with allmodconfig, and it has 5 different ones ... :)

Quoted 5 lines
Quoted 2 lines

I could merge through my tree but I guess you'll want to put it through a different one to be able to change the code that depends on this move.

Right, I'll need to pull this in my tree, as I have a set of patches dependent on this.

Makes sense.

johannes

#4 lore raw
In reply to Johannes Berg
Quoted 5 lines · On Tue, 07 Apr 2015 08:58:58 +0200 Johannes Berg <[email protected]>…
Quoted 1 line · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined.

Oh, that requirement is new to me. I also have the same in iwlwifi, with even more TRACE_SYSTEMs.

OK, the reason I did not stumble over this is because the previous patch broke the build before I got here.

During my latest tests, this breaks it too.

You OK if I make more patches to split that file apart?

Thanks,

-- Steve

maintainer
#5 lore raw
Quoted 9 lines · Steven Rostedt
Quoted 5 lines · On Tue, 07 Apr 2015 08:58:58 +0200 Johannes Berg <[email protected]>…
Quoted 1 line · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined.

Oh, that requirement is new to me. I also have the same in iwlwifi, with even more TRACE_SYSTEMs.

Quoted 6 lines

OK, the reason I did not stumble over this is because the previous patch broke the build before I got here.

During my latest tests, this breaks it too.

You OK if I make more patches to split that file apart?

Sure, no problem. I don't think we have any work on them that could possibly conflict now.

johannes

#6 lore raw

PATCH 1/1 iwlwifi: Move each system tracepoints to their own header

In reply to Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined. The iwlwifi tracepoint header broke this and added in the middle of the file:

#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi_io

#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi_ucode

#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi_msg

#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi_data

#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi

Unfortunately, this broke new code in the ftrace infrastructure. Moving each of these TRACE_SYSTEMs into their own trace file with just one TRACE_SYSTEM per file fixes the issue.

---

Johannes, can you ack this one too.

Thanks,

-- Steve

 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h   |  79 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h     | 155 ++++++++
 .../net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h    | 200 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h    |  97 +++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h  |  81 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace.h        | 438 +--------------------
 6 files changed, 618 insertions(+), 432 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
drivers/net/wireless/iwlwifi/iwl-devtrace-data.h new file +79 -0
new file mode 100644
index 000000000000..04e6649340b8
@@ -0,0 +1,79 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * The full GNU General Public License is included in this distribution in the
+ * file called LICENSE.
+ *
+ * Contact Information:
+ *  Intel Linux Wireless <[email protected]>
+ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+ *
+ *****************************************************************************/
+
+#if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
+#define __IWLWIFI_DEVICE_TRACE_DATA
+
+#include <linux/tracepoint.h>
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM iwlwifi_data
+
+TRACE_EVENT(iwlwifi_dev_tx_data,
+	TP_PROTO(const struct device *dev,
+		 struct sk_buff *skb,
+		 void *data, size_t data_len),
+	TP_ARGS(dev, skb, data, data_len),
+	TP_STRUCT__entry(
+		DEV_ENTRY
+
+		__dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
+	),
+	TP_fast_assign(
+		DEV_ASSIGN;
+		if (iwl_trace_data(skb))
+			memcpy(__get_dynamic_array(data), data, data_len);
+	),
+	TP_printk("[%s] TX frame data", __get_str(dev))
+);
+
+TRACE_EVENT(iwlwifi_dev_rx_data,
+	TP_PROTO(const struct device *dev,
+		 const struct iwl_trans *trans,
+		 void *rxbuf, size_t len),
+	TP_ARGS(dev, trans, rxbuf, len),
+	TP_STRUCT__entry(
+		DEV_ENTRY
+
+		__dynamic_array(u8, data,
+				len - iwl_rx_trace_len(trans, rxbuf, len))
+	),
+	TP_fast_assign(
+		size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
+		DEV_ASSIGN;
+		if (offs < len)
+			memcpy(__get_dynamic_array(data),
+			       ((u8 *)rxbuf) + offs, len - offs);
+	),
+	TP_printk("[%s] RX frame data", __get_str(dev))
+);
+#endif /* __IWLWIFI_DEVICE_TRACE_DATA */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE iwl-devtrace-data
+#include <trace/define_trace.h>
drivers/net/wireless/iwlwifi/iwl-devtrace-io.h new file +155 -0

155 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h new file +200 -0

200 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h new file +97 -0

97 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h new file +81 -0

81 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-devtrace.h +6 -432

449 lines not on this page · raw message

Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v1 1/1
#7 lore raw

Re: [PATCH] iwlwifi: Move each system tracepoints to their own header

Quoted 3 lines · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined. The iwlwifi tracepoint header broke this and added in the middle of the file:

[...]

Quoted 8 lines

Unfortunately, this broke new code in the ftrace infrastructure. Moving each of these TRACE_SYSTEMs into their own trace file with just one TRACE_SYSTEM per file fixes the issue.

Quoted 12 lines
 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h   |  79 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h     | 155 ++++++++
 .../net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h    | 200 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h    |  97 +++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h  |  81 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace.h        | 438 +--------------------
 6 files changed, 618 insertions(+), 432 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h

Looks good to me.

johannes

#8 lore raw

Re: [PATCH] iwlwifi: Move each system tracepoints to their own header

Quoted 26 lines · Johannes Berg
Quoted 3 lines · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined. The iwlwifi tracepoint header broke this and added in the middle of the file:

[...]

Quoted 8 lines

Unfortunately, this broke new code in the ftrace infrastructure. Moving each of these TRACE_SYSTEMs into their own trace file with just one TRACE_SYSTEM per file fixes the issue.

Quoted 12 lines
 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h   |  79 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h     | 155 ++++++++
 .../net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h    | 200 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h    |  97 +++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h  |  81 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace.h        | 438 +--------------------
 6 files changed, 618 insertions(+), 432 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
Quoted 4 lines

Looks good to me.

I had to make quite a few modifications since this patch was not based on iwlwifi-next, but I picked it up in our internal tree.

#9 lore raw

Re: [PATCH] iwlwifi: Move each system tracepoints to their own header

Quoted 28 lines · Emmanuel Grumbach
Quoted 26 lines · Johannes Berg
Quoted 3 lines · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined. The iwlwifi tracepoint header broke this and added in the middle of the file:

[...]

Quoted 20 lines

Unfortunately, this broke new code in the ftrace infrastructure. Moving each of these TRACE_SYSTEMs into their own trace file with just one TRACE_SYSTEM per file fixes the issue.

 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h   |  79 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h     | 155 ++++++++
 .../net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h    | 200 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h    |  97 +++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h  |  81 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace.h        | 438 +--------------------
 6 files changed, 618 insertions(+), 432 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
Quoted 7 lines
Quoted 4 lines

Looks good to me.

I had to make quite a few modifications since this patch was not based on iwlwifi-next, but I picked it up in our internal tree.

Wait - you seemed to want to apply that on your tree because of dependencies (which I can understand). So how do you suggest to proceed?
You can apply your original version of the patch on your tree, but then it'll collapse when it'll meet iwlwifi-next.git.
I can try to have the modified version of the patch into 4.1 but I doubt I'll make it. If I do make it, it'd allow you to work on top of 4.1 whenever that'll be ready? What is your timeline?

Or maybe you can pull iwlwifi-next (which would be odd I have to say)? What do you suggest?
FWIW - I am talking about:

commit 7e1223b50089ab5901215d2fd8c61b42c7cfe034

Author: Emmanuel Grumbach <[email protected]>
Date:   Tue Feb 3 20:11:48 2015 +0200

iwlwifi: mvm: new Alive / error table API

The new API slightly changes the layout of the version of the firmware - prepare for that.

#10 lore raw

Re: [PATCH] iwlwifi: Move each system tracepoints to their own header

it's me again.

Quoted 37 lines · Emmanuel Grumbach
Quoted 28 lines · Emmanuel Grumbach
Quoted 26 lines · Johannes Berg
Quoted 3 lines · Steven Rostedt

Every tracing file must have its own TRACE_SYSTEM defined. The iwlwifi tracepoint header broke this and added in the middle of the file:

[...]

Quoted 20 lines

Unfortunately, this broke new code in the ftrace infrastructure. Moving each of these TRACE_SYSTEMs into their own trace file with just one TRACE_SYSTEM per file fixes the issue.

 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h   |  79 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h     | 155 ++++++++
 .../net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h    | 200 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h    |  97 +++++
 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h  |  81 ++++
 drivers/net/wireless/iwlwifi/iwl-devtrace.h        | 438 +--------------------
 6 files changed, 618 insertions(+), 432 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-data.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-io.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h
Quoted 7 lines
Quoted 4 lines

Looks good to me.

I had to make quite a few modifications since this patch was not based on iwlwifi-next, but I picked it up in our internal tree.

Quoted 9 lines

Wait - you seemed to want to apply that on your tree because of dependencies (which I can understand). So how do you suggest to proceed?
You can apply your original version of the patch on your tree, but then it'll collapse when it'll meet iwlwifi-next.git.
I can try to have the modified version of the patch into 4.1 but I doubt I'll make it. If I do make it, it'd allow you to work on top of 4.1 whenever that'll be ready? What is your timeline?

I overthought it. Stephen fixed the conflict correctly.

Quoted 14 lines

Or maybe you can pull iwlwifi-next (which would be odd I have to say)? What do you suggest?
FWIW - I am talking about:

commit 7e1223b50089ab5901215d2fd8c61b42c7cfe034

Author: Emmanuel Grumbach <[email protected]>
Date:   Tue Feb 3 20:11:48 2015 +0200

iwlwifi: mvm: new Alive / error table API

The new API slightly changes the layout of the version of the firmware - prepare for that.

#11 lore raw

Re: [PATCH] iwlwifi: Move each system tracepoints to their own header

Quoted 2 lines · On Mon, 13 Apr 2015 11:17:17 +0300 Emmanuel Grumbach <[email protected]>…

I overthought it. Stephen fixed the conflict correctly.

Good, because I needed that change in my tree as other patches depended on it.

Linus should be able to figure this out. I'll have to write up a bit for him when I do my pull request, as my own branches have minor conflicts.

Linus doesn't mind conflicts, but if you are aware of them, and already did the merge fix, he likes to know about it, and pointers to the conflict resolution is helpful, as he can compare what he did to what we did.

I'll make note of the merge conflict resolution commit that Stephen did in my pull request.

-- Steve