All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Tobias Regnery <tobias.regnery@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: fix tracepoint related build error
Date: Mon, 9 Apr 2018 13:01:53 +0300	[thread overview]
Message-ID: <20180409100153.GA10141@kuha.fi.intel.com> (raw)
In-Reply-To: <20180409075517.15362-1-tobias.regnery@gmail.com>

On Mon, Apr 09, 2018 at 09:55:17AM +0200, Tobias Regnery wrote:
> The ucsi driver defines several tracepoints, but the header file with the
> tracepoint definition trace.h is only conditionally built depending on
> CONFIG_FTRACE.

You mean trace.c, right? The definitions are indeed in the header,
trace.h, so I'm a bit confused what is actually the problem?

> This leads to the following build error with CONFIG_FTRACE=n and
> CONFIG_TYPEC_UCSI=m:

That alone should not cause any problems.

> ERROR: "__tracepoint_ucsi_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_register_port" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_notify" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_reset_ppm" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_run_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_ack" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_connector_change" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> 
> With CONFIG_TYPEC_UCSI=y the build fails with several link errors.
> 
> Fix this by changing the Makefile to unconditionally build trace.o.
> Tracepints are a runtime contruct and no other user of tracepoints depends
> on CONFIG_FTRACE.
> 
> Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
> Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
> ---
>  drivers/usb/typec/ucsi/Makefile | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/Makefile b/drivers/usb/typec/ucsi/Makefile
> index b57891c1fd31..971befbbc2a8 100644
> --- a/drivers/usb/typec/ucsi/Makefile
> +++ b/drivers/usb/typec/ucsi/Makefile
> @@ -3,8 +3,6 @@ CFLAGS_trace.o			:= -I$(src)
>  
>  obj-$(CONFIG_TYPEC_UCSI)	+= typec_ucsi.o
>  
> -typec_ucsi-y			:= ucsi.o
> -
> -typec_ucsi-$(CONFIG_FTRACE)	+= trace.o
> +typec_ucsi-y			:= ucsi.o trace.o
>  
>  obj-$(CONFIG_UCSI_ACPI)		+= ucsi_acpi.o

I would like to understand what is the root cause for the problem you
are seeing? CONFIG_FTRACE=n with CONFIG_TYPEC_UCSI=m alone compiles
just fine for me.

Using FTRACE as the condition here is indeed wrong, but changing that
so that we unconditionally compile trace.c is also wrong. We should
probable use CONFIG_TRACING instead of CONFIG_FTRACE. Can you check if
that works for you?


Thanks,

-- 
heikki

WARNING: multiple messages have this Message-ID (diff)
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Tobias Regnery <tobias.regnery@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: usb: typec: ucsi: fix tracepoint related build error
Date: Mon, 9 Apr 2018 13:01:53 +0300	[thread overview]
Message-ID: <20180409100153.GA10141@kuha.fi.intel.com> (raw)

On Mon, Apr 09, 2018 at 09:55:17AM +0200, Tobias Regnery wrote:
> The ucsi driver defines several tracepoints, but the header file with the
> tracepoint definition trace.h is only conditionally built depending on
> CONFIG_FTRACE.

You mean trace.c, right? The definitions are indeed in the header,
trace.h, so I'm a bit confused what is actually the problem?

> This leads to the following build error with CONFIG_FTRACE=n and
> CONFIG_TYPEC_UCSI=m:

That alone should not cause any problems.

> ERROR: "__tracepoint_ucsi_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_register_port" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_notify" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_reset_ppm" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_run_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_ack" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> ERROR: "__tracepoint_ucsi_connector_change" [drivers/usb/typec/ucsi/typec_ucsi.ko] undefined!
> 
> With CONFIG_TYPEC_UCSI=y the build fails with several link errors.
> 
> Fix this by changing the Makefile to unconditionally build trace.o.
> Tracepints are a runtime contruct and no other user of tracepoints depends
> on CONFIG_FTRACE.
> 
> Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
> Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
> ---
>  drivers/usb/typec/ucsi/Makefile | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/Makefile b/drivers/usb/typec/ucsi/Makefile
> index b57891c1fd31..971befbbc2a8 100644
> --- a/drivers/usb/typec/ucsi/Makefile
> +++ b/drivers/usb/typec/ucsi/Makefile
> @@ -3,8 +3,6 @@ CFLAGS_trace.o			:= -I$(src)
>  
>  obj-$(CONFIG_TYPEC_UCSI)	+= typec_ucsi.o
>  
> -typec_ucsi-y			:= ucsi.o
> -
> -typec_ucsi-$(CONFIG_FTRACE)	+= trace.o
> +typec_ucsi-y			:= ucsi.o trace.o
>  
>  obj-$(CONFIG_UCSI_ACPI)		+= ucsi_acpi.o

I would like to understand what is the root cause for the problem you
are seeing? CONFIG_FTRACE=n with CONFIG_TYPEC_UCSI=m alone compiles
just fine for me.

Using FTRACE as the condition here is indeed wrong, but changing that
so that we unconditionally compile trace.c is also wrong. We should
probable use CONFIG_TRACING instead of CONFIG_FTRACE. Can you check if
that works for you?


Thanks,

  reply	other threads:[~2018-04-09 10:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09  7:55 [PATCH] usb: typec: ucsi: fix tracepoint related build error Tobias Regnery
2018-04-09  7:55 ` Tobias Regnery
2018-04-09 10:01 ` Heikki Krogerus [this message]
2018-04-09 10:01   ` Heikki Krogerus
2018-04-09 11:40   ` [PATCH] " Tobias Regnery
2018-04-09 11:40     ` Tobias Regnery
2018-04-10  7:39     ` [PATCH] " Heikki Krogerus
2018-04-10  7:39       ` Heikki Krogerus
2018-04-10  8:05     ` [PATCH] " Tobias Regnery
2018-04-10  8:05       ` Tobias Regnery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180409100153.GA10141@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tobias.regnery@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.