• Jesus Sanchez-Palencia's avatar
    perf tools: Fix build on uClibc systems by adding missing sys/types.h include · 481028db
    Jesus Sanchez-Palencia authored
    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 378ef0f5
          /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: 378ef0f5 ("perf build: Use libtraceevent from the system")
    Signed-off-by: default avatarJesus 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    481028db
trace-event.h 4.22 KB