06 Dec, 2016

2 commits

  • Clang doesn't support multiple arguments being passed to -Wp, so split
    them.

    Fixes this error:
    HOSTCC tools/objtool/fixdep.o
    cat: tools/objtool/.fixdep.o.d: No such file or directory

    Signed-off-by: Peter Foley
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20161128024346.17371-1-pefoley2@pefoley.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Peter Foley
     
  • The fixdep tool, among other things, replaces the target of the object
    in the gcc generated dependency output file.

    The parsing code assumes there's only single target in the rule but this
    is not always the case as described in here:

    https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html

    Make the fixdep code smart enough to skip all the possible targets.

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Foley
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20161201130025.GA16430@krava
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

02 Dec, 2016

13 commits

  • …ernel/git/acme/linux into perf/core

    Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

    New features:

    - Support AArch64 in the 'annotate' code, native/local and
    cross-arch/remote (Kim Phillips)

    - Allow considering just events in a given time interval, via the
    '--time start.s.ms,end.s.ms' command line, added to 'perf kmem',
    'perf report', 'perf sched timehist' and 'perf script' (David Ahern)

    - Add option to stop printing a callchain at one of a given group of
    symbol names (David Ahern)

    - Handle CPU migration events in 'perf sched timehist' (David Ahern)

    - Track memory freed in 'perf kmem stat' (David Ahern)

    Infrastructure:

    - Add initial support (and perf test entry) for tooling hooks, starting with
    'record_start' and 'record_end', that will have as its initial user the
    eBPF infrastructure, where perf_ prefixed functions will be JITed and
    run when such hooks are called (Wang Nan)

    - Remove redundant "test" and similar strings from 'perf test' descriptions
    (Arnaldo Carvalho de Melo)

    - Implement assorted libbpf improvements (Wang Nan)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Pull overlayfs fix from Miklos Szeredi:
    "This fixes a regression introduced in 4.8"

    * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
    ovl: fix d_real() for stacked fs

    Linus Torvalds
     
  • Pull input fixes from Dmitry Torokhov: "We are disabling automatic
    probing of BYD touchpads as it results in too many false positives,
    and the hardware is not terribly popular and having the protocol
    support does not result in significantly improved user experience.

    We also change keycode for KEY_DATA to avoid clashing with
    KEY_FASTREVERSE. Luckily this newish code is used by CEC framework
    that is still in staging, so it is extremely unlikely that someone has
    already started using this keycode"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: change KEY_DATA from 0x275 to 0x277
    Input: psmouse - disable automatic probing of BYD touchpads

    Linus Torvalds
     
  • Some people are able to trigger a race where autoksyms.h is used before
    its empty version is even created. Let's create it at the same time as
    the directory holding it is created.

    Signed-off-by: Nicolas Pitre
    Tested-by: Prarit Bhargava
    Tested-by: Jarod Wilson
    Signed-off-by: Linus Torvalds

    Nicolas Pitre
     
  • This is a regex converted version from the original:

    https://lkml.org/lkml/2016/5/19/461

    Add basic support to recognise AArch64 assembly. This allows perf to
    identify AArch64 instructions that branch to other parts within the
    same function, thereby properly annotating them.

    Rebased onto new cross-arch annotation bits:

    https://lkml.org/lkml/2016/11/25/546

    Sample output:

    security_file_permission vmlinux
    5.80 │ ← ret ▒
    │70: ldr w0, [x21,#68] ▒
    4.44 │ ↓ tbnz d0 ▒
    │ mov w0, #0x24 // #36 ▒
    1.37 │ ands w0, w22, w0 ▒
    │ ↑ b.eq 60 ▒
    1.37 │ ↓ tbnz e4 ▒
    │ mov w19, #0x20000 // #131072 ▒
    1.02 │ ↓ tbz ec ▒
    │90:┌─→ldr x3, [x21,#24] ▒
    1.37 │ │ add x21, x21, #0x10 ▒
    │ │ mov w2, w19 ▒
    1.02 │ │ mov x0, x21 ▒
    │ │ mov x1, x3 ▒
    1.71 │ │ ldr x20, [x3,#48] ▒
    │ │→ bl __fsnotify_parent ▒
    0.68 │ │↑ cbnz 60 ▒
    │ │ mov x2, x21 ▒
    1.37 │ │ mov w1, w19 ▒
    │ │ mov x0, x20 ▒
    0.68 │ │ mov w5, #0x0 // #0 ▒
    │ │ mov x4, #0x0 // #0 ▒
    1.71 │ │ mov w3, #0x1 // #1 ▒
    │ │→ bl fsnotify ▒
    1.37 │ │↑ b 60 ▒
    │d0:│ mov w0, #0x0 // #0 ▒
    │ │ ldp x19, x20, [sp,#16] ▒
    │ │ ldp x21, x22, [sp,#32] ▒
    │ │ ldp x29, x30, [sp],#48 ▒
    │ │← ret ▒
    │e4:│ mov w19, #0x10000 // #65536 ▒
    │ └──b 90 ◆
    │ec: brk #0x800 ▒
    Press 'h' for help on key bindings

    Signed-off-by: Kim Phillips
    Signed-off-by: Chris Ryder
    Cc: Alexander Shishkin
    Cc: Mark Rutland
    Cc: Pawel Moll
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/20161130092344.012e18e3e623bea395162f95@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kim Phillips
     
  • Presume neglected in commit 786c1b5 "perf annotate: Start supporting
    cross arch annotation". This doesn't fix a bug since none of the
    affected arches support parsing dec/inc instructions yet.

    Signed-off-by: Kim Phillips
    Cc: Alexander Shishkin
    Cc: Chris Ryder
    Cc: Mark Rutland
    Cc: Pawel Moll
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/20161130092333.1cca5dd2c77e1790d61c1e9c@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kim Phillips
     
  • Add option to allow user to control analysis window. e.g., collect data
    for time window and analyze a segment of interest within that window.

    Committer notes:

    Testing it:

    Using the perf.data file captured via 'perf kmem record':

    # perf report --header-only
    # ========
    # captured on: Tue Nov 29 16:01:53 2016
    # hostname : jouet
    # os release : 4.8.8-300.fc25.x86_64
    # perf version : 4.9.rc6.g5a6aca
    # arch : x86_64
    # nrcpus online : 4
    # nrcpus avail : 4
    # cpudesc : Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
    # cpuid : GenuineIntel,6,61,4
    # total memory : 20254660 kB
    # cmdline : /home/acme/bin/perf kmem record usleep 1
    # event : name = kmem:kmalloc, , id = { 931980, 931981, 931982, 931983 }, type = 2, size = 112, config = 0x1b9, { sample_period, sample_freq } = 1, sample_typ
    # event : name = kmem:kmalloc_node, , id = { 931984, 931985, 931986, 931987 }, type = 2, size = 112, config = 0x1b7, { sample_period, sample_freq } = 1, sampl
    # event : name = kmem:kfree, , id = { 931988, 931989, 931990, 931991 }, type = 2, size = 112, config = 0x1b5, { sample_period, sample_freq } = 1, sample_type
    # event : name = kmem:kmem_cache_alloc, , id = { 931992, 931993, 931994, 931995 }, type = 2, size = 112, config = 0x1b8, { sample_period, sample_freq } = 1, s
    # event : name = kmem:kmem_cache_alloc_node, , id = { 931996, 931997, 931998, 931999 }, type = 2, size = 112, config = 0x1b6, { sample_period, sample_freq } =
    # event : name = kmem:kmem_cache_free, , id = { 932000, 932001, 932002, 932003 }, type = 2, size = 112, config = 0x1b4, { sample_period, sample_freq } = 1, sa
    # HEADER_CPU_TOPOLOGY info available, use -I to display
    # HEADER_NUMA_TOPOLOGY info available, use -I to display
    # pmu mappings: cpu = 4, intel_pt = 7, intel_bts = 6, uncore_arb = 13, cstate_pkg = 15, breakpoint = 5, uncore_cbox_1 = 12, power = 9, software = 1, uncore_im
    # HEADER_CACHE info available, use -I to display
    # missing features: HEADER_BRANCH_STACK HEADER_GROUP_DESC HEADER_AUXTRACE HEADER_STAT
    # ========
    #
    # # Looking at just the histogram entries for the first event:
    #
    # perf report | head -33
    # To display the perf.data header info, please use --header/--header-only options.
    #
    #
    # Total Lost Samples: 0
    #
    # Samples: 40 of event 'kmem:kmalloc'
    # Event count (approx.): 40
    #
    # Overhead Trace output
    # ........ ...............................................................................................................
    #
    37.50% call_site=ffffffffb91ad3c7 ptr=0xffff88895fc05000 bytes_req=4096 bytes_alloc=4096 gfp_flags=GFP_KERNEL
    10.00% call_site=ffffffffb9258416 ptr=0xffff888a1dc61f00 bytes_req=240 bytes_alloc=256 gfp_flags=GFP_KERNEL|__GFP_ZERO
    7.50% call_site=ffffffffb9258416 ptr=0xffff888a2640ac00 bytes_req=240 bytes_alloc=256 gfp_flags=GFP_KERNEL|__GFP_ZERO
    2.50% call_site=ffffffffb92759ba ptr=0xffff888a26776000 bytes_req=4096 bytes_alloc=4096 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb9276864 ptr=0xffff8886f6b82600 bytes_req=136 bytes_alloc=192 gfp_flags=GFP_KERNEL|__GFP_ZERO
    2.50% call_site=ffffffffb9276903 ptr=0xffff888aefcf0460 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb92ad0ce ptr=0xffff888756c98a00 bytes_req=392 bytes_alloc=512 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb92ad0ce ptr=0xffff888756c9ba00 bytes_req=504 bytes_alloc=512 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb92ad301 ptr=0xffff888a31747600 bytes_req=128 bytes_alloc=128 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb92ad511 ptr=0xffff888a9d26a2a0 bytes_req=28 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c11a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c12c0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c1540 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c15a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c15e0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c16e0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff88873e8c1c20 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb936a7fb ptr=0xffff888a9d26a2a0 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL
    2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931240 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO
    2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931980 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO
    2.50% call_site=ffffffffb9373e66 ptr=0xffff8889f1931a00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_ATOMIC|__GFP_ZERO

    #
    # # And then limiting using the example for 'perf kmem stat --time' used
    # # in the previous changeset committer note we see that there were no
    # # kmem:kmalloc in that last part of the file, but there were some
    # # kmem:kmem_cache_alloc ones:
    #
    # perf report --time 20119.782088, --stdio
    #
    # Total Lost Samples: 0
    #
    # Samples: 0 of event 'kmem:kmalloc'
    # Event count (approx.): 0
    #
    # Overhead Trace output
    # ........ ............
    #

    # Samples: 0 of event 'kmem:kmalloc_node'
    # Event count (approx.): 0
    #
    # Overhead Trace output
    # ........ ............
    #

    # Samples: 0 of event 'kmem:kfree'
    # Event count (approx.): 0
    #
    # Overhead Trace output
    # ........ ............
    #

    # Samples: 8 of event 'kmem:kmem_cache_alloc'
    # Event count (approx.): 8
    #
    # Overhead Trace output
    # ........ ..................................................................................................................
    #
    75.00% call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    12.50% call_site=ffffffffb90ad33a ptr=0xffff8889f071f6e0 bytes_req=160 bytes_alloc=160 gfp_flags=GFP_ATOMIC|__GFP_NOTRACK
    12.50% call_site=ffffffffb9287cc1 ptr=0xffff8889b12722d8 bytes_req=104 bytes_alloc=104 gfp_flags=GFP_NOFS|__GFP_ZERO
    #

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-7-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Add option to allow user to control analysis window. e.g., collect data
    for time window and analyze a segment of interest within that window.

    Committer notes:

    Testing it:

    # perf kmem record usleep 1
    [ perf record: Woken up 0 times to write data ]
    [ perf record: Captured and wrote 1.540 MB perf.data (2049 samples) ]
    # perf evlist
    kmem:kmalloc
    kmem:kmalloc_node
    kmem:kfree
    kmem:kmem_cache_alloc
    kmem:kmem_cache_alloc_node
    kmem:kmem_cache_free
    # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events
    #
    # # Use 'perf script' to get a first approach, select a chunk for then using
    # # with 'perf kmem stat --time'
    #
    # perf script | tail -15
    usleep 9889 [0] 20119.782088: kmem:kmem_cache_free: (selinux_file_free_security+0x27) call_site=ffffffffb936aa07 ptr=0xffff888a1df49fc0
    perf 9888 [3] 20119.782088: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    perf 9888 [3] 20119.782089: kmem:kmem_cache_alloc: (jbd2__journal_start+0x72) call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    perf 9888 [3] 20119.782090: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    perf 9888 [3] 20119.782090: kmem:kmem_cache_alloc: (jbd2__journal_start+0x72) call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    usleep 9889 [0] 20119.782091: kmem:kmem_cache_alloc: (__sigqueue_alloc+0x4a) call_site=ffffffffb90ad33a ptr=0xffff8889f071f6e0 bytes_req=160 bytes_alloc=160 gfp_flags=GFP_ATOMIC|__GFP_NOTRACK
    perf 9888 [3] 20119.782091: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    perf 9888 [3] 20119.782093: kmem:kmem_cache_free: (__sigqueue_free.part.17+0x33) call_site=ffffffffb90ad3f3 ptr=0xffff8889f071f6e0
    perf 9888 [3] 20119.782098: kmem:kmem_cache_alloc: (jbd2__journal_start+0x72) call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    perf 9888 [3] 20119.782098: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    perf 9888 [3] 20119.782099: kmem:kmem_cache_alloc: (jbd2__journal_start+0x72) call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    perf 9888 [3] 20119.782100: kmem:kmem_cache_alloc: (alloc_buffer_head+0x21) call_site=ffffffffb9287cc1 ptr=0xffff8889b12722d8 bytes_req=104 bytes_alloc=104 gfp_flags=GFP_NOFS|__GFP_ZERO
    perf 9888 [3] 20119.782101: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    perf 9888 [3] 20119.782102: kmem:kmem_cache_alloc: (jbd2__journal_start+0x72) call_site=ffffffffb9333b42 ptr=0xffff888bdf1a39c0 bytes_req=48 bytes_alloc=48 gfp_flags=GFP_NOFS|__GFP_ZERO
    perf 9888 [3] 20119.782103: kmem:kmem_cache_free: (jbd2_journal_stop+0x1a1) call_site=ffffffffb9334581 ptr=0xffff888bdf1a39c0
    #
    # # stats for the whole perf.data file, i.e. no interval specified
    #
    # perf kmem stat

    SUMMARY (SLAB allocator)
    ========================
    Total bytes requested: 172,628
    Total bytes allocated: 173,088
    Total bytes freed: 161,280
    Net total bytes allocated: 11,808
    Total bytes wasted on internal fragmentation: 460
    Internal fragmentation: 0.265761%
    Cross CPU allocations: 0/851
    #
    # # stats for an end open interval, after a certain time:
    #
    # perf kmem stat --time 20119.782088,

    SUMMARY (SLAB allocator)
    ========================
    Total bytes requested: 552
    Total bytes allocated: 552
    Total bytes freed: 448
    Net total bytes allocated: 104
    Total bytes wasted on internal fragmentation: 0
    Internal fragmentation: 0.000000%
    Cross CPU allocations: 0/8
    #

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-6-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Add option to allow user to control analysis window. e.g., collect data
    for time window and analyze a segment of interest within that window.

    Committer notes:

    Testing it:

    # perf sched record -a usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.593 MB perf.data (25 samples) ]
    #
    # perf sched timehist | head -18
    Samples do not have callchains.
    time cpu task name wait time sch delay run time
    [tid/pid] (msec) (msec) (msec)
    ------------- ------ --------------- --------- --------- --------
    19818.635579 [0002] 0.000 0.000 0.000
    19818.635613 [0000] perf[9116] 0.000 0.000 0.000
    19818.635676 [0000] 0.000 0.000 0.063
    19818.635678 [0000] rcuos/2[29] 0.000 0.002 0.001
    19818.635696 [0002] perf[9117] 0.000 0.004 0.116
    19818.635702 [0000] 0.001 0.000 0.024
    19818.635709 [0002] migration/2[25] 0.000 0.003 0.012
    19818.636263 [0000] usleep[9117] 0.005 0.000 0.560
    19818.636316 [0000] 0.560 0.000 0.053
    19818.636358 [0002] 0.129 0.000 0.649
    19818.636358 [0000] usleep[9117] 0.053 0.002 0.042
    #

    # perf sched timehist --time 19818.635696,
    Samples do not have callchains.
    time cpu task name wait time sch delay run time
    [tid/pid] (msec) (msec) (msec)
    ------------- ------ --------------- -------- --------- ---------
    19818.635696 [0002] perf[9117] 0.000 0.120 0.000
    19818.635702 [0000] 0.019 0.000 0.006
    19818.635709 [0002] migration/2[25] 0.000 0.003 0.012
    19818.636263 [0000] usleep[9117] 0.005 0.000 0.560
    19818.636316 [0000] 0.560 0.000 0.053
    19818.636358 [0002] 0.129 0.000 0.649
    19818.636358 [0000] usleep[9117] 0.053 0.002 0.042
    #
    # perf sched timehist --time 19818.635696,19818.635709
    Samples do not have callchains.
    time cpu task name wait time sch delay run time
    [tid/pid] (msec) (msec) (msec)
    ------------- ------ --------------- --------- --------- ---------
    19818.635696 [0002] perf[9117] 0.000 0.120 0.000
    19818.635702 [0000] 0.019 0.000 0.006
    19818.635709 [0002] migration/2[25] 0.000 0.003 0.012
    19818.635709 [0000] usleep[9117] 0.005 0.000 0.006
    #

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-5-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Add option to allow user to control analysis window. e.g., collect data
    for some amount of time and analyze a segment of interest within that
    window.

    Committer notes:

    Testing it:

    # perf evlist -v
    cycles:ppp: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CALLCHAIN|CPU|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1
    #
    # perf script --hide-call-graph | head -15
    swapper 0 [0] 9693.370039: 1 cycles:ppp: ffffffffb90072ad x86_pmu_enable (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370044: 1 cycles:ppp: ffffffffb900ca1b intel_pmu_handle_irq (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370046: 7 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370048: 126 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370049: 2701 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370051: 58823 cycles:ppp: ffffffffb90cd2e0 idle_cpu (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370059: 1 cycles:ppp: ffffffffb91a713a ctx_resched (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370062: 1 cycles:ppp: ffffffffb900ca1b intel_pmu_handle_irq (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370064: 13 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370065: 250 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370067: 5269 cycles:ppp: ffffffffb902fe79 sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370069: 114602 cycles:ppp: ffffffffb90c1c5a atomic_notifier_call_chain (.../4.8.8-300.fc25.x86_64/vmlinux)
    perf 5124 [2] 9693.370076: 1 cycles:ppp: ffffffffb91a76c1 __perf_event_enable (.../4.8.8-300.fc25.x86_64/vmlinux)
    perf 5124 [2] 9693.370091: 1 cycles:ppp: ffffffffb900ca1b intel_pmu_handle_irq (.../4.8.8-300.fc25.x86_64/vmlinux)
    perf 5124 [2] 9693.370095: 3 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    #
    # perf script --hide-call-graph --time ,9693.370048
    swapper 0 [0] 9693.370039: 1 cycles:ppp: ffffffffb90072ad x86_pmu_enable (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370044: 1 cycles:ppp: ffffffffb900ca1b intel_pmu_handle_irq (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [0] 9693.370046: 7 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    # perf script --hide-call-graph --time 9693.370064,9693.370076
    swapper 0 [1] 9693.370064: 13 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370065: 250 cycles:ppp: ffffffffb902fd93 native_sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370067: 5269 cycles:ppp: ffffffffb902fe79 sched_clock (.../4.8.8-300.fc25.x86_64/vmlinux)
    swapper 0 [1] 9693.370069: 114602 cycles:ppp: ffffffffb90c1c5a atomic_notifier_call_chain (.../4.8.8-300.fc25.x86_64/vmlinux)
    #

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-4-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Code move only; no functional change intended.

    Committer notes:

    Fix the build on Ubuntu 16.04 x86-64 cross-compiling to S/390, with this
    set of auto-detected features:

    ... dwarf: [ on ]
    ... dwarf_getlocations: [ on ]
    ... glibc: [ on ]
    ... gtk2: [ OFF ]
    ... libaudit: [ OFF ]
    ... libbfd: [ OFF ]
    ... libelf: [ on ]
    ... libnuma: [ OFF ]
    ... numa_num_possible_cpus: [ OFF ]
    ... libperl: [ OFF ]
    ... libpython: [ OFF ]
    ... libslang: [ OFF ]
    ... libcrypto: [ OFF ]
    ... libunwind: [ OFF ]
    ... libdw-dwarf-unwind: [ on ]
    ... zlib: [ on ]
    ... lzma: [ OFF ]
    ... get_cpuid: [ OFF ]
    ... bpf: [ on ]

    Where it was failing with:

    CC /tmp/build/perf/util/time-utils.o
    util/time-utils.c: In function 'parse_nsec_time':
    util/time-utils.c:17:13: error: implicit declaration of function 'strtoul' [-Werror=implicit-function-declaration]
    time_sec = strtoul(str, &end, 10);
    ^
    util/time-utils.c:17:2: error: nested extern declaration of 'strtoul' [-Werror=nested-externs]
    time_sec = strtoul(str, &end, 10);
    ^
    util/time-utils.c: In function 'perf_time__parse_str':
    util/time-utils.c:93:2: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
    free(str);
    ^
    util/time-utils.c:93:2: error: incompatible implicit declaration of built-in function 'free' [-Werror]
    util/time-utils.c:93:2: note: include '' or provide a declaration of 'free'

    Do as suggested and add a '#include ' to get the free() and strtoul()
    declarations and fix the build.

    Signed-off-by: David Ahern
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-3-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Add function to parse a user time string of the form ,
    where start and stop are time in sec.nsec format. Both start and stop
    times are optional.

    Add function to determine if a sample time is within a given time
    time window of interest.

    Signed-off-by: David Ahern
    Acked-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480439746-42695-2-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

01 Dec, 2016

12 commits

  • Merge misc fixes from Andrew Morton:
    "7 fixes"

    * emailed patches from Andrew Morton :
    mm: fix false-positive WARN_ON() in truncate/invalidate for hugetlb
    kasan: support use-after-scope detection
    kasan: update kasan_global for gcc 7
    lib/debugobjects: export for use in modules
    zram: fix unbalanced idr management at hot removal
    thp: fix corner case of munlock() of PTE-mapped THPs
    mm, thp: propagation of conditional compilation in khugepaged.c

    Linus Torvalds
     
  • Hugetlb pages have ->index in size of the huge pages (PMD_SIZE or
    PUD_SIZE), not in PAGE_SIZE as other types of pages. This means we
    cannot user page_to_pgoff() to check whether we've got the right page
    for the radix-tree index.

    Let's introduce page_to_index() which would return radix-tree index for
    given page.

    We will be able to get rid of this once hugetlb will be switched to
    multi-order entries.

    Fixes: fc127da085c2 ("truncate: handle file thp")
    Link: http://lkml.kernel.org/r/20161123093053.mjbnvn5zwxw5e6lk@black.fi.intel.com
    Signed-off-by: Kirill A. Shutemov
    Reported-by: Doug Nelson
    Tested-by: Doug Nelson
    Reviewed-by: Naoya Horiguchi
    Cc: [4.8+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Gcc revision 241896 implements use-after-scope detection. Will be
    available in gcc 7. Support it in KASAN.

    Gcc emits 2 new callbacks to poison/unpoison large stack objects when
    they go in/out of scope. Implement the callbacks and add a test.

    [dvyukov@google.com: v3]
    Link: http://lkml.kernel.org/r/1479998292-144502-1-git-send-email-dvyukov@google.com
    Link: http://lkml.kernel.org/r/1479226045-145148-1-git-send-email-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov
    Acked-by: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: [4.0+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     
  • kasan_global struct is part of compiler/runtime ABI. gcc revision
    241983 has added a new field to kasan_global struct. Update kernel
    definition of kasan_global struct to include the new field.

    Without this patch KASAN is broken with gcc 7.

    Link: http://lkml.kernel.org/r/1479219743-28682-1-git-send-email-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov
    Acked-by: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: [4.0+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     
  • Drivers, or other modules, that use a mixture of objects (especially
    objects embedded within other objects) would like to take advantage of
    the debugobjects facilities to help catch misuse. Currently, the
    debugobjects interface is only available to builtin drivers and requires
    a set of EXPORT_SYMBOL_GPL for use by modules.

    I am using the debugobjects in i915.ko to try and catch some invalid
    operations on embedded objects. The problem currently only presents
    itself across module unload so forcing i915 to be builtin is not an
    option.

    Link: http://lkml.kernel.org/r/20161122143039.6433-1-chris@chris-wilson.co.uk
    Signed-off-by: Chris Wilson
    Cc: "Du, Changbin"
    Cc: Thomas Gleixner
    Cc: Christian Borntraeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Wilson
     
  • The zram hot removal code calls idr_remove() even when zram_remove()
    returns an error (typically -EBUSY). This results in a leftover at the
    device release, eventually leading to a crash when the module is
    reloaded.

    As described in the bug report below, the following procedure would
    cause an Oops with zram:

    - provision three zram devices via modprobe zram num_devices=3
    - configure a size for each device
    + echo "1G" > /sys/block/$zram_name/disksize
    - mkfs and mount zram0 only
    - attempt to hot remove all three devices
    + echo 2 > /sys/class/zram-control/hot_remove
    + echo 1 > /sys/class/zram-control/hot_remove
    + echo 0 > /sys/class/zram-control/hot_remove
    - zram0 removal fails with EBUSY, as expected
    - unmount zram0
    - try zram0 hot remove again
    + echo 0 > /sys/class/zram-control/hot_remove
    - fails with ENODEV (unexpected)
    - unload zram kernel module
    + completes successfully
    - zram0 device node still exists
    - attempt to mount /dev/zram0
    + mount command is killed
    + following BUG is encountered

    BUG: unable to handle kernel paging request at ffffffffa0002ba0
    IP: get_disk+0x16/0x50
    Oops: 0000 [#1] SMP
    CPU: 0 PID: 252 Comm: mount Not tainted 4.9.0-rc6 #176
    Call Trace:
    exact_lock+0xc/0x20
    kobj_lookup+0xdc/0x160
    get_gendisk+0x2f/0x110
    __blkdev_get+0x10c/0x3c0
    blkdev_get+0x19d/0x2e0
    blkdev_open+0x56/0x70
    do_dentry_open.isra.19+0x1ff/0x310
    vfs_open+0x43/0x60
    path_openat+0x2c9/0xf30
    do_filp_open+0x79/0xd0
    do_sys_open+0x114/0x1e0
    SyS_open+0x19/0x20
    entry_SYSCALL_64_fastpath+0x13/0x94

    This patch adds the proper error check in hot_remove_store() not to call
    idr_remove() unconditionally.

    Fixes: 17ec4cd98578 ("zram: don't call idr_remove() from zram_remove()")
    Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1010970
    Link: http://lkml.kernel.org/r/20161121132140.12683-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Reviewed-by: David Disseldorp
    Reported-by: David Disseldorp
    Tested-by: David Disseldorp
    Acked-by: Minchan Kim
    Acked-by: Sergey Senozhatsky
    Cc: [4.4+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • The following program triggers BUG() in munlock_vma_pages_range():

    // autogenerated by syzkaller (http://github.com/google/syzkaller)
    #include

    int main()
    {
    mmap((void*)0x20105000ul, 0xc00000ul, 0x2ul, 0x2172ul, -1, 0);
    mremap((void*)0x201fd000ul, 0x4000ul, 0xc00000ul, 0x3ul, 0x203f0000ul);
    return 0;
    }

    The test-case constructs the situation when munlock_vma_pages_range()
    finds PTE-mapped THP-head in the middle of page table and, by mistake,
    skips HPAGE_PMD_NR pages after that.

    As result, on the next iteration it hits the middle of PMD-mapped THP
    and gets upset seeing mlocked tail page.

    The solution is only skip HPAGE_PMD_NR pages if the THP was mlocked
    during munlock_vma_page(). It would guarantee that the page is
    PMD-mapped as we never mlock PTE-mapeed THPs.

    Fixes: e90309c9f772 ("thp: allow mlocked THP again")
    Link: http://lkml.kernel.org/r/20161115132703.7s7rrgmwttegcdh4@black.fi.intel.com
    Signed-off-by: Kirill A. Shutemov
    Reported-by: Dmitry Vyukov
    Cc: Konstantin Khlebnikov
    Cc: Andrey Ryabinin
    Cc: syzkaller
    Cc: Andrea Arcangeli
    Cc: [4.5+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Commit b46e756f5e47 ("thp: extract khugepaged from mm/huge_memory.c")
    moved code from huge_memory.c to khugepaged.c. Some of this code should
    be compiled only when CONFIG_SYSFS is enabled but the condition around
    this code was not moved into khugepaged.c.

    The result is a compilation error when CONFIG_SYSFS is disabled:

    mm/built-in.o: In function `khugepaged_defrag_store': khugepaged.c:(.text+0x2d095): undefined reference to `single_hugepage_flag_store'
    mm/built-in.o: In function `khugepaged_defrag_show': khugepaged.c:(.text+0x2d0ab): undefined reference to `single_hugepage_flag_show'

    This commit adds the #ifdef CONFIG_SYSFS around the code related to
    sysfs.

    Link: http://lkml.kernel.org/r/20161114203448.24197-1-jeremy.lefaure@lse.epita.fr
    Signed-off-by: Jérémy Lefaure
    Acked-by: Kirill A. Shutemov
    Acked-by: Hillf Danton
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jérémy Lefaure
     
  • Pull clk fixes from Stephen Boyd:
    "Two small fixes for MIPI PLLs on sunxi devices and a build fix for a
    Broadcom clk driver having unmet dependencies"

    * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
    clk: bcm: Fix unmet Kconfig dependencies for CLK_BCM_63XX
    clk: sunxi-ng: enable so-said LDOs for A33 SoC's pll-mipi clock
    clk: sunxi-ng: sun6i-a31: Enable PLL-MIPI LDOs when ungating it

    Linus Torvalds
     
  • Pull pwm fixes from Thierry Reding:
    "This contains two one-line fixes for issues that were introduced in
    v4.9-rc1"

    * tag 'pwm/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
    pwm: Fix device reference leak
    pwm: meson: Add missing spin_lock_init()

    Linus Torvalds
     
  • The ER records are printed without explicit log level presuming line
    continuation until "\n". After the commit 4bcc595ccd8 (printk:
    reinstate KERN_CONT for printing continuation lines), the ER records are
    printed a character per line.

    Adding KERN_CONT to appropriate printk statements restores the printout
    behavior.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • 0x275 is used by KEY_FASTREVERSE.

    Fixes: 488326947cd1 ("Input: add HDMI CEC specific keycodes")
    Signed-off-by: Ping Cheng
    Acked-by: Hans Verkuil
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov

    Ping Cheng
     

30 Nov, 2016

7 commits

  • Pull ARC fixes from Vineet Gupta:

    - fix PAE40 crash [Yuriy]

    - disable IO-Coherency by default

    - use a different inline asm constraint for Zero Overhead loops

    * tag 'arc-4.9-final' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
    ARC: mm: PAE40: Fix crash at munmap
    ARC: mm: IOC: Don't enable IOC by default
    ARC: Don't use "+l" inline asm constraint

    Linus Torvalds
     
  • This enables CONFIG_MODVERSIONS again, but allows for missing symbol CRC
    information in order to work around the issue that newer binutils
    versions seem to occasionally drop the CRC on the floor. binutils 2.26
    seems to work fine, while binutils 2.27 seems to break MODVERSIONS of
    symbols that have been defined in assembler files.

    [ We've had random missing CRC's before - it may be an old problem that
    just is now reliably triggered with the weak asm symbols and a new
    version of binutils ]

    Some day I really do want to remove MODVERSIONS entirely. Sadly, today
    does not appear to be that day: Debian people apparently do want the
    option to enable MODVERSIONS to make it easier to have external modules
    across kernel versions, and this seems to be a fairly minimal fix for
    the annoying problem.

    Cc: Ben Hutchings
    Acked-by: Michal Marek
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull CIFS fixes from Steve French:
    "A few misc important cifs fixes, including a fix for a 4.9 regression
    in posix_acl xattr handling"

    * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
    CIFS: iterate over posix acl xattr entry correctly in ACL_to_cifs_posix()
    Call echo service immediately after socket reconnect
    CIFS: Fix BUG() in calc_seckey()

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "Four small fixes.

    The be2iscsi is a potential device overrun in consistent memory, which
    could have nasty consequences if the consistent allocations are
    packed.

    The hpsa one fixes a regression where older controllers can now get a
    numbering clash between the first internal disk and the controller.

    The libfc one is a regression in timespec conversions which causes a
    user visible issue in a command line tool and the mpt3sas one fixes a
    regression where the controller could remain permanently blocked after
    an ATA pass through command followed by a reset"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo()
    scsi: mpt3sas: Unblock device after controller reset
    scsi: hpsa: use bus '3' for legacy HBA devices
    scsi: libfc: fix seconds_since_last_reset miscalculation

    Linus Torvalds
     
  • commit 1c3c90930392 broke PAE40. Macro pfn_pte(pfn, prot) creates paddr
    from pfn, but the page shift was getting truncated to 32 bits since we lost
    the proper cast to 64 bits (for PAE400

    Instead of reverting that commit, use a better helper which is 32/64 bits
    safe just like ARM implementation.

    Fixes: 1c3c90930392 ("ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS")
    Cc: #4.4+
    Signed-off-by: Yuriy Kolerov
    [vgupta: massaged changelog]
    Signed-off-by: Vineet Gupta

    Yuriy Kolerov
     
  • Linus found there still is a race in mremap after commit 5d1904204c99
    ("mremap: fix race between mremap() and page cleanning").

    As described by Linus:
    "the issue is that another thread might make the pte be dirty (in the
    hardware walker, so no locking of ours will make any difference)
    *after* we checked whether it was dirty, but *before* we removed it
    from the page tables"

    Fix it by moving the check after we removed it from the page table.

    Suggested-by: Linus Torvalds
    Signed-off-by: Aaron Lu
    Signed-off-by: Linus Torvalds

    Aaron Lu
     
  • Allow user to specify list of symbols which cause the dump of callchains
    to stop at that symbol.

    Committer notes:

    Testing it:

    # perf record -ag usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.177 MB perf.data (33 samples) ]
    #
    # # Without it:
    #
    # perf script
    swapper 0 [000] 9693.370039: 1 cycles:ppp:
    2072ad x86_pmu_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a29d7 perf_pmu_enable.part.90 (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a713a ctx_resched (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a76c1 __perf_event_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a0390 event_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a1cff remote_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    326978 flush_smp_call_function_queue (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    327413 generic_smp_call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    249b37 smp_call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    a04b2c call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    889427 cpuidle_enter (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    2e534a call_cpuidle (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    2e5730 cpu_startup_entry (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    9f5167 rest_init (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    137ffeb start_kernel ([kernel.vmlinux].init.text)
    137f2ca x86_64_start_reservations ([kernel.vmlinux].init.text)
    137f419 x86_64_start_kernel ([kernel.vmlinux].init.text)

    swapper 0 [000] 9693.370044: 1 cycles:ppp:
    20ca1b intel_pmu_handle_irq (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    205b0c perf_event_nmi_handler (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a14a nmi_handle (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a6b3 default_do_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a83c do_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    a03fb1 end_repeat_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a29d7 perf_pmu_enable.part.90 (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a713a ctx_resched (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a76c1 __perf_event_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a0390 event_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a1cff remote_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    326978 flush_smp_call_function_queue (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    327413 generic_smp_call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    249b37 smp_call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    a04b2c call_function_single_interrupt (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    889427 cpuidle_enter (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    2e534a call_cpuidle (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    2e5730 cpu_startup_entry (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    9f5167 rest_init (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    137ffeb start_kernel ([kernel.vmlinux].init.text)
    137f2ca x86_64_start_reservations ([kernel.vmlinux].init.text)
    #
    # # Using it to see just what are the calls from the 'remote_function' function:
    #
    # perf script --stop-bt remote_function
    swapper 0 [000] 9693.370039: 1 cycles:ppp:
    2072ad x86_pmu_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a29d7 perf_pmu_enable.part.90 (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a713a ctx_resched (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a76c1 __perf_event_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a0390 event_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a1cff remote_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)

    swapper 0 [000] 9693.370044: 1 cycles:ppp:
    20ca1b intel_pmu_handle_irq (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    205b0c perf_event_nmi_handler (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a14a nmi_handle (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a6b3 default_do_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    22a83c do_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    a03fb1 end_repeat_nmi (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a29d7 perf_pmu_enable.part.90 (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a713a ctx_resched (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a76c1 __perf_event_enable (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a0390 event_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)
    3a1cff remote_function (/usr/lib/debug/lib/modules/4.8.8-300.fc25.x86_64/vmlinux)

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480104021-36275-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

29 Nov, 2016

6 commits

  • Track freed memory as well as allocations and show the net in the
    summary.

    Committer notes:

    Testing it:

    # perf kmem record usleep 1
    [ perf record: Woken up 0 times to write data ]
    [ perf record: Captured and wrote 1.626 MB perf.data (4208 samples) ]
    [root@jouet ~]# perf kmem stat --slab

    SUMMARY (SLAB allocator)
    ========================
    Total bytes requested: 234,011
    Total bytes allocated: 234,504
    Total bytes freed: 213,328
    Tested-by: Arnaldo Carvalho de Melo
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480110133-37039-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Having "test" in almost all test descriptions is redundant, simplify it
    removing and rewriting tests with such descriptions.

    End result:

    # perf test
    1: vmlinux symtab matches kallsyms : Ok
    2: Detect openat syscall event : Ok
    3: Detect openat syscall event on all cpus : Ok
    4: Read samples using the mmap interface : Ok
    5: Parse event definition strings : Ok
    6: PERF_RECORD_* events & perf_sample fields : Ok
    7: Parse perf pmu format : Ok
    8: DSO data read : Ok
    9: DSO data cache : Ok
    10: DSO data reopen : Ok
    11: Roundtrip evsel->name : Ok
    12: Parse sched tracepoints fields : Ok
    13: syscalls:sys_enter_openat event fields : Ok
    14: Setup struct perf_event_attr : Ok
    15: Match and link multiple hists : Ok
    16: 'import perf' in python : Ok
    17: Breakpoint overflow signal handler : Ok
    18: Breakpoint overflow sampling : Ok
    19: Number of exit events of a simple workload : Ok
    20: Software clock events period values : Ok
    21: Object code reading : Ok
    22: Sample parsing : Ok
    23: Use a dummy software event to keep tracking: Ok
    24: Parse with no sample_id_all bit set : Ok
    25: Filter hist entries : Ok
    26: Lookup mmap thread : Ok
    27: Share thread mg : Ok
    28: Sort output of hist entries : Ok
    29: Cumulate child hist entries : Ok
    30: Track with sched_switch : Ok
    31: Filter fds with revents mask in a fdarray : Ok
    32: Add fd to a fdarray, making it autogrow : Ok
    33: kmod_path__parse : Ok
    34: Thread map : Ok
    35: LLVM search and compile :
    35.1: Basic BPF llvm compile : Ok
    35.2: kbuild searching : Ok
    35.3: Compile source for BPF prologue generation: Ok
    35.4: Compile source for BPF relocation : Ok
    36: Session topology : Ok
    37: BPF filter :
    37.1: Basic BPF filtering : Ok
    37.2: BPF prologue generation : Ok
    37.3: BPF relocation checker : Ok
    38: Synthesize thread map : Ok
    39: Synthesize cpu map : Ok
    40: Synthesize stat config : Ok
    41: Synthesize stat : Ok
    42: Synthesize stat round : Ok
    43: Synthesize attr update : Ok
    44: Event times : Ok
    45: Read backward ring buffer : Ok
    46: Print cpu map : Ok
    47: Probe SDT events : Ok
    48: is_printable_array : Ok
    49: Print bitmap : Ok
    50: perf hooks : Ok
    51: x86 rdpmc : Ok
    52: Convert perf time to TSC : Ok
    53: DWARF unwind : Ok
    54: x86 instruction decoder - new instructions : Ok
    55: Intel cqm nmi context read : Skip
    #

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-rx2lbfcrrio2yx1fxcljqy0e@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Make sure to drop the reference to the parent device taken by
    class_find_device() after "unexporting" any children when deregistering
    a PWM chip.

    Fixes: 0733424c9ba9 ("pwm: Unexport children before chip removal")
    Signed-off-by: Johan Hovold
    Signed-off-by: Thierry Reding

    Johan Hovold
     
  • Perf hooks allow hooking user code at perf events. They can be used for
    manipulation of BPF maps, taking snapshot and reporting results. In this
    patch two perf hook points are introduced: record_start and record_end.

    To avoid buggy user actions, a SIGSEGV signal handler is introduced into
    'perf record'. It turns off perf hook if it causes a segfault and report
    an error to help debugging.

    A test case for perf hook is introduced.

    Test result:
    $ ./buildperf/perf test -v hook
    50: Test perf hooks :
    --- start ---
    test child forked, pid 10311
    SIGSEGV is observed as expected, try to recover.
    Fatal error (SEGFAULT) in perf hook 'test'
    test child finished with 0
    ---- end ----
    Test perf hooks: Ok

    Signed-off-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161126070354.141764-5-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • Add a new API to libbpf, caller is able to get bpf_map through the
    offset of bpf_map_def to 'maps' section.

    The API will be used to help jitted perf hook code find fd of a map.

    Signed-off-by: Wang Nan
    Acked-by: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161126070354.141764-4-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • Similar to other classes defined in libbpf.h (map and program), allow
    'object' class has its own private data.

    Signed-off-by: Wang Nan
    Acked-by: Alexei Starovoitov
    Cc: He Kuang
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161126070354.141764-3-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan