linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the ftrace tree with the nfsd tree
@ 2022-03-15  3:58 Stephen Rothwell
  2022-03-15 13:33 ` Chuck Lever III
  2022-03-16  3:09 ` Stephen Rothwell
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2022-03-15  3:58 UTC (permalink / raw)
  To: Steven Rostedt, Chuck Lever
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 9957 bytes --]

Hi all,

Today's linux-next merge of the ftrace tree got a conflict in:

  include/trace/trace_events.h

between commit:

  d07c9ad62247 ("tracing: Introduce helpers to safely handle dynamic-sized sockaddrs")

from the nfsd tree and commit:

  af6b9668e85f ("tracing: Move the defines to create TRACE_EVENTS into their own files")

from the ftrace tree.

Well, this is a pain :-(

I fixed it up (I used the latter version of this file and then added
the following merge fix patch) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 15 Mar 2022 14:47:18 +1100
Subject: [PATCH] fix up for "tracing: Move the defines to create TRACE_EVENTS into their own files"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/trace/stages/stage1_defines.h |  6 ++++++
 include/trace/stages/stage2_defines.h | 10 ++++++++--
 include/trace/stages/stage3_defines.h |  6 ++++++
 include/trace/stages/stage4_defines.h |  6 ++++++
 include/trace/stages/stage5_defines.h |  6 ++++++
 include/trace/stages/stage6_defines.h | 18 ++++++++++++++++++
 include/trace/stages/stage7_defines.h |  2 ++
 7 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/include/trace/stages/stage1_defines.h b/include/trace/stages/stage1_defines.h
index 8ab88c766d2b..a16783419687 100644
--- a/include/trace/stages/stage1_defines.h
+++ b/include/trace/stages/stage1_defines.h
@@ -29,6 +29,9 @@
 #undef __bitmask
 #define __bitmask(item, nr_bits) __dynamic_array(char, item, -1)
 
+#undef __sockaddr
+#define __sockaddr(field, len) __dynamic_array(u8, field, len)
+
 #undef __rel_dynamic_array
 #define __rel_dynamic_array(type, item, len) u32 __rel_loc_##item;
 
@@ -41,5 +44,8 @@
 #undef __rel_bitmask
 #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(char, item, -1)
 
+#undef __rel_sockaddr
+#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
+
 #undef TP_STRUCT__entry
 #define TP_STRUCT__entry(args...) args
diff --git a/include/trace/stages/stage2_defines.h b/include/trace/stages/stage2_defines.h
index 9f2341df40da..42fd1e8813ec 100644
--- a/include/trace/stages/stage2_defines.h
+++ b/include/trace/stages/stage2_defines.h
@@ -29,11 +29,14 @@
 #undef __string
 #define __string(item, src) __dynamic_array(char, item, -1)
 
+#undef __string_len
+#define __string_len(item, src, len) __dynamic_array(char, item, -1)
+
 #undef __bitmask
 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
 
-#undef __string_len
-#define __string_len(item, src, len) __dynamic_array(char, item, -1)
+#undef __sockaddr
+#define __sockaddr(field, len) __dynamic_array(u8, field, len)
 
 #undef __rel_dynamic_array
 #define __rel_dynamic_array(type, item, len)	u32 item;
@@ -46,3 +49,6 @@
 
 #undef __rel_bitmask
 #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
+
+#undef __rel_sockaddr
+#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
diff --git a/include/trace/stages/stage3_defines.h b/include/trace/stages/stage3_defines.h
index 0bc131993b7a..e3b183e9d18e 100644
--- a/include/trace/stages/stage3_defines.h
+++ b/include/trace/stages/stage3_defines.h
@@ -51,6 +51,12 @@
 		trace_print_bitmask_seq(p, __bitmask, __bitmask_size);	\
 	})
 
