public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Add missing sys/types.h include
@ 2023-01-04 18:23 Jesus Sanchez-Palencia
  2023-01-04 19:06 ` Ian Rogers
  2023-01-04 19:13 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 5+ messages in thread
From: Jesus Sanchez-Palencia @ 2023-01-04 18:23 UTC (permalink / raw)
  To: linux-perf-users
  Cc: Mark Rutland, Namhyung Kim, Jiri Olsa, Alexander Shishkin,
	Arnaldo Carvalho de Melo, Ian Rogers, linux-kernel,
	Jesus Sanchez-Palencia

Not all libc implementations define ssize_t as part of stdio.h like
glibc does since the standard only requires this type to be defined by
unistd.h and sys/types.h. For this reason the perf build is currently
broken for toolchains based on uClibc, for instance.

Include sys/types.h explicitly to fix that. This is a follow up to
commit 378ef0f5d9d7 ("perf build: Use libtraceevent from the system").

Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
---
 tools/perf/util/trace-event.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index add6c5d9531c..9b3cd79cca12 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -4,6 +4,7 @@
 
 #include <stdbool.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <linux/types.h>
 
 struct evlist;
-- 
2.39.0.314.g84b9a713c41-goog


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

* Re: [PATCH] perf: Add missing sys/types.h include
  2023-01-04 18:23 [PATCH] perf: Add missing sys/types.h include Jesus Sanchez-Palencia
@ 2023-01-04 19:06 ` Ian Rogers
  2023-01-04 19:13 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Rogers @ 2023-01-04 19:06 UTC (permalink / raw)
  To: Jesus Sanchez-Palencia
  Cc: linux-perf-users, Mark Rutland, Namhyung Kim, Jiri Olsa,
	Alexander Shishkin, Arnaldo Carvalho de Melo, linux-kernel

On Wed, Jan 4, 2023 at 10:23 AM Jesus Sanchez-Palencia
<jesussanp@google.com> wrote:
>
> Not all libc implementations define ssize_t as part of stdio.h like
> glibc does since the standard only requires this type to be defined by
> unistd.h and sys/types.h. For this reason the perf build is currently
> broken for toolchains based on uClibc, for instance.
>
> Include sys/types.h explicitly to fix that. This is a follow up to
> commit 378ef0f5d9d7 ("perf build: Use libtraceevent from the system").
>
> Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/util/trace-event.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> index add6c5d9531c..9b3cd79cca12 100644
> --- a/tools/perf/util/trace-event.h
> +++ b/tools/perf/util/trace-event.h
> @@ -4,6 +4,7 @@
>
>  #include <stdbool.h>
>  #include <stdio.h>
> +#include <sys/types.h>
>  #include <linux/types.h>
>
>  struct evlist;
> --
> 2.39.0.314.g84b9a713c41-goog
>

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

* Re: [PATCH] perf: Add missing sys/types.h include
  2023-01-04 18:23 [PATCH] perf: Add missing sys/types.h include Jesus Sanchez-Palencia
  2023-01-04 19:06 ` Ian Rogers
@ 2023-01-04 19:13 ` Arnaldo Carvalho de Melo
  2023-01-04 19:33   ` Jesus Sanchez-Palencia
  2023-01-04 19:42   ` Arnaldo Carvalho de Melo
  1 sibling, 2 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-01-04 19:13 UTC (permalink / raw)
  To: Jesus Sanchez-Palencia
  Cc: linux-perf-users, Mark Rutland, Namhyung Kim, Jiri Olsa,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Ian Rogers,
	linux-kernel

Em Wed, Jan 04, 2023 at 10:23:13AM -0800, Jesus Sanchez-Palencia escreveu:
> Not all libc implementations define ssize_t as part of stdio.h like
> glibc does since the standard only requires this type to be defined by
> unistd.h and sys/types.h. For this reason the perf build is currently
> broken for toolchains based on uClibc, for instance.
> 
> Include sys/types.h explicitly to fix that. This is a follow up to
> commit 378ef0f5d9d7 ("perf build: Use libtraceevent from the system").

Do you mean this problem started with the 378ef0f5d9d7 commit? If so
then this is the fase for adding:

Fixes: 378ef0f5d9d7 ("perf build: Use libtraceevent from the system")

To this patch, ok?

- Arnaldo
 
> Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
> ---
>  tools/perf/util/trace-event.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> index add6c5d9531c..9b3cd79cca12 100644
> --- a/tools/perf/util/trace-event.h
> +++ b/tools/perf/util/trace-event.h
> @@ -4,6 +4,7 @@
>  
>  #include <stdbool.h>
>  #include <stdio.h>
> +#include <sys/types.h>
>  #include <linux/types.h>
>  
>  struct evlist;
> -- 
> 2.39.0.314.g84b9a713c41-goog

-- 

- Arnaldo

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

