• Arnaldo Carvalho de Melo's avatar
    perf jitdump: Add the right header to get the major()/minor() definitions · 49a7f010
    Arnaldo Carvalho de Melo authored
    Noticed on Fedora Rawhide:
    
      $ gcc --version
      gcc (GCC) 6.1.1 20160721 (Red Hat 6.1.1-4)
      $ rpm -q glibc
      glibc-2.24.90-1.fc26.x86_64
      $
    
        CC       /tmp/build/perf/util/jitdump.o
      util/jitdump.c: In function 'jit_repipe_code_load':
      util/jitdump.c:428:2: error: '__major_from_sys_types' is deprecated:
        In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
        For historical compatibility, it is currently defined by
        <sys/types.h> as well, but we plan to remove this soon.
        To use `major', include <sys/sysmacros.h> directly.
        If you did not intend to use a system-defined macro `major',
        you should #undef it after including <sys/types.h>.
        [-Werror=deprecated-declarations]
        event->mmap2.maj   = major(st.st_dev);
        ^~~~~
      In file included from /usr/include/features.h:397:0,
                       from /usr/include/sys/types.h:25,
                       from util/jitdump.c:1:
      /usr/include/sys/sysmacros.h:87:1: note: declared here
       __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
    
    Fix it following that recomendation.
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: http://lkml.kernel.org/n/tip-3majvd0adhfr25rvx4v5e9te@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    49a7f010
jitdump.c 15.5 KB