1. 27 12月, 2017 10 次提交
  2. 18 12月, 2017 4 次提交
    • A
      tools arch s390: Do not include header files from the kernel sources · 10b9baa7
      Arnaldo Carvalho de Melo 提交于
      Long ago we decided to be verbotten including files in the kernel git
      sources from tools/ living source code, to avoid disturbing kernel
      development (and perf's and other tools/) when, say, a kernel hacker
      adds something, tests everything but tools/ and have tools/ build
      broken.
      
      This got broken recently by s/390, fix it by copying
      arch/s390/include/uapi/asm/perf_regs.h to tools/arch/s390/include/uapi/asm/,
      making this one be used by means of <asm/perf_regs.h> and updating
      tools/perf/check_headers.sh to make sure we are notified when the
      original changes, so that we can check if anything is needed on the
      tooling side.
      
      This would have been caught by the 'tarkpg' test entry in:
      
      $ make -C tools/perf build-test
      
      When run on a s/390 build system or container.
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      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: Wang Nan <wangnan0@huawei.com>
      Fixes: f704ef44 ("s390/perf: add support for perf_regs and libdw")
      Link: https://lkml.kernel.org/n/tip-n57139ic0v9uffx8wdqi3d8a@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      10b9baa7
    • B
      perf jvmti: Generate correct debug information for inlined code · ca58d7e6
      Ben Gainey 提交于
      tools/perf/jvmti is broken in so far as it generates incorrect debug
      information. Specifically it attributes all debug lines to the original
      method being output even in the case that some code is being inlined
      from elsewhere.  This patch fixes the issue.
      
      To test (from within linux/tools/perf):
      
      export JDIR=/usr/lib/jvm/java-8-openjdk-amd64/
      make
      cat << __EOF > Test.java
      public class Test
      {
          private StringBuilder b = new StringBuilder();
      
          private void loop(int i, String... args)
          {
              for (String a : args)
                  b.append(a);
      
              long hc = b.hashCode() * System.nanoTime();
      
              b = new StringBuilder();
              b.append(hc);
      
              System.out.printf("Iteration %d = %d\n", i, hc);
          }
      
          public void run(String... args)
          {
              for (int i = 0; i < 10000; ++i)
              {
                  loop(i, args);
              }
          }
      
          public static void main(String... args)
          {
              Test t = new Test();
              t.run(args);
          }
      }
      __EOF
      $JDIR/bin/javac Test.java
      ./perf record -F 10000 -g -k mono $JDIR/bin/java -agentpath:`pwd`/libperf-jvmti.so Test
      ./perf inject --jit -i perf.data -o perf.data.jitted
      ./perf annotate -i perf.data.jitted --stdio | grep Test\.java: | sort -u
      
      Before this patch, Test.java line numbers get reported that are greater
      than the number of lines in the Test.java file.  They come from the
      source file of the inlined function, e.g. java/lang/String.java:1085.
      For further validation one can examine those lines in the JDK source
      distribution and confirm that they map to inlined functions called by
      Test.java.
      
      After this patch, the filename of the inlined function is output
      rather than the incorrect original source filename.
      Signed-off-by: NBen Gainey <ben.gainey@arm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ben Gainey <ben.gainey@arm.com>
      Cc: Colin King <colin.king@canonical.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 598b7c69 ("perf jit: add source line info support")
      Link: http://lkml.kernel.org/r/20171122182541.d25599a3eb1ada3480d142fa@arm.comSigned-off-by: NKim Phillips <kim.phillips@arm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca58d7e6
    • J
      perf tools: Fix up build in hardened environments · 61fb26a6
      Jiri Olsa 提交于
      On Fedora systems the perl and python CFLAGS/LDFLAGS include the
      hardened specs from redhat-rpm-config package. We apply them only for
      perl/python objects, which makes them not compatible with the rest of
      the objects and the build fails with:
      
        /usr/bin/ld: perf-in.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -f
      +PIC
        /usr/bin/ld: libperf.a(libperf-in.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile w
      +ith -fPIC
        /usr/bin/ld: final link failed: Nonrepresentable section on output
        collect2: error: ld returned 1 exit status
        make[2]: *** [Makefile.perf:507: perf] Error 1
        make[1]: *** [Makefile.perf:210: sub-make] Error 2
        make: *** [Makefile:69: all] Error 2
      
      Mainly it's caused by perl/python objects being compiled with:
      
        -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
      
      which prevent the final link impossible, because it will check
      for 'proper' objects with following option:
      
        -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20171204082437.GC30564@kravaSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      61fb26a6
    • J
      perf tools: Use shell function for perl cflags retrieval · 5cfee7a3
      Jiri Olsa 提交于
      Using the shell function for perl CFLAGS retrieval instead of back
      quotes (``). Both execute shell with the command, but the latter is more
      explicit and seems to be the preferred way.
      
      Also we don't have any other use of the back quotes in perf Makefiles.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20171108102739.30338-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5cfee7a3
  3. 15 12月, 2017 4 次提交
  4. 13 12月, 2017 2 次提交
    • M
      tools/lib/lockdep: Add missing declaration of 'pr_cont()' · 92ccc262
      Mengting Zhang 提交于
      Commit:
      
        681fbec8 ("lockdep: Use consistent printing primitives")
      
      has moved lockdep away from using printk() for printing.
      
      The commit added usage of pr_cont() which wasn't wrapped in the
      userspace headers, causing the following warning for the
      liblockdep build:
      
      	../../../kernel/locking/lockdep.c:3544:2: warning: implicit declaration of function 'pr_cont' [-Wimplicit-function-declaration]
      
      Adding an empty declaration of 'pr_cont' fixes the problem.
      Signed-off-by: NMengting Zhang <zhangmengting@huawei.com>
      Signed-off-by: NSasha Levin <alexander.levin@verizon.com>
      Reviewed-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: a.p.zijlstra@chello.nl
      Link: http://lkml.kernel.org/r/20171212181644.11913-2-alexander.levin@verizon.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      92ccc262
    • D
      bpf: fix broken BPF selftest build · 720f228e
      Daniel Borkmann 提交于
      At least on x86_64, the kernel's BPF selftests seemed to have stopped
      to build due to 618e165b ("selftests/bpf: sync kernel headers and
      introduce arch support in Makefile"):
      
        [...]
        In file included from test_verifier.c:29:0:
        ../../../include/uapi/linux/bpf_perf_event.h:11:32:
           fatal error: asm/bpf_perf_event.h: No such file or directory
         #include <asm/bpf_perf_event.h>
                                      ^
        compilation terminated.
        [...]
      
      While pulling in tools/arch/*/include/uapi/asm/bpf_perf_event.h seems
      to work fine, there's no automated fall-back logic right now that would
      do the same out of tools/include/uapi/asm-generic/bpf_perf_event.h. The
      usual convention today is to add a include/[uapi/]asm/ equivalent that
      would pull in the correct arch header or generic one as fall-back, all
      ifdef'ed based on compiler target definition. It's similarly done also
      in other cases such as tools/include/asm/barrier.h, thus adapt the same
      here.
      
      Fixes: 618e165b ("selftests/bpf: sync kernel headers and introduce arch support in Makefile")
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      720f228e
  5. 12 12月, 2017 2 次提交
  6. 09 12月, 2017 3 次提交
  7. 08 12月, 2017 1 次提交
  8. 07 12月, 2017 2 次提交
    • I
      tooling/headers: Synchronize updated s390 and x86 UAPI headers · 34c9ca37
      Ingo Molnar 提交于
      There were two trivial updates to these upstream UAPI headers:
      
        arch/s390/include/uapi/asm/kvm.h
        arch/s390/include/uapi/asm/kvm_perf.h
        arch/x86/lib/x86-opcode-map.txt
      
      Synchronize them with their tooling copies.
      
      (The x86 opcode map includes a new instruction pattern now.)
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      34c9ca37
    • M
      objtool: Fix 64-bit build on 32-bit host · 14c47b54
      Mikulas Patocka 提交于
      The new ORC unwinder breaks the build of a 64-bit kernel on a 32-bit
      host.  Building the kernel on a i386 or x32 host fails with:
      
        orc_dump.c: In function 'orc_dump':
        orc_dump.c:105:26: error: passing argument 2 of 'elf_getshdrnum' from incompatible pointer type [-Werror=incompatible-pointer-types]
          if (elf_getshdrnum(elf, &nr_sections)) {
                                  ^
        In file included from /usr/local/include/gelf.h:32:0,
                         from elf.h:22,
                         from warn.h:26,
                         from orc_dump.c:20:
        /usr/local/include/libelf.h:304:12: note: expected 'size_t * {aka unsigned int *}' but argument is of type 'long unsigned int *'
         extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
                    ^~~~~~~~~~~~~~
        orc_dump.c:190:17: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'Elf64_Sxword {aka long long int}' [-Werror=format=]
            printf("%s+%lx:", name, rela.r_addend);
                       ~~^          ~~~~~~~~~~~~~
                       %llx
      
      Fix the build failure.
      
      Another problem is that if the user specifies HOSTCC or HOSTLD
      variables, they are ignored in the objtool makefile.  Change the
      Makefile to respect these variables.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sven Joachim <svenjoac@gmx.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 627fce14 ("objtool: Add ORC unwind table generation")
      Link: http://lkml.kernel.org/r/19f0e64d8e07e30a7b307cd010eb780c404fe08d.1512252895.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      14c47b54
  9. 06 12月, 2017 12 次提交