• Jiri Olsa's avatar
    perf callchain: Fix compilation on powerpc with gcc11+ · 89ac61ff
    Jiri Olsa authored
    Got following build fail on powerpc:
    
        CC      arch/powerpc/util/skip-callchain-idx.o
      In function ‘check_return_reg’,
          inlined from ‘check_return_addr’ at arch/powerpc/util/skip-callchain-idx.c:213:7,
          inlined from ‘arch_skip_callchain_idx’ at arch/powerpc/util/skip-callchain-idx.c:265:7:
      arch/powerpc/util/skip-callchain-idx.c:54:18: error: ‘dwarf_frame_register’ accessing 96 bytes \
      in a region of size 64 [-Werror=stringop-overflow=]
         54 |         result = dwarf_frame_register(frame, ra_regno, ops_mem, &ops, &nops);
            |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      arch/powerpc/util/skip-callchain-idx.c: In function ‘arch_skip_callchain_idx’:
      arch/powerpc/util/skip-callchain-idx.c:54:18: note: referencing argument 3 of type ‘Dwarf_Op *’
      In file included from /usr/include/elfutils/libdwfl.h:32,
                       from arch/powerpc/util/skip-callchain-idx.c:10:
      /usr/include/elfutils/libdw.h:1069:12: note: in a call to function ‘dwarf_frame_register’
       1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
            |            ^~~~~~~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors
    
    The dwarf_frame_register args changed with [1],
    Updating ops_mem accordingly.
    
    [1] https://sourceware.org/git/?p=elfutils.git;a=commit;h=5621fe5443da23112170235dd5cac161e5c75e65Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
    Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
    Acked-by: default avatarMark Wieelard <mjw@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Michael Petlan <mpetlan@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
    Link: https://lore.kernel.org/r/20210928195253.1267023-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    89ac61ff
skip-callchain-idx.c 6.79 KB