* Re: [PATCH] perf: Add missing sys/types.h include
  2023-01-04 19:13 ` Arnaldo Carvalho de Melo
@ 2023-01-04 19:33   ` Jesus Sanchez-Palencia
  2023-01-04 19:42   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 5+ messages in thread
From: Jesus Sanchez-Palencia @ 2023-01-04 19:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-perf-users, Mark Rutland, Namhyung Kim, Jiri Olsa,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Ian Rogers,
	linux-kernel

On Wed, Jan 4, 2023 at 11:13 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Wed, Jan 04, 2023 at 10:23:13AM -0800, Jesus Sanchez-Palencia escreveu:
> > Not all libc implementations define ssize_t as part of stdio.h like
> > glibc does since the standard only requires this type to be defined by
> > unistd.h and sys/types.h. For this reason the perf build is currently
> > broken for toolchains based on uClibc, for instance.
> >
> > Include sys/types.h explicitly to fix that. This is a follow up to
> > commit 378ef0f5d9d7 ("perf build: Use libtraceevent from the system").
>
> Do you mean this problem started with the 378ef0f5d9d7 commit? If so
> then this is the fase for adding:
>
> Fixes: 378ef0f5d9d7 ("perf build: Use libtraceevent from the system")
>
> To this patch, ok?

Fixed in v2.

Thanks,
Jesus


>
> - Arnaldo
>
> > Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
> > ---
> >  tools/perf/util/trace-event.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> > index add6c5d9531c..9b3cd79cca12 100644
> > --- a/tools/perf/util/trace-event.h
> > +++ b/tools/perf/util/trace-event.h
> > @@ -4,6 +4,7 @@
> >
> >  #include <stdbool.h>
> >  #include <stdio.h>
> > +#include <sys/types.h>
> >  #include <linux/types.h>
> >
> >  struct evlist;
> > --
> > 2.39.0.314.g84b9a713c41-goog
>
> --
>
> - Arnaldo

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

* Re: [PATCH] perf: Add missing sys/types.h include
  2023-01-04 19:13 ` Arnaldo Carvalho de Melo
  2023-01-04 19:33   ` Jesus Sanchez-Palencia
@ 2023-01-04 19:42   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-01-04 19:42 UTC (permalink / raw)
  To: Jesus Sanchez-Palencia
  Cc: linux-perf-users, Mark Rutland, Namhyung Kim, Jiri Olsa,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Ian Rogers,
	linux-kernel

Em Wed, Jan 04, 2023 at 04:13:47PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Jan 04, 2023 at 10:23:13AM -0800, Jesus Sanchez-Palencia escreveu:
> > Not all libc implementations define ssize_t as part of stdio.h like
> > glibc does since the standard only requires this type to be defined by
> > unistd.h and sys/types.h. For this reason the perf build is currently
> > broken for toolchains based on uClibc, for instance.
> > 
> > Include sys/types.h explicitly to fix that. This is a follow up to
> > commit 378ef0f5d9d7 ("perf build: Use libtraceevent from the system").
> 
> Do you mean this problem started with the 378ef0f5d9d7 commit? If so
> then this is the fase for adding:

Yeah, it was:

  tools/perf/util/trace-event.h
    /usr/include/traceevent/event_parse.h # This got removed from util/trace-event.h in 378ef0f5d9d7
      /usr/include/regex.h
        /usr/include/sys/types.h
	  typedef __ssize_t ssize_t;

So sys/types.h was _always_ missing in tools/perf/util/trace-event.h,
that got it by luck.

I'm adding these details and the Fixes tag pointed to that 378ef0f5d9d7
commit.

For the curious:

http://vger.kernel.org/~acme/perf/size_t_from_trace-event.h.ps

Using an old tool I wrote around graphviz :-)

- Arnaldo
 
> Fixes: 378ef0f5d9d7 ("perf build: Use libtraceevent from the system")
> 
> To this patch, ok?
  
> > Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
> > ---
> >  tools/perf/util/trace-event.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> > index add6c5d9531c..9b3cd79cca12 100644
> > --- a/tools/perf/util/trace-event.h
> > +++ b/tools/perf/util/trace-event.h
> > @@ -4,6 +4,7 @@
> >  
> >  #include <stdbool.h>
> >  #include <stdio.h>
> > +#include <sys/types.h>
> >  #include <linux/types.h>
> >  
> >  struct evlist;
> > -- 
> > 2.39.0.314.g84b9a713c41-goog

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

end of thread, other threads:[~2023-01-04 19:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 18:23 [PATCH] perf: Add missing sys/types.h include Jesus Sanchez-Palencia
2023-01-04 19:06 ` Ian Rogers
2023-01-04 19:13 ` Arnaldo Carvalho de Melo
2023-01-04 19:33   ` Jesus Sanchez-Palencia
2023-01-04 19:42   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox