1. 12 May, 2016 1 commit
  2. 11 May, 2016 16 commits
  3. 10 May, 2016 18 commits
  4. 09 May, 2016 5 commits
    • Chris Phlipot's avatar
      perf symbols: Fix handling of zero-length symbols. · 9c7b37cd
      Chris Phlipot authored
      This change introduces a fix to symbols__find, so that it is able to
      find symbols of length zero (where start == end).
      
      The current code has the following problem:
      
      - The current implementation of symbols__find is unable to find any symbols
        of length zero.
      
      - The db-export framework explicitly creates zero length symbols at
        locations where no symbol currently exists.
      
      The combination of the two above behaviors results in behavior similar
      to the example below.
      
      1. addr_location is created for a sample, but symbol is unable to be
         resolved.
      
      2. db export creates an "unknown" symbol of length zero at that address
         and inserts it into the dso.
      
      3. A new sample comes in at the same address, but symbol__find is unable
         to find the zero length symbol, so it is still unresolved.
      
      4. db export sees the symbol is unresolved, and allocated a duplicate
         symbol, even though it already did this in step 2.
      
      This behavior continues every time an address without symbol information
      is seen, which causes a very large number of these symbols to be
      allocated.
      
      The effect of this fix can be observed by looking at the contents of an
      exported database before/after the fix (generated with
      scripts/python/export-to-postgresql.py)
      
      Ex.
      BEFORE THE CHANGE:
      
        example_db=# select count(*) from symbols;
         count
        --------
         900213
        (1 row)
      
        example_db=# select count(*) from symbols where symbols.name='unknown';
         count
        --------
         897355
        (1 row)
      
        example_db=# select count(*) from symbols where symbols.name!='unknown';
         count
        -------
          2858
        (1 row)
      
      AFTER THE CHANGE:
      
        example_db=# select count(*) from symbols;
         count
        -------
         25217
        (1 row)
      
        example_db=# select count(*) from symbols where name='unknown';
         count
        -------
         22359
        (1 row)
      
        example_db=# select count(*) from symbols where name!='unknown';
         count
        -------
          2858
        (1 row)
      Signed-off-by: default avatarChris Phlipot <cphlipot0@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1462612620-25008-1-git-send-email-cphlipot0@gmail.com
      [ Moved the test to later in the rb_tree tests, as this not the likely case ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9c7b37cd
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Print state of perf_event_attr.write_backward · 0a241ef4
      Arnaldo Carvalho de Melo authored
      Now we can see if it is set when using verbose mode in various tools,
      such as 'perf test':
      
        # perf test -vv back
        45: Test backward reading from ring buffer                   :
        --- start ---
        <SNIP>
        ------------------------------------------------------------
        perf_event_attr:
          type                             2
          size                             112
          config                           0x98
          { sample_period, sample_freq }   1
          sample_type                      IP|TID|TIME|CPU|PERIOD|RAW
          disabled                         1
          mmap                             1
          comm                             1
          task                             1
          sample_id_all                    1
          exclude_guest                    1
          mmap2                            1
          comm_exec                        1
          write_backward                   1
        ------------------------------------------------------------
        sys_perf_event_open: pid 20911  cpu -1  group_fd -1  flags 0x8
        <SNIP>
        ---- end ----
        Test backward reading from ring buffer: Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      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-kxv05kv9qwl5of7rzfeiiwbv@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0a241ef4
    • Wang Nan's avatar
      perf tests: Add test to check backward ring buffer · ee74701e
      Wang Nan authored
      This test checks reading from backward ring buffer.
      
      Test result:
      
        # ~/perf test 'ring buffer'
        45: Test backward reading from ring buffer                   : Ok
      
      The test case is a while loop which calls prctl(PR_SET_NAME) multiple
      times.  Each prctl should issue 2 events: one PERF_RECORD_SAMPLE, one
      PERF_RECORD_COMM.
      
      The first round creates a relative large ring buffer (256 pages). It can
      afford all events. Read from it and check the count of each type of
      events.
      
      The second round creates a small ring buffer (1 page) and makes it
      overwritable. Check the correctness of the buffer.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1462758471-89706-3-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ee74701e
    • Wang Nan's avatar
      perf tools: Support reading from backward ring buffer · e24c7520
      Wang Nan authored
      perf_evlist__mmap_read_backward() is introduced for reading backward
      ring buffer. Since direction for reading such ring buffer is different
      from the direction kernel writing to it, and since user need to fetch
      most recent record from it, a perf_evlist__mmap_read_catchup() is
      introduced to move the reading pointer to the end of the buffer.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1462758471-89706-2-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e24c7520
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · b507146b
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes the following issues:
      
         - bug in ahash SG list walking that may lead to crashes
      
         - resource leak in qat
      
         - missing RSA dependency that causes it to fail"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: rsa - select crypto mgr dependency
        crypto: hash - Fix page length clamping in hash walk
        crypto: qat - fix adf_ctl_drv.c:undefined reference to adf_init_pf_wq
        crypto: qat - fix invalid pf2vf_resp_wq logic
      b507146b