05 May, 2014

5 commits

  • It's defined in include/uapi/linux/prctl.h header.
    Also it was never used in perf tool.

    Acked-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1399293219-8732-6-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • As it's no longer used.

    Acked-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1399293219-8732-5-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • It's defined in tools/perf/util/include/linux/kernel.h header.

    Acked-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1399293219-8732-4-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • It's defined in tools/include/linux/compiler.h header.

    Acked-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1399293219-8732-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • As it's no longer used.

    Acked-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1399293219-8732-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     

02 May, 2014

2 commits

  • Combine all definitions into a common tools/include/linux/types.h and
    kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper
    bitmap.h header.

    Signed-off-by: Borislav Petkov
    Acked-by: Rusty Russell
    Link: http://lkml.kernel.org/n/tip-azczs7qcv6h9xek9od10hiv2@git.kernel.org
    Signed-off-by: Jiri Olsa

    Borislav Petkov
     
  • So tools/ has been growing three, at a different stage of their
    development export.h headers and so we should unite into one. Add
    tools/include/ to the include path of virtio and liblockdep to pick the
    shared header now.

    Signed-off-by: Borislav Petkov
    Acked-by: Rusty Russell
    Cc: Arnaldo Carvalho de Melo
    Cc: Ingo Molnar
    Cc: Michael S. Tsirkin
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: virtio-dev@lists.oasis-open.org
    Cc: virtualization@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/1397493185-19521-2-git-send-email-bp@alien8.de
    Signed-off-by: Jiri Olsa

    Borislav Petkov
     

01 May, 2014

2 commits


30 Apr, 2014

7 commits

  • Previous commit 'perf x86: Fix perf to use non-executable stack, again'
    moved stack map into MAP__VARIABLE map type again. Fixing the dwarf
    unwind test stack map lookup appropriately.

    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Jean Pihet
    Link: http://lkml.kernel.org/n/tip-ttzyhbe4zls24z7ednkmhvxl@git.kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • arch/x86/tests/regs_load.S is missing the linker note about the stack
    requirements, therefore making the linker fall back to an executable
    stack. As this object gets linked against the final perf binary, it'll
    needlessly end up with an executable stack. Fix this by adding the
    appropriate linker note.

    Also add a global linker flag to prevent future regressions, as
    suggested by Jiri. This way perf won't get an executable stack even if
    we fail to add the .GNU-stack linker note to future assembler files.
    Though, doing so might create regressions the other way around, when
    (statically) linking against libraries needing an executable stack.
    But, apparently, regressing in that direction is wanted as it is an
    indicator of poor code quality -- or just missing linker notes.

    Fixes: 3c8b06f981 ("perf tests x86: Introduce perf_regs_load function")

    Signed-off-by: Mathias Krause
    Acked-by: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1398617466-22749-1-git-send-email-minipli@googlemail.com
    Signed-off-by: Jiri Olsa

    Mathias Krause
     
  • The array debugfs_known_mountpoints[] will cause extra '/'
    character output.
    Remove it.

    pre:
    $ perf probe -l
    /sys/kernel/debug//tracing/uprobe_events file does not exist -
    please rebuild kernel with CONFIG_UPROBE_EVENTS.

    post:
    $ perf probe -l
    /sys/kernel/debug/tracing/uprobe_events file does not exist -
    please rebuild kernel with CONFIG_UPROBE_EVENTS.

    Signed-off-by: Xia Kaixu
    Acked-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/535B6660.2060001@huawei.com
    Signed-off-by: Jiri Olsa

    Xia Kaixu
     
  • Modules installed outside of the kernel's build system should go into
    "%s/lib/modules/%s/extra", but at present, perf will only look at them
    when they are in "%s/lib/modules/%s/kernel". Lets encourage good
    citizenship by relaxing this requirement to "%s/lib/modules/%s". This
    way open source modules that are out-of-tree have no incentive to start
    populating a directory reserved for in-kernel modules and I can stop
    hex-editing my system's perf binary when profiling OSS out-of-tree
    modules.

    Feedback from Namhyung Kim correctly revealed that the hex-edits that I
    had been doing meant that perf was also traversing the build and source
    symlinks in %s/lib/modules/%s. That is undesireable, so we explicitly
    exclude them from traversal with a minor tweak to the traversal routine.

    Signed-off-by: Richard Yao
    Acked-by: Namhyung kim
    Link: http://lkml.kernel.org/r/1398532675-13684-1-git-send-email-ryao@gentoo.org
    Signed-off-by: Jiri Olsa

    Richard Yao
     
  • Adding test for building static perf build into the automated
    suite. Also available via following commands:

    $ make -f tests/make make_static
    - make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.7u5MlB4njo LDFLAGS=-static
    $ make -f tests/make make_static_O
    - make_static_O: cd . && make -f Makefile O=/tmp/tmp.Ay6r3wEmtX DESTDIR=/tmp/tmp.vK0KQwO0Vi LDFLAGS=-static

    Acked-by: David Ahern
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1398760413-7574-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • There's false assumption in the library detection code
    assuming -liberty and -lz are always present once bfd
    is detected. The fails on Ubuntu (14.04) as reported
    by Ingo.

    Forcing the bdf dependency libraries detection any
    time bfd library is detected.

    Reported-by: Ingo Molnar
    Tested-by: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1398676935-6615-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • We no longer use ALL_LDFLAGS, Replacing with LDFLAGS.

    Acked-by: Namhyung Kim
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1398675770-3109-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     

29 Apr, 2014

6 commits

  • This patch hooks in the perf_regs and libunwind code for ARM64.
    The tools/perf/arch/arm64 is created; it contains the arch specific
    code for DWARF unwinding.

    Signed-off-by: Jean Pihet
    Acked-by: Will Deacon
    Link: http://lkml.kernel.org/r/1398688353-3737-1-git-send-email-jean.pihet@linaro.org
    Signed-off-by: Jiri Olsa

    Jean Pihet
     
  • ... to its single user's header, evsel.h.

    Signed-off-by: Borislav Petkov
    Link: http://lkml.kernel.org/r/tip-9os1chjyz12upubfsjc71d99@git.kernel.org
    Signed-off-by: Jiri Olsa

    Borislav Petkov
     
  • Add a s390 specific test of a hardcoded trace event with '-'
    in the name.

    Signed-off-by: Alexander Yarygin
    Link: http://lkml.kernel.org/r/1398440047-6641-4-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Jiri Olsa

    Alexander Yarygin
     
  • In tests/parse-events.c test cases are declared in evlist_test[]
    arrays. Elements of arrays are initialized in following pattern:
    [i] = {
    .name = ...,
    .check = ...,
    },

    When perf-test is running with '-v' option, 'i' variable will be
    printed for every existing test.

    However, we can't add any arch specific tests inside #ifdefs, because it
    will create collision between the element number inside #ifdef and the
    next one outside.

    This patch adds 'id' field in evlist_test, uses it as a test
    identifier and removes explicit numbering of array elements. This helps
    to number tests with gaps.

    Signed-off-by: Alexander Yarygin
    Link: http://lkml.kernel.org/r/1398440047-6641-3-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Jiri Olsa

    Alexander Yarygin
     
  • Trace events potentially can have a '-' in their trace system name,
    e.g. kvm on s390 defines kvm-s390:* tracepoints.
    We could not parse them, because there was no rule for this:
    $ sudo ./perf top -e "kvm-s390:*"
    invalid or unsupported event: 'kvm-s390:*'

    This patch adds an extra rule to event_legacy_tracepoint which handles
    those cases. Without the patch, perf will not accept such tracepoints in
    the -e option.

    Signed-off-by: Alexander Yarygin
    Tested-by: Christian Borntraeger
    Acked-by: Christian Borntraeger
    Link: http://lkml.kernel.org/r/1398440047-6641-2-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Jiri Olsa

    Alexander Yarygin
     
  • Those readn/writen functions are to ensure read/write does I/O for
    a given size exactly. But ion() - its implementation - does not
    handle in case it returns prematurely due to a signal. As it's not
    an error itself so just retry the operation.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398346054-3322-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     

28 Apr, 2014

7 commits

  • This test create 2 processes abstractions, with several threads
    and checks they properly share and maintain map groups info.

    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1397490723-1992-6-git-send-email-jolsa@redhat.com
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • Sharing map groups within all process threads. This way
    there's only one copy of mmap info and it's reachable
    from any thread within the process.

    Original-patch-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1397490723-1992-5-git-send-email-jolsa@redhat.com
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • We will share it among threads in the same process.
    Adding map_groups__get/map_groups__put interface for that.

    Signed-off-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1397490723-1992-4-git-send-email-jolsa@redhat.com
    Signed-off-by: Jiri Olsa

    Arnaldo Carvalho de Melo
     
  • Moving towards sharing map groups within a process threads.

    Because of this we need the map groups to be dynamically allocated. No
    other functional change is intended in here.

    Based on a patch by Jiri Olsa, but this time _just_ making the
    conversion from statically allocating thread->mg to turning it into a
    pointer and instead of initializing it at thread's constructor,
    introduce a constructor/destructor for the map_groups class and
    call at thread creation time.

    Later we will introduce the get/put methods when we move to sharing
    those map_groups, when the get/put refcounting semantics will be needed.

    Signed-off-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1397490723-1992-3-git-send-email-jolsa@redhat.com
    Signed-off-by: Jiri Olsa

    Arnaldo Carvalho de Melo
     
  • Adding automated test for memory maps lookup within multiple machines
    threads.

    The test creates 4 threads and separated memory maps. It checks that we
    could use thread__find_addr_map function with thread object based on TID
    to find memory maps.

    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1397490723-1992-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • Now we have changed how hists stats are accounted especially when
    filter(s) applied. So add a test case to verify it.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398396494-12811-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The fake_setup_machine() is for setting up a environment for testing
    various hists operations. As it'll be used for other test cases it'd
    better factoring it out.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398396494-12811-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     

25 Apr, 2014

2 commits


24 Apr, 2014

9 commits

  • When TUI hist browser expands/collapses callchains it accounted number
    of callchain nodes into total entries to show. However this code
    ignores filtering so that it can make the cursor go to out of screen.

    Thanks to Jiri Olsa for pointing out a bug (and a fix) in the code.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-12-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The hist_browser__reset() is only called right after a filter is
    applied so it needs to udpate browser->nr_entries properly. We cannot
    use hists->nr_non_filtered_entreis directly since it's possible that
    such entries are also filtered out by minimum percentage limit.

    In addition when a filter is used for perf top, hist browser's
    nr_entries field was not updated after applying the filter. But it
    needs to be updated as new samples are coming.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-11-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Rename ->nr_pcnt_entries and hist_browser__update_pcnt_entries() to
    ->nr_non_filtered_entries and hist_browser__update_nr_entries() since
    it's now used for filtering as well.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-10-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The nr_entries variable is increased inside the loop in the function
    but it always count the first entry regardless of it's filtered or
    not; caused an off-by-one error.

    It'd become a problem especially there's no entry at all - it'd get a
    segfault during referencing a NULL pointer.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-9-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • When a filter is used for perf top, its hists->nr_non_filtered_entries
    was not updated after it removed an entry in hists__decay_entries().
    Also hists->stats.total_non_filtered_period was missed too.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-8-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Currently, accounting each sample is done in multiple places - once
    when adding them to the input tree, other when adding them to the
    output tree. It's not only confusing but also can cause a subtle
    problem since concurrent processing like in perf top might see the
    updated stats before adding entries into the output tree - like seeing
    more (blank) lines at the end and/or slight inaccurate percentage.

    To fix this, only account the entries when it's moved into the output
    tree so that they cannot be seen prematurely. There're some
    exceptional cases here and there - they should be addressed separately
    with comments.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-7-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • When a filter is applied a hist entry checks whether its callchain was
    folded and account it to the output stat. But this is rather hacky
    and only TUI-specific. Simply fold the callchains for the entry looks
    like a simpler and more generic solution IMHO.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-6-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Add hists__{reset,inc}_[filter_]stats() functions to cleanup accesses
    to hist stats (for output). Note that number of samples in the stat
    is not handled here since it belongs to the input stage.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • It's not the part of logic of hists__inc_stats() so it'd be better to
    move it out of the function.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim