perf tools: Fix build on uClibc systems by adding missing sys/types.h include
authorJesus Sanchez-Palencia <jesussanp@google.com>
Wed, 4 Jan 2023 19:34:14 +0000 (11:34 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 4 Jan 2023 19:44:01 +0000 (16:44 -0300)
commit481028dbf1daa2808e1be06f6a865b5fe5939efc
tree800fd41787c90b3fea81484802deaa336610d085
parent54b353a20c7e8be98414754f5aff98c8a68fcc1f
perf tools: Fix build on uClibc systems by adding missing sys/types.h include

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.

Committer notes:

In addition, in the past this worked in uClibc test systems as there was
another way to get to sys/types.h that got removed in that cset:

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

So the size_t that is used in tools/perf/util/trace-event.h was being
obtained indirectly, by chance.

Fixes: 378ef0f5d9d7f465 ("perf build: Use libtraceevent from the system")
Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20230104193414.606905-1-jesussanp@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/trace-event.h