+#undef __get_sockaddr
+#define __get_sockaddr(field)	((struct sockaddr *)__get_dynamic_array(field))
+
+#undef __get_rel_sockaddr
+#define __get_rel_sockaddr(field)	((struct sockaddr *)__get_rel_dynamic_array(field))
+
 #undef __print_flags
 #define __print_flags(flag, delim, flag_array...)			\
 	({								\
diff --git a/include/trace/stages/stage4_defines.h b/include/trace/stages/stage4_defines.h
index 780a10fa5279..e80cdc397a43 100644
--- a/include/trace/stages/stage4_defines.h
+++ b/include/trace/stages/stage4_defines.h
@@ -41,6 +41,9 @@
 #undef __bitmask
 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
 
+#undef __sockaddr
+#define __sockaddr(field, len) __dynamic_array(u8, field, len)
+
 #undef __rel_dynamic_array
 #define __rel_dynamic_array(_type, _item, _len) {			\
 	.type = "__rel_loc " #_type "[]", .name = #_item,		\
@@ -55,3 +58,6 @@
 
 #undef __rel_bitmask
 #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
+
+#undef __rel_sockaddr
+#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
diff --git a/include/trace/stages/stage5_defines.h b/include/trace/stages/stage5_defines.h
index fb15394aae31..7ee5931300e6 100644
--- a/include/trace/stages/stage5_defines.h
+++ b/include/trace/stages/stage5_defines.h
@@ -81,3 +81,9 @@
 #undef __rel_bitmask
 #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item,	\
 					 __bitmask_size_in_longs(nr_bits))
+
+#undef __sockaddr
+#define __sockaddr(field, len) __dynamic_array(u8, field, len)
+
+#undef __rel_sockaddr
+#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
diff --git a/include/trace/stages/stage6_defines.h b/include/trace/stages/stage6_defines.h
index b3a1f26026be..2ac88e1a7677 100644
--- a/include/trace/stages/stage6_defines.h
+++ b/include/trace/stages/stage6_defines.h
@@ -45,6 +45,15 @@
 #define __assign_bitmask(dst, src, nr_bits)					\
 	memcpy(__get_bitmask(dst), (src), __bitmask_size_in_bytes(nr_bits))
 
+#undef __sockaddr
+#define __sockaddr(field, len) __dynamic_array(u8, field, len)
+
+#undef __get_sockaddr
+#define __get_sockaddr(field)	((struct sockaddr *)__get_dynamic_array(field))
+
+#define __assign_sockaddr(dest, src, len)					\
+	memcpy(__get_dynamic_array(dest), src, len)
+
 #undef __rel_dynamic_array
 #define __rel_dynamic_array(type, item, len)				\
 	__entry->__rel_loc_##item = __data_offsets.item;
@@ -76,6 +85,15 @@
 #define __assign_rel_bitmask(dst, src, nr_bits)					\
 	memcpy(__get_rel_bitmask(dst), (src), __bitmask_size_in_bytes(nr_bits))
 
+#undef __rel_sockaddr
+#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
+
+#undef __get_rel_sockaddr
+#define __get_rel_sockaddr(field)	((struct sockaddr *)__get_rel_dynamic_array(field))
+
+#define __assign_rel_sockaddr(dest, src, len)					\
+	memcpy(__get_rel_dynamic_array(dest), src, len)
+
 #undef TP_fast_assign
 #define TP_fast_assign(args...) args
 
diff --git a/include/trace/stages/stage7_defines.h b/include/trace/stages/stage7_defines.h
index d65445328f18..8a7ec24c246d 100644
--- a/include/trace/stages/stage7_defines.h
+++ b/include/trace/stages/stage7_defines.h
@@ -13,10 +13,12 @@
 #undef __get_dynamic_array_len
 #undef __get_str
 #undef __get_bitmask
+#undef __get_sockaddr
 #undef __get_rel_dynamic_array
 #undef __get_rel_dynamic_array_len
 #undef __get_rel_str
 #undef __get_rel_bitmask
+#undef __get_rel_sockaddr
 #undef __print_array
 #undef __print_hex_dump
 
-- 
2.34.1

However, my x86_64 allmodconfig build then failed like this:

In file included from include/trace/define_custom_trace.h:55,
                 from samples/trace_events/trace_custom_sched.h:95,
                 from samples/trace_events/trace_custom_sched.c:24:
samples/trace_events/./trace_custom_sched.h: In function 'ftrace_test_custom_probe_sched_switch':
include/trace/trace_custom_events.h:178:42: error: passing argument 1 of 'check_trace_callback_type_sched_switch' from incompatible pointer type [-Werror=incompatible-pointer-types]
  178 |         check_trace_callback_type_##call(trace_custom_event_raw_event_##template); \
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                          |
      |                                          void (*)(void *, bool,  struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)}
include/trace/trace_custom_events.h:34:9: note: in expansion of macro 'DEFINE_CUSTOM_EVENT'
   34 |         DEFINE_CUSTOM_EVENT(name, name, PARAMS(proto), PARAMS(args));
      |         ^~~~~~~~~~~~~~~~~~~
samples/trace_events/./trace_custom_sched.h:21:1: note: in expansion of macro 'TRACE_CUSTOM_EVENT'
   21 | TRACE_CUSTOM_EVENT(sched_switch,
      | ^~~~~~~~~~~~~~~~~~
In file included from include/linux/trace_events.h:11,
                 from samples/trace_events/trace_custom_sched.c:10:
include/linux/tracepoint.h:279:49: note: expected 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'} but argument is of type 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
  279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
      |                                          ~~~~~~~^~~~~~~~~~~~~~~
include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
  419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
      |         ^~~~~~~~~~~~~~~
include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
  553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
      |         ^~~~~~~~~~~~~
include/trace/events/sched.h:222:1: note: in expansion of macro 'TRACE_EVENT'
  222 | TRACE_EVENT(sched_switch,
      | ^~~~~~~~~~~

So I gave up and uses the ftrace tree from next-20220310 for today.

I am going to need some help with this mess, please.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the ftrace tree with the nfsd tree
  2022-03-15  3:58 linux-next: manual merge of the ftrace tree with the nfsd tree Stephen Rothwell
@ 2022-03-15 13:33 ` Chuck Lever III
  2022-03-15 14:15   ` Steven Rostedt
  2022-03-15 17:31   ` Steven Rostedt
  2022-03-16  3:09 ` Stephen Rothwell
  1 sibling, 2 replies; 6+ messages in thread
From: Chuck Lever III @ 2022-03-15 13:33 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Stephen Rothwell



> On Mar 14, 2022, at 11:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Hi all,
> 
> Today's linux-next merge of the ftrace tree got a conflict in:
> 
>  include/trace/trace_events.h
> 
> between commit:
> 
>  d07c9ad62247 ("tracing: Introduce helpers to safely handle dynamic-sized sockaddrs")
> 
> from the nfsd tree and commit:
> 
>  af6b9668e85f ("tracing: Move the defines to create TRACE_EVENTS into their own files")
> 
> from the ftrace tree.
> 
> Well, this is a pain :-(

Apologies. Steven, can you take the sockaddr patches in your tree
and resolve the x86_64 build issue?


> I fixed it up (I used the latter version of this file and then added
> the following merge fix patch) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 15 Mar 2022 14:47:18 +1100
> Subject: [PATCH] fix up for "tracing: Move the defines to create TRACE_EVENTS into their own files"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> include/trace/stages/stage1_defines.h |  6 ++++++
> include/trace/stages/stage2_defines.h | 10 ++++++++--
> include/trace/stages/stage3_defines.h |  6 ++++++
> include/trace/stages/stage4_defines.h |  6 ++++++
> include/trace/stages/stage5_defines.h |  6 ++++++
> include/trace/stages/stage6_defines.h | 18 ++++++++++++++++++
> include/trace/stages/stage7_defines.h |  2 ++
> 7 files changed, 52 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/stages/stage1_defines.h b/include/trace/stages/stage1_defines.h
> index 8ab88c766d2b..a16783419687 100644
> --- a/include/trace/stages/stage1_defines.h
> +++ b/include/trace/stages/stage1_defines.h
> @@ -29,6 +29,9 @@
> #undef __bitmask
> #define __bitmask(item, nr_bits) __dynamic_array(char, item, -1)
> 
> +#undef __sockaddr
> +#define __sockaddr(field, len) __dynamic_array(u8, field, len)
> +
> #undef __rel_dynamic_array
> #define __rel_dynamic_array(type, item, len) u32 __rel_loc_##item;
> 
> @@ -41,5 +44,8 @@
> #undef __rel_bitmask
> #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(char, item, -1)
> 
> +#undef __rel_sockaddr
> +#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
> +
> #undef TP_STRUCT__entry
> #define TP_STRUCT__entry(args...) args
> diff --git a/include/trace/stages/stage2_defines.h b/include/trace/stages/stage2_defines.h
> index 9f2341df40da..42fd1e8813ec 100644
> --- a/include/trace/stages/stage2_defines.h
> +++ b/include/trace/stages/stage2_defines.h
> @@ -29,11 +29,14 @@
> #undef __string
> #define __string(item, src) __dynamic_array(char, item, -1)
> 
> +#undef __string_len
> +#define __string_len(item, src, len) __dynamic_array(char, item, -1)
> +
> #undef __bitmask
> #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
> 
> -#undef __string_len
> -#define __string_len(item, src, len) __dynamic_array(char, item, -1)
> +#undef __sockaddr
> +#define __sockaddr(field, len) __dynamic_array(u8, field, len)
> 
> #undef __rel_dynamic_array
> #define __rel_dynamic_array(type, item, len)	u32 item;
> @@ -46,3 +49,6 @@
> 
> #undef __rel_bitmask
> #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
> +
> +#undef __rel_sockaddr
> +#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
> diff --git a/include/trace/stages/stage3_defines.h b/include/trace/stages/stage3_defines.h
> index 0bc131993b7a..e3b183e9d18e 100644
> --- a/include/trace/stages/stage3_defines.h
> +++ b/include/trace/stages/stage3_defines.h
> @@ -51,6 +51,12 @@
> 		trace_print_bitmask_seq(p, __bitmask, __bitmask_size);	\
> 	})
> 
> +#undef __get_sockaddr
> +#define __get_sockaddr(field)	((struct sockaddr *)__get_dynamic_array(field))
> +
> +#undef __get_rel_sockaddr
> +#define __get_rel_sockaddr(field)	((struct sockaddr *)__get_rel_dynamic_array(field))
> +
> #undef __print_flags
> #define __print_flags(flag, delim, flag_array...)			\
> 	({								\
> diff --git a/include/trace/stages/stage4_defines.h b/include/trace/stages/stage4_defines.h
> index 780a10fa5279..e80cdc397a43 100644
> --- a/include/trace/stages/stage4_defines.h
> +++ b/include/trace/stages/stage4_defines.h
> @@ -41,6 +41,9 @@
> #undef __bitmask
> #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
> 
> +#undef __sockaddr
> +#define __sockaddr(field, len) __dynamic_array(u8, field, len)
> +
> #undef __rel_dynamic_array
> #define __rel_dynamic_array(_type, _item, _len) {			\
> 	.type = "__rel_loc " #_type "[]", .name = #_item,		\
> @@ -55,3 +58,6 @@
> 
> #undef __rel_bitmask
> #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
> +
> +#undef __rel_sockaddr
> +#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
> diff --git a/include/trace/stages/stage5_defines.h b/include/trace/stages/stage5_defines.h
> index fb15394aae31..7ee5931300e6 100644
> --- a/include/trace/stages/stage5_defines.h
> +++ b/include/trace/stages/stage5_defines.h
> @@ -81,3 +81,9 @@
> #undef __rel_bitmask
> #define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item,	\
> 					 __bitmask_size_in_longs(nr_bits))
> +
> +#undef __sockaddr
> +#define __sockaddr(field, len) __dynamic_array(u8, field, len)
> +
> +#undef __rel_sockaddr
> +#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
> diff --git a/include/trace/stages/stage6_defines.h b/include/trace/stages/stage6_defines.h
> index b3a1f26026be..2ac88e1a7677 100644
> --- a/include/trace/stages/stage6_defines.h
> +++ b/include/trace/stages/stage6_defines.h
> @@ -45,6 +45,15 @@
> #define __assign_bitmask(dst, src, nr_bits)					\
> 	memcpy(__get_bitmask(dst), (src), __bitmask_size_in_bytes(nr_bits))
> 
> +#undef __sockaddr
> +#define __sockaddr(field, len) __dynamic_array(u8, field, len)
> +
> +#undef __get_sockaddr
> +#define __get_sockaddr(field)	((struct sockaddr *)__get_dynamic_array(field))
> +
> +#define __assign_sockaddr(dest, src, len)					\
> +	memcpy(__get_dynamic_array(dest), src, len)
> +
> #undef __rel_dynamic_array
> #define __rel_dynamic_array(type, item, len)				\
> 	__entry->__rel_loc_##item = __data_offsets.item;
> @@ -76,6 +85,15 @@
> #define __assign_rel_bitmask(dst, src, nr_bits)					\
> 	memcpy(__get_rel_bitmask(dst), (src), __bitmask_size_in_bytes(nr_bits))
> 
> +#undef __rel_sockaddr
> +#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
> +
> +#undef __get_rel_sockaddr
> +#define __get_rel_sockaddr(field)	((struct sockaddr *)__get_rel_dynamic_array(field))
> +
> +#define __assign_rel_sockaddr(dest, src, len)					\
> +	memcpy(__get_rel_dynamic_array(dest), src, len)
> +
> #undef TP_fast_assign
> #define TP_fast_assign(args...) args
> 
> diff --git a/include/trace/stages/stage7_defines.h b/include/trace/stages/stage7_defines.h
> index d65445328f18..8a7ec24c246d 100644
> --- a/include/trace/stages/stage7_defines.h
> +++ b/include/trace/stages/stage7_defines.h
> @@ -13,10 +13,12 @@
> #undef __get_dynamic_array_len
> #undef __get_str
> #undef __get_bitmask
> +#undef __get_sockaddr
> #undef __get_rel_dynamic_array
> #undef __get_rel_dynamic_array_len
> #undef __get_rel_str
> #undef __get_rel_bitmask
> +#undef __get_rel_sockaddr
> #undef __print_array
> #undef __print_hex_dump
> 
> -- 
> 2.34.1
> 
> However, my x86_64 allmodconfig build then failed like this:
> 
> In file included from include/trace/define_custom_trace.h:55,
>                 from samples/trace_events/trace_custom_sched.h:95,
>                 from samples/trace_events/trace_custom_sched.c:24:
> samples/trace_events/./trace_custom_sched.h: In function 'ftrace_test_custom_probe_sched_switch':
> include/trace/trace_custom_events.h:178:42: error: passing argument 1 of 'check_trace_callback_type_sched_switch' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  178 |         check_trace_callback_type_##call(trace_custom_event_raw_event_##template); \
>      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>      |                                          |
>      |                                          void (*)(void *, bool,  struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)}
> include/trace/trace_custom_events.h:34:9: note: in expansion of macro 'DEFINE_CUSTOM_EVENT'
>   34 |         DEFINE_CUSTOM_EVENT(name, name, PARAMS(proto), PARAMS(args));
>      |         ^~~~~~~~~~~~~~~~~~~
> samples/trace_events/./trace_custom_sched.h:21:1: note: in expansion of macro 'TRACE_CUSTOM_EVENT'
>   21 | TRACE_CUSTOM_EVENT(sched_switch,
>      | ^~~~~~~~~~~~~~~~~~
> In file included from include/linux/trace_events.h:11,
>                 from samples/trace_events/trace_custom_sched.c:10:
> include/linux/tracepoint.h:279:49: note: expected 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'} but argument is of type 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
>  279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
>      |                                          ~~~~~~~^~~~~~~~~~~~~~~
> include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
>  419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
>      |         ^~~~~~~~~~~~~~~
> include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
>  553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
>      |         ^~~~~~~~~~~~~
> include/trace/events/sched.h:222:1: note: in expansion of macro 'TRACE_EVENT'
>  222 | TRACE_EVENT(sched_switch,
>      | ^~~~~~~~~~~
> 
> So I gave up and uses the ftrace tree from next-20220310 for today.
> 
> I am going to need some help with this mess, please.
> -- 
> Cheers,
> Stephen Rothwell

--
Chuck Lever




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the ftrace tree with the nfsd tree
  2022-03-15 13:33 ` Chuck Lever III
@ 2022-03-15 14:15   ` Steven Rostedt
  2022-03-15 17:31   ` Steven Rostedt
  1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2022-03-15 14:15 UTC (permalink / raw)
  To: Chuck Lever III
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Stephen Rothwell

On Tue, 15 Mar 2022 13:33:30 +0000
Chuck Lever III <chuck.lever@oracle.com> wrote:

> >  af6b9668e85f ("tracing: Move the defines to create TRACE_EVENTS into their own files")
> > 
> > from the ftrace tree.
> > 
> > Well, this is a pain :-(  

Welcome to the include/trace directory ;-)

> 
> Apologies. Steven, can you take the sockaddr patches in your tree
> and resolve the x86_64 build issue?

My apologies, I forgot that there was changes in other trees that affect
this.

Anyway, I'll go and do a merge myself and see what happens. The point of
linux-next is to resolve these kinds of issues. I believe the reason you
took those changes was because you have a dependency on them, and I think
they should stay in your tree.

Let me do the merge myself and verify what Stephen did was correct or needs
to be updated. This will also need to be done for Linus as well.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the ftrace tree with the nfsd tree
  2022-03-15 13:33 ` Chuck Lever III
  2022-03-15 14:15   ` Steven Rostedt
@ 2022-03-15 17:31   ` Steven Rostedt
  2022-03-15 17:33     ` Chuck Lever III
  1 sibling, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2022-03-15 17:31 UTC (permalink / raw)
  To: Chuck Lever III
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Stephen Rothwell

On Tue, 15 Mar 2022 13:33:30 +0000
Chuck Lever III <chuck.lever@oracle.com> wrote:

> > On Mar 14, 2022, at 11:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > Hi all,
> > 
> > Today's linux-next merge of the ftrace tree got a conflict in:
> > 
> >  include/trace/trace_events.h
> > 
> > between commit:
> > 
> >  d07c9ad62247 ("tracing: Introduce helpers to safely handle dynamic-sized sockaddrs")
> > 
> > from the nfsd tree and commit:
> > 
> >  af6b9668e85f ("tracing: Move the defines to create TRACE_EVENTS into their own files")
> > 
> > from the ftrace tree.
> > 
> > Well, this is a pain :-(  
> 
> Apologies. Steven, can you take the sockaddr patches in your tree
> and resolve the x86_64 build issue?

Actually, the issue is not with your tree. It's a conflict with:

  fa2c3254d7cff ("sched/tracing: Don't re-read p->state when emitting sched_switch event")

Which changed the sched_switch event that my example was attaching to.

At least this proves that it will not compile if your custom event does not
match the prototype of the event that the custom event is modifying :-)


> > 
> > However, my x86_64 allmodconfig build then failed like this:
> > 
> > In file included from include/trace/define_custom_trace.h:55,
> >                 from samples/trace_events/trace_custom_sched.h:95,
> >                 from samples/trace_events/trace_custom_sched.c:24:
> > samples/trace_events/./trace_custom_sched.h: In function 'ftrace_test_custom_probe_sched_switch':
> > include/trace/trace_custom_events.h:178:42: error: passing argument 1 of 'check_trace_callback_type_sched_switch' from incompatible pointer type [-Werror=incompatible-pointer-types]
> >  178 |         check_trace_callback_type_##call(trace_custom_event_raw_event_##template); \
> >      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >      |                                          |
> >      |                                          void (*)(void *, bool,  struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)}
> > include/trace/trace_custom_events.h:34:9: note: in expansion of macro 'DEFINE_CUSTOM_EVENT'
> >   34 |         DEFINE_CUSTOM_EVENT(name, name, PARAMS(proto), PARAMS(args));
> >      |         ^~~~~~~~~~~~~~~~~~~
> > samples/trace_events/./trace_custom_sched.h:21:1: note: in expansion of macro 'TRACE_CUSTOM_EVENT'
> >   21 | TRACE_CUSTOM_EVENT(sched_switch,
> >      | ^~~~~~~~~~~~~~~~~~
> > In file included from include/linux/trace_events.h:11,
> >                 from samples/trace_events/trace_custom_sched.c:10:
> > include/linux/tracepoint.h:279:49: note: expected 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'} but argument is of type 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
> >  279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \


It's the type check code that failed. The above is complaining that it
expects:

 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct
 task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'}

But it found:

 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka
 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}


That's because the sched_switch event had the int prev_state added to it,
but my custom event was unaware of that.

Stephen, I pushed out a branch on my tree that merges my for-next branch
with next-20220315 and pushed it to:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git

branch: trace-merge-next-20220315

-- Steve




> >      |                                          ~~~~~~~^~~~~~~~~~~~~~~
> > include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
> >  419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
> >      |         ^~~~~~~~~~~~~~~
> > include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
> >  553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
> >      |         ^~~~~~~~~~~~~
> > include/trace/events/sched.h:222:1: note: in expansion of macro 'TRACE_EVENT'
> >  222 | TRACE_EVENT(sched_switch,
> >      | ^~~~~~~~~~~
> > 
> > So I gave up and uses the ftrace tree from next-20220310 for today.
> > 
> > I am going to need some help with this mess, please.
> > -- 
> > Cheers,
> > Stephen Rothwell  
> 
> --
> Chuck Lever
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the ftrace tree with the nfsd tree
  2022-03-15 17:31   ` Steven Rostedt
@ 2022-03-15 17:33     ` Chuck Lever III
  0 siblings, 0 replies; 6+ messages in thread
From: Chuck Lever III @ 2022-03-15 17:33 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Stephen Rothwell



> On Mar 15, 2022, at 1:31 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> On Tue, 15 Mar 2022 13:33:30 +0000
> Chuck Lever III <chuck.lever@oracle.com> wrote:
> 
>>> On Mar 14, 2022, at 11:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> 
>>> Hi all,
>>> 
>>> Today's linux-next merge of the ftrace tree got a conflict in:
>>> 
>>> include/trace/trace_events.h
>>> 
>>> between commit:
>>> 
>>> d07c9ad62247 ("tracing: Introduce helpers to safely handle dynamic-sized sockaddrs")
>>> 
>>> from the nfsd tree and commit:
>>> 
>>> af6b9668e85f ("tracing: Move the defines to create TRACE_EVENTS into their own files")
>>> 
>>> from the ftrace tree.
>>> 
>>> Well, this is a pain :-(  
>> 
>> Apologies. Steven, can you take the sockaddr patches in your tree
>> and resolve the x86_64 build issue?
> 
> Actually, the issue is not with your tree. It's a conflict with:
> 
>  fa2c3254d7cff ("sched/tracing: Don't re-read p->state when emitting sched_switch event")
> 
> Which changed the sched_switch event that my example was attaching to.

Thanks for troubleshooting!


> At least this proves that it will not compile if your custom event does not
> match the prototype of the event that the custom event is modifying :-)
> 
> 
>>> 
>>> However, my x86_64 allmodconfig build then failed like this:
>>> 
>>> In file included from include/trace/define_custom_trace.h:55,
>>>                from samples/trace_events/trace_custom_sched.h:95,
>>>                from samples/trace_events/trace_custom_sched.c:24:
>>> samples/trace_events/./trace_custom_sched.h: In function 'ftrace_test_custom_probe_sched_switch':
>>> include/trace/trace_custom_events.h:178:42: error: passing argument 1 of 'check_trace_callback_type_sched_switch' from incompatible pointer type [-Werror=incompatible-pointer-types]
>>> 178 |         check_trace_callback_type_##call(trace_custom_event_raw_event_##template); \
>>>     |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>     |                                          |
>>>     |                                          void (*)(void *, bool,  struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)}
>>> include/trace/trace_custom_events.h:34:9: note: in expansion of macro 'DEFINE_CUSTOM_EVENT'
>>>  34 |         DEFINE_CUSTOM_EVENT(name, name, PARAMS(proto), PARAMS(args));
>>>     |         ^~~~~~~~~~~~~~~~~~~
>>> samples/trace_events/./trace_custom_sched.h:21:1: note: in expansion of macro 'TRACE_CUSTOM_EVENT'
>>>  21 | TRACE_CUSTOM_EVENT(sched_switch,
>>>     | ^~~~~~~~~~~~~~~~~~
>>> In file included from include/linux/trace_events.h:11,
>>>                from samples/trace_events/trace_custom_sched.c:10:
>>> include/linux/tracepoint.h:279:49: note: expected 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'} but argument is of type 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
>>> 279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
> 
> 
> It's the type check code that failed. The above is complaining that it
> expects:
> 
> 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct
> task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'}
> 
> But it found:
> 
> 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka
> 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
> 
> 
> That's because the sched_switch event had the int prev_state added to it,
> but my custom event was unaware of that.
> 
> Stephen, I pushed out a branch on my tree that merges my for-next branch
> with next-20220315 and pushed it to:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> 
> branch: trace-merge-next-20220315
> 
> -- Steve
> 
> 
> 
> 
>>>     |                                          ~~~~~~~^~~~~~~~~~~~~~~
>>> include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
>>> 419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
>>>     |         ^~~~~~~~~~~~~~~
>>> include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
>>> 553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
>>>     |         ^~~~~~~~~~~~~
>>> include/trace/events/sched.h:222:1: note: in expansion of macro 'TRACE_EVENT'
>>> 222 | TRACE_EVENT(sched_switch,
>>>     | ^~~~~~~~~~~
>>> 
>>> So I gave up and uses the ftrace tree from next-20220310 for today.
>>> 
>>> I am going to need some help with this mess, please.
>>> -- 
>>> Cheers,
>>> Stephen Rothwell  
>> 
>> --
>> Chuck Lever

--
Chuck Lever




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the ftrace tree with the nfsd tree
  2022-03-15  3:58 linux-next: manual merge of the ftrace tree with the nfsd tree Stephen Rothwell
  2022-03-15 13:33 ` Chuck Lever III
@ 2022-03-16  3:09 ` Stephen Rothwell
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2022-03-16  3:09 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Chuck Lever, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3922 bytes --]

Hi Stephen,

On Tue, 15 Mar 2022 14:58:28 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> However, my x86_64 allmodconfig build then failed like this:
> 
> In file included from include/trace/define_custom_trace.h:55,
>                  from samples/trace_events/trace_custom_sched.h:95,
>                  from samples/trace_events/trace_custom_sched.c:24:
> samples/trace_events/./trace_custom_sched.h: In function 'ftrace_test_custom_probe_sched_switch':
> include/trace/trace_custom_events.h:178:42: error: passing argument 1 of 'check_trace_callback_type_sched_switch' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   178 |         check_trace_callback_type_##call(trace_custom_event_raw_event_##template); \
>       |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                          |
>       |                                          void (*)(void *, bool,  struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)}
> include/trace/trace_custom_events.h:34:9: note: in expansion of macro 'DEFINE_CUSTOM_EVENT'
>    34 |         DEFINE_CUSTOM_EVENT(name, name, PARAMS(proto), PARAMS(args));
>       |         ^~~~~~~~~~~~~~~~~~~
> samples/trace_events/./trace_custom_sched.h:21:1: note: in expansion of macro 'TRACE_CUSTOM_EVENT'
>    21 | TRACE_CUSTOM_EVENT(sched_switch,
>       | ^~~~~~~~~~~~~~~~~~
> In file included from include/linux/trace_events.h:11,
>                  from samples/trace_events/trace_custom_sched.c:10:
> include/linux/tracepoint.h:279:49: note: expected 'void (*)(void *, bool,  unsigned int,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  unsigned int,  struct task_struct *, struct task_struct *)'} but argument is of type 'void (*)(void *, bool,  struct task_struct *, struct task_struct *)' {aka 'void (*)(void *, _Bool,  struct task_struct *, struct task_struct *)'}
>   279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
>       |                                          ~~~~~~~^~~~~~~~~~~~~~~
> include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
>   419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
>       |         ^~~~~~~~~~~~~~~
> include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
>   553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
>       |         ^~~~~~~~~~~~~
> include/trace/events/sched.h:222:1: note: in expansion of macro 'TRACE_EVENT'
>   222 | TRACE_EVENT(sched_switch,
>       | ^~~~~~~~~~~
> 
> So I gave up and uses the ftrace tree from next-20220310 for today.
> 
> I am going to need some help with this mess, please.

Thanks for the example merge.  The extra merge resolution patch ended
up this:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 16 Mar 2022 14:01:59 +1100
Subject: [PATCH] fixup for "sched/tracing: Don't re-read p->state when emitting sched_switch event"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 samples/trace_events/trace_custom_sched.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/samples/trace_events/trace_custom_sched.h b/samples/trace_events/trace_custom_sched.h
index a3d14de6a2e5..9fdd8e7c2a45 100644
--- a/samples/trace_events/trace_custom_sched.h
+++ b/samples/trace_events/trace_custom_sched.h
@@ -25,10 +25,11 @@ TRACE_CUSTOM_EVENT(sched_switch,
 	 * that the custom event is using.
 	 */
 	TP_PROTO(bool preempt,
+		 unsigned int prev_state,
 		 struct task_struct *prev,
 		 struct task_struct *next),
 
-	TP_ARGS(preempt, prev, next),
+	TP_ARGS(preempt, prev_state, prev, next),
 
 	/*
 	 * The next fields are where the customization happens.
-- 
2.34.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-16  3:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  3:58 linux-next: manual merge of the ftrace tree with the nfsd tree Stephen Rothwell
2022-03-15 13:33 ` Chuck Lever III
2022-03-15 14:15   ` Steven Rostedt
2022-03-15 17:31   ` Steven Rostedt
2022-03-15 17:33     ` Chuck Lever III
2022-03-16  3:09 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).