1. 12 5月, 2015 2 次提交
    • A
      perf tests: Show refcounting broken expectations in thread-mg-share test · 8f196013
      Arnaldo Carvalho de Melo 提交于
      To help understand the failure.
      
        [acme@zoo linux]$ perf test -v 30
        30: Test thread mg sharing                                 :
        --- start ---
        test child forked, pid 12275
        FAILED tests/thread-mg-share.c:68 wrong refcnt (4 != 3)
        test child finished with -1
        ---- end ----
        Test thread mg sharing: FAILED!
        [acme@zoo linux]$
      
      This is under investigation, the thread__delete() calls were replaced
      with thread__put(), and those cause mismatches because now we need to be
      more judicious with the thread lifetime management.
      
      I.e. previously the thread__delete() would drop the map_group refcount,
      but now since thread__put doesn't call thread__delete() necessarily.
      because we have other refcount holders, the map_group refcount will not
      be as we expected when this test was implemented.
      
      Will be fixed soon...
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-9y8e3f7ukzco5loxvnlitpfq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f196013
    • H
      perf tests: Fix to get negative exit codes · 189c466f
      He Kuang 提交于
      WEXITSTATUS consists of the least significant 8 bits of the status
      argument, so we should convert the value to signed char if we have valid
      negative exit codes. And the return value of test->func() contains
      negative values:
      
        enum {
                TEST_OK   =  0,
                TEST_FAIL = -1,
                TEST_SKIP = -2,
        };
      
      Before this patch:
      
        $ perf test -v 1
        ...
        test child finished with 254
        ---- end ----
        vmlinux symtab matches kallsyms: FAILED!
      
      After this patch:
      
        $ perf test -v 1
        ...
        test child finished with -2
        ---- end ----
        vmlinux symtab matches kallsyms: Skip
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1431347316-30401-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      189c466f
  2. 09 5月, 2015 1 次提交
    • A
      perf machine: Protect the machine->threads with a rwlock · b91fc39f
      Arnaldo Carvalho de Melo 提交于
      In addition to using refcounts for the struct thread lifetime
      management, we need to protect access to machine->threads from
      concurrent access.
      
      That happens in 'perf top', where a thread processes events, inserting
      and deleting entries from that rb_tree while another thread decays
      hist_entries, that end up dropping references and ultimately deleting
      threads from the rb_tree and releasing its resources when no further
      hist_entry (or other data structures, like in 'perf sched') references
      it.
      
      So the rule is the same for refcounts + protected trees in the kernel,
      get the tree lock, find object, bump the refcount, drop the tree lock,
      return, use object, drop the refcount if no more use of it is needed,
      keep it if storing it in some other data structure, drop when releasing
      that data structure.
      
      I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
      "perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".
      
      The addr_location__put() one is because as we return references to
      several data structures, we may end up adding more reference counting
      for the other data structures and then we'll drop it at
      addr_location__put() time.
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b91fc39f
  3. 06 5月, 2015 1 次提交
  4. 29 4月, 2015 3 次提交
    • J
      perf tools: Add term support for parse_events_error · e64b020b
      Jiri Olsa 提交于
      Allowing event's term processing to report back error, like:
      
        $ perf record -e 'cpu/even=0x1/' ls
        event syntax error: 'cpu/even=0x1/'
                                 \___ unknown term
      
        valid terms: pc,any,inv,edge,cmask,event,in_tx,ldlat,umask,in_tx_cp,offcore_rsp,config,config1,config2,name,period,branch_type
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1429729824-13932-7-git-send-email-jolsa@kernel.org
      [ Renamed 'error' variables to 'err', not to clash with util.h error() ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e64b020b
    • J
      perf tools: Add parse_events_error interface · b39b8393
      Jiri Olsa 提交于
      Adding support to return error information from parse_events function.
      Following struct will be populated by parse_events function on return:
      
        struct parse_events_error {
          int   idx;
          char *str;
          char *help;
        };
      
      where 'idx' is the position in the string where the parsing failed,
      'str' contains dynamically allocated error string describing the error
      and 'help' is optional help string.
      
      The change contains reporting function, which currently does not display
      anything. The code changes to supply error data for specific event types
      are coming in next patches. However this is what the expected output is:
      
        $ sudo perf record -e 'sched:krava' ls
        event syntax error: 'sched:krava'
                             \___ unknown tracepoint
        ...
      
        $ perf record -e 'cpu/even=0x1/' ls
        event syntax error: 'cpu/even=0x1/'
                                 \___ unknown term
      
        valid terms: pc,any,inv,edge,cmask,event,in_tx,ldlat,umask,in_tx_cp,offcore_rsp,config,config1,config2,name,period,branch_type
        ...
      
        $ perf record -e cycles,cache-mises ls
        event syntax error: '..es,cache-mises'
                                       \___ parser error
        ...
      
      The output functions cut the beginning of the event string so the error
      starts up to 10th character and cut the end of the string of it crosses
      the terminal width.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1429729824-13932-2-git-send-email-jolsa@kernel.org
      [ Renamed 'error' variables to 'err', not to clash with util.h error() ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b39b8393
    • J
      perf tests: Add build tests for building perf from kernel source root and tools · c41c6647
      Jiri Olsa 提交于
      Adding build tests for following make commands:
        $ make -C <kernelsrc> tools/perf
        $ make -C <kernelsrc>/tools perf
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: linux-kbuild@vger.kernel.org
      Link: http://lkml.kernel.org/r/1429389280-18720-4-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c41c6647
  5. 08 4月, 2015 2 次提交
  6. 22 3月, 2015 1 次提交
    • J
      perf tools: Add kmod_path__parse function · 3c8a67f5
      Jiri Olsa 提交于
      Provides united way of parsing kernel module path
      into several components.
      
      The new kmod_path__parse function and few defines:
      
        int __kmod_path__parse(struct kmod_path *m, const char *path,
                               bool alloc_name, bool alloc_ext);
      
        #define kmod_path__parse(__m, __p)      __kmod_path__parse(__m, __p, false, false)
        #define kmod_path__parse_name(__m, __p) __kmod_path__parse(__m, __p, true , false)
        #define kmod_path__parse_ext(__m, __p)  __kmod_path__parse(__m, __p, false, true)
      
      parse kernel module @path and updates @m argument like:
      
        @comp - true if @path contains supported compression suffix,
                false otherwise
        @kmod - true if @path contains '.ko' suffix in right position,
                false otherwise
        @name - if (@alloc_name && @kmod) is true, it contains strdup-ed base name
                of the kernel module without suffixes, otherwise strudup-ed
                base name of @path
        @ext  - if (@alloc_ext && @comp) is true, it contains strdup-ed string
                the compression suffix
      
      It returns 0 if there's no strdup error, -ENOMEM otherwise.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-9t6eqg8j610r94l743hkntiv@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c8a67f5
  7. 20 3月, 2015 2 次提交
  8. 12 2月, 2015 1 次提交
  9. 11 2月, 2015 1 次提交
  10. 06 2月, 2015 2 次提交
  11. 23 1月, 2015 1 次提交
  12. 22 1月, 2015 2 次提交
  13. 17 1月, 2015 1 次提交
    • W
      perf test: Fix dwarf unwind using libunwind. · b93b0967
      Wang Nan 提交于
      Perf tool fails to unwind user stack if the event raises in a shared
      object. This patch improves tests/dwarf-unwind.c to demonstrate the
      problem by utilizing commonly used glibc function "bsearch". If perf is
      not statically linked, the testcase will try to unwind a mixed call
      trace.
      
      By debugging libunwind I found that there is a bug in unwind-libunwind:
      it always passes 0 as segbase to libunwind, cause libunwind unable to
      locate debug_frame entry fir first level ip address (I add some more
      debugging output into libunwind to make things clear):
      
                     >_Uarm_dwarf_find_debug_frame: start_ip = 10be98, end_ip = 10c2a4
                     >_Uarm_dwarf_find_debug_frame: found debug_frame table `/lib/libc-2.18.so': segbase=0x0, len=7, gp=0x0, table_data=0x449388
                     >_Uarm_dwarf_search_unwind_table: call lookup:ip = b6cd3bcc, segbase = 0, rel_ip = b6cd3bcc
                     >lookup: e->start_ip_offset = bcf18 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 6d314 (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 33d0c (rel_ip = b6cd3bcc)
                      ...
                     >lookup: e->start_ip_offset = 15d0c (rel_ip = b6cd3bcc)
                     >lookup: e->start_ip_offset = 15c40 (rel_ip = b6cd3bcc)
       >_Uarm_dwarf_search_unwind_table: IP b6cd3bcc inside range b6c12000-b6d4c000, but no explicit unwind info found
                      >put_rs_cache: unmasking signals/interrupts and releasing lock
                     >_Uarm_dwarf_step: returning -10
       >_Uarm_step: dwarf_step()=-10
      
      This patch passes map->start as segbase to dwarf_find_debug_frame(), so
      di will be initialized correctly.
      
      In addition, dso and executable are different when setting segbase. This
      patch first check whether the elf is executable, and pass segbase only
      for shared object.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1421203007-75799-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b93b0967
  14. 08 1月, 2015 1 次提交
    • N
      perf hists: Fix children sort key behavior · 5ca82710
      Namhyung Kim 提交于
      When perf report --children resorts output fields, it tries to put
      caller above the callee.  But this was only meaningful for a same thread
      and doing this requires callchain enabled.  So fix its check before
      comparing the callchain depth.
      
      This also changes the hist accumulation tests: In test 3, xmalloc in
      bash thread should be above than other perf threads due to alphabetical
      order of comm string.  Also it's under page_fault in bash thread since
      alphabetical order of dso name.  The sys_perf_event_open in perf thread
      is put on the last line since it's self overhead is 0.
      
      In test 4, the sys_perf_event_open is put above other perf entries that
      have same children overhead since its callchain depth is smaller.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1419309381-2593-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ca82710
  15. 23 12月, 2014 1 次提交
  16. 09 12月, 2014 1 次提交
  17. 03 12月, 2014 1 次提交
  18. 19 11月, 2014 1 次提交
  19. 16 11月, 2014 1 次提交
  20. 29 10月, 2014 4 次提交
  21. 16 10月, 2014 2 次提交
    • N
      perf report: Set callchain_param.record_mode for future use · 0cdccac6
      Namhyung Kim 提交于
      Normally the callchain_param.record_mode is used only for record path.
      But as it might need to prepare something for dwarf unwinding, setup
      this info for perf report too.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1412556363-26229-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0cdccac6
    • K
      perf test: Add test case for pmu event new style format · ffe59788
      Kan Liang 提交于
      Add test case in automated tests suite. It checks not only the two types
      of pmu event stytle formats "pmu_event_name" and "cpu/pmu_event_name/",
      but also the different formats mixtures which are more likely to trigger
      parse issue.
      
      The patch set including this one has been tested by the perf automated
      test:
      
         ./perf test parse -v"
      
      On haswell, ivybridge and Romley platform.
      
      The patch set also has been tested on haswell by the following script.
      
      Note: please make sure that your test system support TSX and
      L1-dcache-loads events. Otherwise, you may want to change the events to
      other pmu events.
      
        [lk@localhost ~]$ cat perf_style_test.sh
        # hardware events + kernel pmu event with different style
        perf stat -x, -e cycles,mem-stores,tx-start sleep 2
        perf stat -x, -e cpu-cycles,cycles-ct,cycles-t sleep 2
        perf stat -x, -e cycles,cpu/cycles-ct/,cpu/cycles-t/ sleep 2
        perf stat -x, -e instructions,cpu/tx-start/ sleep 2
        perf stat -x, -e '{cycles,tx-start}' sleep 2
        perf stat -x, -e '{cycles,cpu/tx-start/}' sleep 2
      
        # HW Cache event + kernel pmu event with different style
        perf stat -x, -e L1-dcache-loads,cpu/mem-stores/,tx-start sleep 2
        perf stat -x, -e L1-dcache-loads,mem-stores,cpu/tx-start/ sleep 2
        perf stat -x, -e '{L1-dcache-loads,mem-stores}' sleep 2
        perf stat -x, -e '{L1-dcache-loads,cpu/tx-start/}' sleep 2
      
        # Raw event + kernel pmu event with different style:
        perf stat -x, -e cpu/event=0xc0,umask=0x00/,mem-loads,cpu/mem-stores/ sleep 2
        perf stat -x, -e cpu/event=0xc0,umask=0x00/,tx-start,cpu/el-start/ sleep 2
        perf stat -x, -e '{cpu/event=0xc0,umask=0x00/,tx-start}' sleep 2
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1412694532-23391-5-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ffe59788
  22. 15 10月, 2014 1 次提交
    • A
      perf tools: Remove hists from evsel · a635fc51
      Arnaldo Carvalho de Melo 提交于
      Now tools that deals want to have an hists per evsel need to call
      hists__init() before creating any evsels, which can be as early as when
      parsing the command line, so do it before calling parse_options().
      
      The current tools using hists/hist_entries are report, top and annotate,
      change them to request per evsel hists.
      
      This is in preparation for making evsels usable by 3rd party tools, that
      not necessarily live in perf's source code repository.
      Acked-by: NBorislav Petkov <bp@suse.de>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-usjx2la743f10ippj7p1b20x@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a635fc51
  23. 10 10月, 2014 1 次提交
    • A
      perf evsel: Add hists helper · 4ea062ed
      Arnaldo Carvalho de Melo 提交于
      Not all tools need a hists instance per perf_evsel, so lets pave the way
      to remove evsel->hists while leaving a way to access the hists from a
      specially allocated evsel, one that comes with space at the end where
      lives the evsel.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-qlktkhe31w4mgtbd84035sr2@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4ea062ed
  24. 26 9月, 2014 5 次提交
    • A
      tools lib fd array: Allow associating an integer cookie with each entry · 2171a925
      Arnaldo Carvalho de Melo 提交于
      We will use this in perf's evlist class so that it can, at
      fdarray__filter() time, to unmap the associated ring buffer.
      
      We may need to have further info associated with each fdarray entry, in
      that case we'll make that int array a 'union fdarray_priv' one and put a
      pointer there so that users can stash whatever they want there. For now,
      an int is enough tho.
      
      v2: Add clarification to the per array entry priv area, as well as make
          it a union, which makes usage a bit longer, but if/when we make it
          use more space by allowing per entry pointers existing users source
          code will not have to be changed, just rebuilt.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      
      Link: http://lkml.kernel.org/n/tip-0p00bn83quck3fio3kcs9vca@git.kernel.org
      2171a925
    • A
      tools lib api: Adopt fdarray class from perf's evlist · 1b85337d
      Arnaldo Carvalho de Melo 提交于
      The extensible file description array that grew in the perf_evlist class
      can be useful for other tools, as it is not something that only evlists
      need, so move it to tools/lib/api/fd to ease sharing it.
      
      v2: Don't use {} like in:
      
       libapi_dirs:
      	$(QUIET_MKDIR)mkdir -p $(OUTPUT){fs,fd}/
      
      in Makefiles, as it will not work in some systems, as in ubuntu13.10.
      
      v3: Add fd/*.[ch] to LIBAPIKFS_SOURCES (Fix from Jiri Olsa)
      
      v4: Leave the fcntl(fd, O_NONBLOCK) in the evlist layer, remains to
          be checked if it is really needed there, but has no place in the
          fdarray class (Fix from Jiri Olsa)
      
      v5: Remove evlist details from fdarray grow/filter tests. Improve it a
          bit doing more tests about expected internal state.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-kleuni3hckbc3s0lu6yb9x40@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b85337d
    • A
      perf evlist: Introduce poll method for common code idiom · f66a889d
      Arnaldo Carvalho de Melo 提交于
      Since we have access two evlist members in all these poll calls, provide
      a helper.
      
      This will also help to make the patch introducing the pollfd class more
      clear, as the evlist specific uses will be hiden away
      perf_evlist__poll().
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-jr9d4aop4lvy9453qahbcgp0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f66a889d
    • A
      perf tests: Add pollfd growing test · 9ae28035
      Arnaldo Carvalho de Melo 提交于
        [acme@ssdandy linux]$ perf test "Add fd"
        34: Add fd to pollfd array, making it autogrow             : Ok
        [acme@ssdandy linux]$ perf test -v "Add fd"
        34: Add fd to pollfd array, making it autogrow             :
        --- start ---
        test child forked, pid 19817
      
        before growing array:   2 [ 1, 2 ]
        after 3rd add_pollfd:   3 [ 1, 2, 35 ]
        after 4th add_pollfd:   4 [ 1, 2, 35, 88 ]
        test child finished with 0
        ---- end ----
        Add fd to pollfd array, making it autogrow: Ok
        [acme@ssdandy linux]$
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-smflpyta146bzog7z0effjss@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9ae28035
    • A
      perf tests: Add test for perf_evlist__filter_pollfd() · 54dbfae3
      Arnaldo Carvalho de Melo 提交于
      That will use a synthetic evlist with just what is touched by this new
      method to check that it works as expected.
      
      Output in verbose mode:
      
        $ perf test -v pollfd
        33: Filter fds with revents mask in a pollfd array         :
        --- start ---
        filtering all but pollfd[2]:
        before:   5 [ 5, 4, 3, 2, 1 ]
         after:   1 [ 3 ]
        filtering all but (pollfd[0], pollfd[3]):
        before:   5 [ 5, 4, 3, 2, 1 ]
         after:   2 [ 5, 2 ]
        test child finished with 0
        ---- end ----
        Filter fds with revents mask in a pollfd array: Ok
        $
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-x7c8liszdvc3ocmanf2cet8p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      54dbfae3
  25. 18 9月, 2014 1 次提交