Skip to content
  1. Jul 13, 2016
    • Arnaldo Carvalho de Melo's avatar
      tools lib api fs: Use str_error_r() · b31e3e33
      Arnaldo Carvalho de Melo authored
      
      
      To make it portable to non-glibc systems, that follow the XSI variant
      instead of the GNU specific one that gets in place when _GNU_SOURCE is
      defined.
      
      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: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-mixgnh3iyajuqogn2opsocdy@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b31e3e33
    • Arnaldo Carvalho de Melo's avatar
      tools lib traceevent: Use str_error_r() · c3cec9e6
      Arnaldo Carvalho de Melo authored
      
      
      To make it portable to non-glibc systems, that follow the XSI variant
      instead of the GNU specific one that gets in place when _GNU_SOURCE is
      defined.
      
      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: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-c1gn8x978qfop65m510wy43o@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c3cec9e6
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Uninline scnprintf() and vscnprint() · d0761e37
      Arnaldo Carvalho de Melo authored
      
      
      They were in tools/include/linux/kernel.h, requiring that it in turn
      included stdio.h, which is way too heavy.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-855h8olnkot9v0dajuee1lo3@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d0761e37
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Uninline the is_function_event method · 5496bc0c
      Arnaldo Carvalho de Melo authored
      
      
      So that we don't have to carry a string.h header in evsel.h
      
      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>
      Link: http://lkml.kernel.org/n/tip-2lwpm2aytdvvgo626zuat6et@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5496bc0c
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Remove needless includes from cache.h · 175729fc
      Arnaldo Carvalho de Melo authored
      
      
      The cache.h header doesn't use any of the definitions in some of the
      headers it includes, ditch them and fix the fallout, where files were
      getting stuff they needed just because they were including it, sometimes
      not using what it really exports at all.
      
      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>
      Link: http://lkml.kernel.org/n/tip-l6r2bmj8h1g3e01wr981on0n@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      175729fc
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Add missing header to color.c · 16b7c9bd
      Arnaldo Carvalho de Melo authored
      
      
      It uses isatty(), so needs unistd.h, include it.
      
      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>
      Link: http://lkml.kernel.org/n/tip-ivwuz8f68tb3sdcpguo9wmvx@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      16b7c9bd
    • Arnaldo Carvalho de Melo's avatar
      perf tests x86 rdpmc: Add missing headers · 10ca87fd
      Arnaldo Carvalho de Melo authored
      
      
      Another case of a file using definitions and getting them by chance,
      from indirect header inclusion, fix it.
      
      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>
      Link: http://lkml.kernel.org/n/tip-o3l1vi4gw2w6xyc6z4ig938s@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      10ca87fd
    • Arnaldo Carvalho de Melo's avatar
      perf test fdarray: Add missing poll.h header · 16b91d5e
      Arnaldo Carvalho de Melo authored
      
      
      It uses poll() but was getting the needed header by chance, do it
      explicitely.
      
      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>
      Link: http://lkml.kernel.org/n/tip-76b3c5imnl6p69j4lqewzu9l@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      16b91d5e
    • Arnaldo Carvalho de Melo's avatar
      perf tests cpumap: Add missing headers · 3ac55b1d
      Arnaldo Carvalho de Melo authored
      
      
      It was getting all sort of needed stuff by sheer luck, via indirect
      includes, fix it.
      
      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>
      Link: http://lkml.kernel.org/n/tip-tvjgo39t8k0ye6dntv3knran@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3ac55b1d
    • Arnaldo Carvalho de Melo's avatar
      perf quote: Disentangle headers · 380a71a2
      Arnaldo Carvalho de Melo authored
      
      
      No need to include stdio.h from quote.h, also forward declare strbuf.
      
      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>
      Link: http://lkml.kernel.org/n/tip-k3kbcxhctpxvz6ckve3kv6c1@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      380a71a2
    • Arnaldo Carvalho de Melo's avatar
      perf strbuf: Add missing headers · 7ed0958a
      Arnaldo Carvalho de Melo authored
      
      
      We were only indirectly and by luck getting types, etc needed for this
      file, fix it.
      
      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>
      Link: http://lkml.kernel.org/n/tip-gr8ejvzm7ojk6zwpeplyx9zu@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7ed0958a
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/ · cec07f53
      Arnaldo Carvalho de Melo authored
      And remove the empty tools/arch/x86/include/asm/unistd_{32,64}.h files
      introduced by eae7a755
      
       ("perf tools, x86: Build perf on older
      user-space as well").
      
      This way we get closer to mirroring the kernel for cases where __NR_
      can't be found for some include path/_GNU_SOURCE/whatever scenario.
      
      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>
      Link: http://lkml.kernel.org/n/tip-kpj6m3mbjw82kg6krk2z529e@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cec07f53
    • Arnaldo Carvalho de Melo's avatar
      perf bench: Disentangle headers · 9c304f6c
      Arnaldo Carvalho de Melo authored
      
      
      We should try avoiding that perf.h header, it includes way too much
      stuff, making it difficult to use things like setting _GNU_SOURCE only
      on a small set of headers.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Davidlohr Bueso <dbueso@suse.de>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-lb6eg9w1kzrwhv0gm3ho0h54@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9c304f6c
    • Arnaldo Carvalho de Melo's avatar
      perf tests openat-syscall-tp-fields: Add some conditional defines · ab6526b2
      Arnaldo Carvalho de Melo authored
      
      
      These were only defined if _GNU_SOURCE was set in older glibc versions,
      check that and provide the defines in such cases.
      
      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>
      Link: http://lkml.kernel.org/n/tip-b8esouhpg4tk6vi4n3d7ipch@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ab6526b2
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Add conditional define for AT_FDCWD · 48e1f91a
      Arnaldo Carvalho de Melo authored
      
      
      This one was only defined if _GNU_SOURCE was set in older glibc
      versions, check that and provide the define in such cases.
      
      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>
      Link: http://lkml.kernel.org/n/tip-ilsgsysr6s3mru7rf2befnu5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      48e1f91a
    • Arnaldo Carvalho de Melo's avatar
      perf tests: Add missing pthread.h include for CPU_*() macros · 1fbe7df8
      Arnaldo Carvalho de Melo authored
      
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-dfcynqzvecsu55zmpxub9jgv@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1fbe7df8
    • Arnaldo Carvalho de Melo's avatar
      perf bench: Add missing pthread.h include for CPU_*() macros · 8a158589
      Arnaldo Carvalho de Melo authored
      
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Davidlohr Bueso <dbueso@suse.de>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-48qbfv7tqs8n8ey74lbyfjtq@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8a158589
    • Arnaldo Carvalho de Melo's avatar
      tools: Introduce str_error_r() · c8b5f2c9
      Arnaldo Carvalho de Melo authored
      
      
      The tools so far have been using the strerror_r() GNU variant, that
      returns a string, be it the buffer passed or something else.
      
      But that, besides being tricky in cases where we expect that the
      function using strerror_r() returns the error formatted in a provided
      buffer (we have to check if it returned something else and copy that
      instead), breaks the build on systems not using glibc, like Alpine
      Linux, where musl libc is used.
      
      So, introduce yet another wrapper, str_error_r(), that has the GNU
      interface, but uses the portable XSI variant of strerror_r(), so that
      users rest asured that the provided buffer is used and it is what is
      returned.
      
      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>
      Link: http://lkml.kernel.org/n/tip-d4t42fnf48ytlk8rjxs822tf@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c8b5f2c9
  2. Jul 12, 2016
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty open_flags: Add more conditional defines · ffe3a28a
      Arnaldo Carvalho de Melo authored
      
      
      Don't handle some flags only if they have its defines in headers at
      time of building, define what is missing.
      
      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>
      Link: http://lkml.kernel.org/n/tip-wgjxeidwpowrvqgrxr080k6u@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ffe3a28a
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty flock: Add more conditional defines · 4c7c224a
      Arnaldo Carvalho de Melo authored
      
      
      Don't handle some flags only if they have its defines in headers at
      time of building, define what is missing.
      
      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>
      Link: http://lkml.kernel.org/n/tip-pgoxanv1y6hfcnryxawzuskl@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4c7c224a
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty mmap: Add more conditional defines · 256763b0
      Arnaldo Carvalho de Melo authored
      
      
      Don't handle some flags only if they have its defines in headers at
      time of building, define what is missing.
      
      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>
      Link: http://lkml.kernel.org/n/tip-czbmxb01xzcl3h2qxuzoqkj5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      256763b0
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty open_flags: Add missing headers · 9d4a94ca
      Arnaldo Carvalho de Melo authored
      
      
      Those beautifiers need to make sure they include what they reference,
      as changes in builtin-trace.c may end up removing needed stuff, like
      when undefining _GNU_SOURCE.
      
      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>
      Link: http://lkml.kernel.org/n/tip-a9cz8za6lqutfapn5e7uum09@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9d4a94ca
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty flock: Add missing fcntl.h include · f8e01870
      Arnaldo Carvalho de Melo authored
      
      
      Those beautifiers need to make sure they include what they reference,
      as changes in builtin-trace.c may end up removing needed stuff, like
      when undefining _GNU_SOURCE.
      
      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>
      Link: http://lkml.kernel.org/n/tip-2etqhfmgv5jcnfwnkbwadns2@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8e01870
    • Arnaldo Carvalho de Melo's avatar
      perf trace beauty msg_flags: Remove MSG_TRYHARD · 0e91e6bf
      Arnaldo Carvalho de Melo authored
      
      
      It is the same as MSG_DONTROUTE and is only defined together with
      _GNU_SOURCE.
      
      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>
      Link: http://lkml.kernel.org/n/tip-q4vbov6jl0e0152y01kv2htw@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0e91e6bf
    • Arnaldo Carvalho de Melo's avatar
      perf report: Introduce --stdio-color to setup the color output mode selection · 175b968b
      Arnaldo Carvalho de Melo authored
      
      
      'perf report --stdio' will colorize entries with most hits and possibly
      some other aspects of its output, but those colors gets suppressed if we
      redirect the output to a non-tty, allow keeping the colors by adding a
      new option, --stdio-color, now this use case will also output escape
      sequences for colors:
      
        $ perf annotate --stdio-color | more
      
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-3iuawqjldu4i8gziot7e3d5n@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      175b968b
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Introduce --stdio-color to setup the color output mode selection · 53fe4ba1
      Arnaldo Carvalho de Melo authored
      
      
      'perf annotate --stdio' will colorize entries with most hits and
      possibly some other aspects of its output, but those colors gets
      suppressed if we redirect the output to a non-tty, allow keeping the
      colors by adding a new option, --stdio-color, now this use case will
      also output escape sequences for colors:
      
        $ perf annotate --stdio-color | more
      
      Based-on-a-patch-by: default avatarPeter Zijlstra <peterz@infradead.org>
      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>
      Link: http://lkml.kernel.org/n/tip-sjrnixani5pg6qez640gaxhf@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      53fe4ba1
    • Arnaldo Carvalho de Melo's avatar
      perf ui stdio: Add way to setup the color output mode selection · c09615f2
      Arnaldo Carvalho de Melo authored
      
      
      In --stdio we turn off color output when the output is not a tty,
      which is not always desirable, for instance, in:
      
        perf annotate | more
      
      the 'more' tool is perfectly capable of processing the escape sequences
      for colored output.
      
      Allow using the existing logic for .perfconfig's "color.ui" to be used
      from the command line by providing a stdio__config_color() helper, that
      will be used by annotate and report in follow up patches.
      
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-1u4wjdbcc41dxndsb4klpa9y@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c09615f2
    • Jiri Olsa's avatar
      perf hists: Introduce hists__add_entry_ops function · a5051979
      Jiri Olsa authored
      
      
      Introducing hists__add_entry_ops function to allow using the allocation
      callbacks externally.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1467701765-26194-4-git-send-email-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a5051979
    • Jiri Olsa's avatar
      perf hists: Introduce hist_entry_ops · f542e767
      Jiri Olsa authored
      
      
      Introducing allocation callbacks, that allows to extend current
      hist_entry object into objects with special needs without polluting the
      current hist_entry object.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1467701765-26194-3-git-send-email-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f542e767
    • Jiri Olsa's avatar
      perf hists: Introduce hist_entry__init function · 0a269a6b
      Jiri Olsa authored
      
      
      Move the 'struct hist_entry' initialization code to a separate function.
      It'll be useful and more clear for the following patches that introduce
      allocation callbacks.
      
      Releasing the hist_entry object in hist_entry__new function
      (where it's allocated) rather than in hist_entry__init.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1467701765-26194-2-git-send-email-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0a269a6b
  3. Jul 11, 2016
    • Ingo Molnar's avatar
      Revert "perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86" · 44530d58
      Ingo Molnar authored
      This reverts commit 2c95afc1.
      
      Stephane reported the following regression:
      
       > Since Andi added:
       >
       > commit 2c95afc1
      
      
       > Author: Andi Kleen <ak@linux.intel.com>
       > Date:   Thu Jun 9 06:14:38 2016 -0700
       >
       >    perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86
       >
       > $ perf stat -e ref-cycles ls
       >   <not counted> ....
       >
       > fails systematically because the ref-cycles is now used by the
       > watchdog and given this is a system-wide pinned event, it monopolizes
       > the fixed counter 2 which is the only counter able to measure this event.
      
      Since the next merge window is near, fix the regression for now
      by reverting the commit.
      
      Reported-by: default avatarStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      44530d58
  4. Jul 07, 2016
    • Kan Liang's avatar
      perf/x86/intel/uncore: Add support for the Intel Skylake client uncore PMU · 46866b59
      Kan Liang authored
      
      
      This patch adds full support for Intel SKL client uncore PMU:
      
       - Add support for SKL client CPU uncore PMU, which is similar to the
         BDW client PMU driver. (There are some differences in CBOX numbering
         and uncore control MSR.)
       - Add new support for SkyLake Mobile uncore PMUs, for both CPU and PCI
         uncore functionality.
      
      Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/1467208912-8179-1-git-send-email-kan.liang@intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      46866b59
    • Peter Zijlstra's avatar
      perf/x86/intel: Fix rdlbr_to() MSR reading typo · aefbc4d0
      Peter Zijlstra authored
      
      
      It helps to actually read the right MSR..
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: linux-kernel@vger.kernel.org
      Fixes: d4cf1949
      
       ("perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers")
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      aefbc4d0
    • Ingo Molnar's avatar
    • Mark Rutland's avatar
      perf/core: Fix pmu::filter_match for SW-led groups · 2c81a647
      Mark Rutland authored
      The following commit:
      
        66eb579e
      
       ("perf: allow for PMU-specific event filtering")
      
      added the pmu::filter_match() callback. This was intended to
      avoid HW constraints on events from resulting in extremely
      pessimistic scheduling.
      
      However, pmu::filter_match() is only called for the leader of each event
      group. When the leader is a SW event, we do not filter the groups, and
      may fail at pmu::add() time, and when this happens we'll give up on
      scheduling any event groups later in the list until they are rotated
      ahead of the failing group.
      
      This can result in extremely sub-optimal event scheduling behaviour,
      e.g. if running the following on a big.LITTLE platform:
      
      $ taskset -c 0 ./perf stat \
       -e 'a57{context-switches,armv8_cortex_a57/config=0x11/}' \
       -e 'a53{context-switches,armv8_cortex_a53/config=0x11/}' \
       ls
      
           <not counted>      context-switches                                              (0.00%)
           <not counted>      armv8_cortex_a57/config=0x11/                                 (0.00%)
                      24      context-switches                                              (37.36%)
                57589154      armv8_cortex_a53/config=0x11/                                 (37.36%)
      
      Here the 'a53' event group was always eligible to be scheduled, but
      the 'a57' group never eligible to be scheduled, as the task was always
      affine to a Cortex-A53 CPU. The SW (group leader) event in the 'a57'
      group was eligible, but the HW event failed at pmu::add() time,
      resulting in ctx_flexible_sched_in giving up on scheduling further
      groups with HW events.
      
      One way of avoiding this is to check pmu::filter_match() on siblings
      as well as the group leader. If any of these fail their
      pmu::filter_match() call, we must skip the entire group before
      attempting to add any events.
      
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Fixes: 66eb579e
      
       ("perf: allow for PMU-specific event filtering")
      Link: http://lkml.kernel.org/r/1465917041-15339-1-git-send-email-mark.rutland@arm.com
      [ Small readability edits. ]
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2c81a647
  5. Jul 06, 2016
    • Ville Syrjälä's avatar
      x86/perf/intel/rapl: Fix module name collision with powercap intel-rapl · 175a20c1
      Ville Syrjälä authored
      Since commit 4b6e2571 the rapl perf module calls itself intel-rapl. That
      name was already in use by the rapl powercap driver, which now fails to load
      if the perf module is loaded. Fix the problem by renaming the perf module to
      intel-rapl-perf, so that both modules can coexist.
      
      Fixes: 4b6e2571
      
       ("x86/perf/intel/rapl: Make the Intel RAPL PMU driver modular")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1466694409-3620-1-git-send-email-ville.syrjala@linux.intel.com
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      175a20c1
  6. Jul 05, 2016
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-20160704' of... · c50f6245
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo-20160704' 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:
      
      Documentation changes:
      
       - Update android build documentation (Chris Phlipot)
      
      Infrastructure changes:
      
       - Respect WERROR=0 in libapi and libsubcmd, to allow building on Android (Chris Phlipot)
      
       - Prep work to support SDT events in probe cache (Masami Hiramatsu)
      
       - ELF support for SDT (Hemant Kumar)
      
       - Add feature detection for libelf's elf_getshdrstrndx function (Arnaldo Carvalho de Melo)
      
       - Fix hist accumulation test (Jiri Olsa)
      
       - Unwind callchain fixes (Jiri Olsa)
      
       - Change internal representation of numa nodes obtained from
         perf.data header (Jiri Olsa)
      
       - Sync copy of syscall_64.tbl with the kernel (Arnaldo Carvalho de Melo)
      
       - Add LGPL 2.1 license header to libbpf source files (Wang Nan)
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c50f6245
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Sync copy of syscall_64.tbl with the kernel · f3d082ce
      Arnaldo Carvalho de Melo authored
      Noticed by the build system, that emitted this warning:
      
        Warning: x86_64's syscall_64.tbl differs from kernel
      
      This was due to the wiring up of the recently added preadv2 & pwritev2
      syscalls to the compat code, which hadn't been done by the patch
      introducing those syscalls: 4babf2c5 ("x86: wire up preadv2 and
      pwritev2").
      
      The patch doing the compat wiring was:
      
        482dd2ef
      
       ("x86/syscalls: Wire up compat readv2/writev2 syscalls")
      
      This just silences the perf build warning, as compat syscalls still
      can't be supported in 'perf trace´ due to limitations in the
      raw_syscalls:sys_{enter,exit} tracepoints it relies on.
      
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-4dm8eoy0wslgtwqdhz64ods0@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f3d082ce
    • Chris Phlipot's avatar
      perf tools: Update android build documentation · 3d037611
      Chris Phlipot authored
      
      
      Update the android build documentation according to recent android build
      fixes. The instructions for step 1a and step 2 were updated to work with
      NDK version 11(oldest supported version) and NDK version 12(current
      version).
      
      Signed-off-by: default avatarChris Phlipot <cphlipot0@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1467349955-1135-5-git-send-email-cphlipot0@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3d037611
    • Chris Phlipot's avatar
      tools lib subcmd: Respect WERROR=0 for build · fd01d06a
      Chris Phlipot authored
      
      
      this enables the workaround for compilers that generate warnings when
      compiling libsubcmd.
      
      Signed-off-by: default avatarChris Phlipot <cphlipot0@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1467349955-1135-3-git-send-email-cphlipot0@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fd01d06a