1. 11 May, 2016 12 commits
  2. 10 May, 2016 18 commits
  3. 09 May, 2016 10 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
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 26acc792
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Check klogctl failure correctly, from Colin Ian King.
      
       2) Prevent OOM when under memory pressure in flowcache, from Steffen
          Klassert.
      
       3) Fix info leak in llc and rtnetlink ifmap code, from Kangjie Lu.
      
       4) Memory barrier and multicast handling fixes in bnxt_en, from Michael
          Chan.
      
       5) Endianness bug in mlx5, from Daniel Jurgens.
      
       6) Fix disconnect handling in VSOCK, from Ian Campbell.
      
       7) Fix locking of netdev list walking in get_bridge_ifindices(), from
          Nikolay Aleksandrov.
      
       8) Bridge multicast MLD parser can look at wrong packet offsets, fix
          from Linus Lüssing.
      
       9) Fix chip hang in qede driver, from Sudarsana Reddy Kalluru.
      
      10) Fix missing setting of encapsulation before inner handling completes
          in udp_offload code, from Jarno Rajahalme.
      
      11) Missing rollbacks during LAG join and flood configuration failures
          in mlxsw driver, from Ido Schimmel.
      
      12) Fix error code checks in netxen driver, from Dan Carpenter.
      
      13) Fix key size in new macsec driver, from Sabrina Dubroca.
      
      14) Fix mlx5/VXLAN dependencies, from Arnd Bergmann.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (29 commits)
        net/mlx5e: make VXLAN support conditional
        Revert "net/mlx5: Kconfig: Fix MLX5_EN/VXLAN build issue"
        macsec: key identifier is 128 bits, not 64
        Documentation/networking: more accurate LCO explanation
        macvtap: segmented packet is consumed
        tools: bpf_jit_disasm: check for klogctl failure
        qede: uninitialized variable in qede_start_xmit()
        netxen: netxen_rom_fast_read() doesn't return -1
        netxen: reversed condition in netxen_nic_set_link_parameters()
        netxen: fix error handling in netxen_get_flash_block()
        mlxsw: spectrum: Add missing rollback in flood configuration
        mlxsw: spectrum: Fix rollback order in LAG join failure
        udp_offload: Set encapsulation before inner completes.
        udp_tunnel: Remove redundant udp_tunnel_gro_complete().
        qede: prevent chip hang when increasing channels
        net: ipv6: tcp reset, icmp need to consider L3 domain
        bridge: fix igmp / mld query parsing
        net: bridge: fix old ioctl unlocked net device walk
        VSOCK: do not disconnect socket when peer has shutdown SEND only
        net/mlx4_en: Fix endianness bug in IPV6 csum calculation
        ...
      26acc792
    • Josh Poimboeuf's avatar
      compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() · 8634de6d
      Josh Poimboeuf authored
      gcc support for __builtin_bswap16() was supposedly added for powerpc in
      gcc 4.6, and was then later added for other architectures in gcc 4.8.
      
      However, Stephen Rothwell reported that attempting to use it on powerpc
      in gcc 4.6 fails with:
      
        lib/vsprintf.c:160:2: error: initializer element is not constant
        lib/vsprintf.c:160:2: error: (near initialization for 'decpair[0]')
        lib/vsprintf.c:160:2: error: initializer element is not constant
        lib/vsprintf.c:160:2: error: (near initialization for 'decpair[1]')
        ...
      
      I'm not entirely sure what those errors mean, but I don't see them on
      gcc 4.8.  So let's consider gcc 4.8 to be the official starting point
      for __builtin_bswap16().
      
      Arnd Bergmann adds:
       "I found the commit in gcc-4.8 that replaced the powerpc-specific
        implementation of __builtin_bswap16 with an architecture-independent
        one.  Apparently the powerpc version (gcc-4.6 and 4.7) just mapped to
        the lhbrx/sthbrx instructions, so it ended up not being a constant,
        though the intent of the patch was mainly to add support for the
        builtin to x86:
      
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624
      
        has the patch that went into gcc-4.8 and more information."
      
      Fixes: 7322dd75 ("byteswap: try to avoid __builtin_constant_p gcc bug")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Tested-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8634de6d
    • Chris Phlipot's avatar
      perf script: Fix incorrect python db-export error message · aff63340
      Chris Phlipot authored
      Fix the error message printed when attempting and failing to create the
      call path root incorrectly references the call return process.
      
      This change fixes the message to properly reference the failure to
      create the call path root.
      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-2-git-send-email-cphlipot0@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aff63340
    • Andi Kleen's avatar
      perf stat: Scale values by unit before metrics · f340c5fc
      Andi Kleen authored
      Scale values by unit before passing them to the metrics printing
      functions.  This is needed for TopDown, because it needs to scale the
      slots correctly by pipeline width / SMTness.
      
      For existing metrics it shouldn't make any difference, as those
      generally use events that don't have any units.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1462489447-31832-8-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f340c5fc
    • He Kuang's avatar
      perf callchain: Recording 'dwarf' callchains do not need DWARF unwinding support · 841e3558
      He Kuang authored
      There is no need to check for DWARF unwinding support when using the
      'dwarf' callchain record method, as this will only ask the kernel to
      collect stack dumps for later DWARF CFI processing, which can be done in
      another machine, where the support for DWARF unwinding need to be
      present.
      Signed-off-by: default avatarHe Kuang <hekuang@huawei.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1462525154-125656-2-git-send-email-hekuang@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      841e3558