1. 13 Aug, 2015 2 commits
    • Andi Kleen's avatar
      perf tools: Support static linking with libdw · 7aec51cb
      Andi Kleen authored
      The Fedora 22 version of libdw requires a couple of extra libraries to
      link. With a dynamic link the dependencies are pulled in automatically,
      but this doesn't work for static linking. Add the needed libraries
      explicitely to the feature probe and the Makefile.
      
      v2: Explicitly check for static linking and only add the dependencies
          when -static is set. This is to avoid regressions on Arnaldo's system.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1439419717-20601-1-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7aec51cb
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · a897b5f0
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Allow selecting the type of callchains per event, including disabling
          callchains in all but one entry in an event list, to save space, and also
          to ask for the callchains collected in one event to be used in other
          events. (Kan Liang)
      
        - Beautify more syscall arguments in 'perf trace': (Arnaldo Carvalho de Melo)
          - A bunch more translate file/pathnames from pointers to strings.
          - Convert numbers to strings for the 'keyctl' syscall 'option' arg.
          - Add missing 'clockid' entries.
      
        - Fix 'perf probe -L sys_*' as it was not showing all the source code for
          syscall functions in the kernel. (Masami Hiramatsu)
      
        - Make ESC unzoom as well in the hists browser, i.e. in 'report' and 'top',
          as we're considering repurposing the right and left arrow keys to use in
          horizontal scrolling, i.e. leave just ESC to be used for what <- works
          now, and ENTER for what -> does (they are already aliases for ages).
          (Arnaldo Carvalho de Melo)
      
      Infrastructure fixes:
      
        - Check for SRCLINE_UNKNOWN case in "srcfile" processing (Andi Kleen)
      
        - Wrap the slsmg_{printf,write_nstring} slang functions behind ui_browser, so
          that we can make the ui_browser based browsers (annotate, menus, hists, etc) UI
          library agnostic and usable with multiple backends (slang now, GTK+ and others
          in the future, maybe) (Arnaldo Carvalho de Melo)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a897b5f0
  2. 12 Aug, 2015 22 commits
  3. 10 Aug, 2015 7 commits
  4. 08 Aug, 2015 3 commits
  5. 07 Aug, 2015 6 commits
    • Wang Nan's avatar
      perf tests: Add LLVM test for eBPF on-the-fly compiling · 9bc898c7
      Wang Nan authored
      Previous patches introduce llvm__compile_bpf() to compile source file to
      eBPF object. This patch adds testcase to test it. It also tests libbpf
      by opening generated object after applying next patch which introduces
      HAVE_LIBBPF_SUPPORT option.
      
      Since llvm__compile_bpf() prints long messages which users who don't
      explicitly test llvm doesn't care, this patch set verbose to -1 to
      suppress all debug, warning and error message, and hint user use 'perf
      test -v' to see the full output.
      
      For the same reason, if clang is not found in PATH and there's no [llvm]
      section in .perfconfig, skip this test.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/n/1436445342-1402-17-git-send-email-wangnan0@huawei.com
      [ Add tools/lib/bpf/ to tools/perf/MANIFEST, so that the tarball targets build ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9bc898c7
    • Wang Nan's avatar
      perf tools: Auto detecting kernel include options · 0c6d18bf
      Wang Nan authored
      To help user find correct kernel include options, this patch extracts
      them from kbuild system by an embedded script kinc_fetch_script, which
      creates a temporary directory, generates Makefile and an empty dummy.o
      then use the Makefile to fetch $(NOSTDINC_FLAGS), $(LINUXINCLUDE) and
      $(EXTRA_CFLAGS) options. The result is passed to compiler script using
      'KERNEL_INC_OPTIONS' environment variable.
      
      Because options from kbuild contains relative path like
      'Iinclude/generated/uapi', the work directory must be changed. This is
      done by previous patch.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1436445342-1402-16-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0c6d18bf
    • Wang Nan's avatar
      perf tools: Auto detecting kernel build directory · d325d788
      Wang Nan authored
      This patch detects kernel build directory by checking the existence of
      include/generated/autoconf.h.
      
      clang working directory is changed to kbuild directory if it is found,
      to help user use relative include path. Following patch will detect
      kernel include directory, which contains relative include patch so this
      workdir changing is needed.
      
      Users are allowed to set 'kbuild-dir = ""' manually to disable this
      checking.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/n/tip-owyfwfbemrjn0tlj6tgk2nf5@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d325d788
    • Wang Nan's avatar
      perf tools: Call clang to compile C source to object code · 4cea3a9c
      Wang Nan authored
      This is the core patch for supporting eBPF on-the-fly compiling, does
      the following work:
      
       1. Search clang compiler using search_program().
      
       2. Run command template defined in llvm-bpf-cmd-template option in
          [llvm] config section using read_from_pipe(). Patch of clang and
          source code path is injected into shell command using environment
          variable using force_set_env().
      
        Commiter notice:
      
        When building with DEBUG=1 we get a compiler error that gets fixed with
        the same approach described in commit b2365122:
      
          perf kmem: Fix compiler warning about may be accessing uninitialized variable
      
          The last argument to strtok_r doesn't need to be initialized, its
          just a placeholder to make this routine reentrant, but gcc doesn't know
          about that and complains, breaking the build, fix it by setting it to
          NULL.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/n/1436445342-1402-14-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4cea3a9c
    • Wang Nan's avatar
      perf tools: Introduce llvm config options · aa61fd05
      Wang Nan authored
      This patch introduces [llvm] config section with 5 options. Following
      patches will use then to config llvm dynamica compiling.
      
      'llvm-utils.[ch]' is introduced in this patch for holding all
      llvm/clang related stuffs.
      
      Example:
      
        [llvm]
              # Path to clang. If omit, search it from $PATH.
      	clang-path = "/path/to/clang"
      
              # Cmdline template. Following line shows its default value.
              # Environment variable is used to passing options.
              #
              # *NOTE*: -D__KERNEL__ MUST appears before $CLANG_OPTIONS,
              # so user have a chance to use -U__KERNEL__ in $CLANG_OPTIONS
              # to cancel it.
      	clang-bpf-cmd-template = "$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS \
      				  $KERNEL_INC_OPTIONS -Wno-unused-value \
      				  -Wno-pointer-sign -working-directory \
      				  $WORKING_DIR  -c $CLANG_SOURCE -target \
      				  bpf -O2 -o -"
      
              # Options passed to clang, will be passed to cmdline by
              # $CLANG_OPTIONS.
      	clang-opt = "-Wno-unused-value -Wno-pointer-sign"
      
              # kbuild directory. If not set, use /lib/modules/`uname -r`/build.
              # If set to "" deliberately, skip kernel header auto-detector.
      	kbuild-dir = "/path/to/kernel/build"
      
              # Options passed to 'make' when detecting kernel header options.
      	kbuild-opts = "ARCH=x86_64"
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1437477214-149684-1-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aa61fd05
    • Wang Nan's avatar
      bpf tools: Link all bpf objects onto a list · 9a208eff
      Wang Nan authored
      To allow enumeration of all bpf_objects, keep them in a list (hidden to
      caller). bpf_object__for_each_safe() is introduced to do this iteration.
      It is safe even user close the object during iteration.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1435716878-189507-23-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9a208eff