25 Jul, 2018

1 commit

  • We want to allow having mixed events with/without callchains, not
    using a global flag to show callchains, but allowing supressing
    callchains when they are present.

    So invert the logic of the last parameter to hists__fprint() to
    that effect.

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

    Arnaldo Carvalho de Melo
     

07 Nov, 2017

1 commit

  • Conflicts:
    tools/perf/arch/arm/annotate/instructions.c
    tools/perf/arch/arm64/annotate/instructions.c
    tools/perf/arch/powerpc/annotate/instructions.c
    tools/perf/arch/s390/annotate/instructions.c
    tools/perf/arch/x86/tests/intel-cqm.c
    tools/perf/ui/tui/progress.c
    tools/perf/util/zlib.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

31 Oct, 2017

2 commits

  • Add struct perf_data_file to represent a single file within a perf_data
    struct.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Changbin Du
    Cc: David Ahern
    Cc: Jin Yao
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org
    [ Fixup recent changes in 'perf script --per-event-dump' ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Rename struct perf_data_file to perf_data, because we will add the
    possibility to have multiple files under perf.data, so the 'perf_data'
    name fits better.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Changbin Du
    Cc: David Ahern
    Cc: Jin Yao
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-39wn4d77phel3dgkzo3lyan0@git.kernel.org
    [ Fixup recent changes in 'perf script --per-event-dump' ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

27 Jun, 2017

1 commit


20 Apr, 2017

2 commits

  • Removing it from util.h, part of an effort to disentangle the includes
    hell, that makes changes to util.h or something included by it to cause
    a complete rebuild of the tools.

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

    Arnaldo Carvalho de Melo
     
  • Needed to use the PRI[xu](32,64) formatting macros.

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

    Arnaldo Carvalho de Melo
     

27 Mar, 2017

1 commit

  • We got it from the git sources but never used it for anything, with the
    place where this would be somehow used remaining:

    static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
    {
    prefix = NULL;
    if (p->option & RUN_SETUP)
    prefix = NULL; /* setup_perf_directory(); */

    Ditch it.

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

    Arnaldo Carvalho de Melo
     

14 Mar, 2017

1 commit

  • Introduce a new option to record PERF_RECORD_NAMESPACES events emitted
    by the kernel when fork, clone, setns or unshare are invoked. And update
    perf-record documentation with the new option to record namespace
    events.

    Committer notes:

    Combined it with a later patch to allow printing it via 'perf report -D'
    and be able to test the feature introduced in this patch. Had to move
    here also perf_ns__name(), that was introduced in another later patch.

    Also used PRIu64 and PRIx64 to fix the build in some enfironments wrt:

    util/event.c:1129:39: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'long long unsigned int' [-Werror=format=]
    ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx
    ^
    Testing it:

    # perf record --namespaces -a
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.083 MB perf.data (423 samples) ]
    #
    # perf report -D

    3 2028902078892 0x115140 [0xa0]: PERF_RECORD_NAMESPACES 14783/14783 - nr_namespaces: 7
    [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
    4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]

    0x1151e0 [0x30]: event: 9
    .
    . ... raw event: size 48 bytes
    . 0000: 09 00 00 00 02 00 30 00 c4 71 82 68 0c 7f 00 00 ......0..q.h....
    . 0010: a9 39 00 00 a9 39 00 00 94 28 fe 63 d8 01 00 00 .9...9...(.c....
    . 0020: 03 00 00 00 00 00 00 00 ce c4 02 00 00 00 00 00 ................

    NAMESPACES events: 1

    #

    Signed-off-by: Hari Bathini
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Alexei Starovoitov
    Cc: Ananth N Mavinakayanahalli
    Cc: Aravinda Prasad
    Cc: Brendan Gregg
    Cc: Daniel Borkmann
    Cc: Eric Biederman
    Cc: Peter Zijlstra
    Cc: Sargun Dhillon
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/148891930386.25309.18412039920746995488.stgit@hbathini.in.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Hari Bathini
     

20 Feb, 2017

2 commits

  • The -q/--quiet option is to suppress any message. Sometimes users just
    want to see the numbers and it can be used for that case.

    Committer notes:

    Before:

    # perf diff | head -10
    Failed to open /tmp/perf-6678.map, continuing without symbols
    Failed to open /tmp/perf-6678.map, continuing without symbols
    Failed to open /tmp/perf-2646.map, continuing without symbols
    # Event 'cycles'
    #
    # Baseline Delta Abs Shared Object Symbol
    # ........ ......... .......................... ............................................
    #
    5.36% -1.76% [kernel.vmlinux] [k] intel_idle
    2.80% +1.48% firefox [.] 0x00000000000101fe
    57.12% -1.25% libxul.so [.] 0x00000000009bea92
    1.36% -1.11% [kernel.vmlinux] [k] __schedule
    4.26% -1.00% perf-6678.map [.] 0x00007fac4b0e9320

    After:

    # perf diff -q | head -10
    5.36% -1.76% [kernel.vmlinux] [k] intel_idle
    2.80% +1.48% firefox [.] 0x00000000000101fe
    57.12% -1.25% libxul.so [.] 0x00000000009bea92
    1.36% -1.11% [kernel.vmlinux] [k] __schedule
    4.26% -1.00% perf-6678.map [.] 0x00007fac4b0e9320
    1.86% +0.95% [kernel.vmlinux] [k] update_blocked_averages
    0.80% -0.70% [kernel.vmlinux] [k] native_sched_clock
    0.74% -0.58% [kernel.vmlinux] [k] native_write_msr
    0.76% -0.56% qemu-system-x86_64 [.] 0x00000000002395c0
    +0.54% libpulsecommon-10.0.so [.] 0x000000000002d91b
    #

    Signed-off-by: Namhyung Kim
    Suggested-and-Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20170217081742.17417-5-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • It now can have negative value to suppress the message entirely. So it
    needs to check it being positive.

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20170217081742.17417-3-namhyung@kernel.org
    [ Adjust fuzz on tools/perf/util/pmu.c, add > 0 checks in many other places ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

14 Feb, 2017

4 commits

  • The "delta-abs" compute method will show most changed entries on top.
    So users can easily see how much effect between the data. Note that it
    also changes the default of -o option to 1 in order to apply the compute
    method. To see original-style (sorted by baseline) use -o 0 option.

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170210161856.18422-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The diff.compute config variable is to set the default compute method of
    perf diff command (-c option). Possible values 'delta' (default),
    'delta-abs', 'ratio' and 'wdiff'.

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Link: http://lkml.kernel.org/r/20170210073614.24584-4-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • In many cases, I need to look at differences between two data so I often
    used the -o option to sort the result base on the difference first.
    It'd be nice to have a config option to set it by default.

    The diff.order config option is to set the default value of -o/--order
    option.

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Link: http://lkml.kernel.org/r/20170210073614.24584-3-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The 'delta-abs' compute method is same as 'delta' but shows entries with
    bigger absolute delta first instead of sorting numerically. This is
    only useful together with -o option.

    Below is default output (-c delta):

    $ perf diff -o 1 -c delta | grep -v ^# | head
    42.22% +4.97% [kernel.kallsyms] [k] cfb_imageblit
    0.62% +1.23% [kernel.kallsyms] [k] mutex_lock
    +1.15% [kernel.kallsyms] [k] copy_user_generic_string
    2.40% +0.95% [kernel.kallsyms] [k] bit_putcs
    0.31% +0.79% [kernel.kallsyms] [k] link_path_walk
    +0.64% [kernel.kallsyms] [k] kmem_cache_alloc
    0.00% +0.57% [kernel.kallsyms] [k] __rcu_read_unlock
    +0.45% [kernel.kallsyms] [k] alloc_set_pte
    0.16% +0.45% [kernel.kallsyms] [k] menu_select
    +0.41% ld-2.24.so [.] do_lookup_x

    Now with 'delta-abs' it shows entries have bigger delta value either
    positive or negative.

    $ perf diff -o 1 -c delta-abs | grep -v ^# | head
    42.22% +4.97% [kernel.kallsyms] [k] cfb_imageblit
    12.72% -3.01% [kernel.kallsyms] [k] intel_idle
    9.72% -1.31% [unknown] [.] 0x0000000000411343
    0.62% +1.23% [kernel.kallsyms] [k] mutex_lock
    2.40% +0.95% [kernel.kallsyms] [k] bit_putcs
    0.31% +0.79% [kernel.kallsyms] [k] link_path_walk
    1.35% -0.71% [kernel.kallsyms] [k] smp_call_function_single
    0.00% +0.57% [kernel.kallsyms] [k] __rcu_read_unlock
    0.16% +0.45% [kernel.kallsyms] [k] menu_select
    0.72% -0.44% [kernel.kallsyms] [k] lookup_fast

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170210073614.24584-2-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

02 Feb, 2017

1 commit

  • Commit 21e6d8428664 ("perf diff: Use perf_hpp__register_sort_field
    interface") changed list_add() to perf_hpp__register_sort_field().

    This resulted in a behavior change since the field was added to the tail
    instead of the head. So the -o option is mostly ignored due to its
    order in the list.

    This patch fixes it by adding perf_hpp__prepend_sort_field().

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Peter Zijlstra
    Fixes: 21e6d8428664 ("perf diff: Use perf_hpp__register_sort_field interface")
    Link: http://lkml.kernel.org/r/20170118051457.30946-2-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

24 Aug, 2016

2 commits

  • Add span argument for header callback function.

    The handling of this argument is completely in the hands of the
    callback. The only thing the caller ensures is it's zeroed on the
    beginning.

    Omitting span skipping in hierarchy headers and gtk code.

    The c2c code use this to span header lines based on the entries span
    configuration.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1470583710-1649-6-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Adding line argument into perf_hpp_fmt's header callback to be able to
    request specific header line.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1470583710-1649-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

23 Jun, 2016

1 commit


22 Jun, 2016

2 commits


15 Jun, 2016

3 commits

  • Replacing perf_evsel arg perf_hpp_fmt's width callback with hists
    object.

    This will be helpful in future for non evsel related hist browsers.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1465928361-2442-11-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Replacing perf_evsel arg perf_hpp_fmt's header callback with hists
    object.

    None of the actual callbacks actually use evsel object, also this will
    be helpful in future for non evsel related hist browsers.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1465928361-2442-10-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • It will be convenient in following patches to display hists entries
    without callchains even if they are defined.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1465928361-2442-9-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

20 May, 2016

1 commit

  • This patch moves the reference of buildid dir to 'symfs/.debug' and
    skips the local buildid dir when '--symfs' is given, so that every
    single file opened by perf is relative to symfs directory now.

    Signed-off-by: He Kuang
    Acked-by: David Ahern
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Ekaterina Tumanova
    Cc: Josh Poimboeuf
    Cc: Kan Liang
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Sukadev Bhattiprolu
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1463658462-85131-2-git-send-email-hekuang@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    He Kuang
     

06 May, 2016

1 commit

  • Now we have sort dimensions private for struct hists, we need to make
    dimension booleans hists specific as well.

    Moving sort__need_collapse into struct perf_hpp_list.

    Adding hists__has macro to easily access this info perf struct hists
    object.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1462276488-26683-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

23 Mar, 2016

1 commit

  • Since we only deal with fields in the passed struct perf_sample move
    this method to struct machine, that is where the perf_sample fields
    will be resolved to a struct addr_location, i.e. thread, map, symbol,
    etc.

    Cc: Adrian Hunter
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Ravi Bangoria
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-a1ww2lbm2vbuqsv4p7ilubu9@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

27 Feb, 2016

1 commit

  • Before this patch each subcommand calls perf_config() by themself,
    reading the default configuration together with subcommand specific
    options. If a subcommand doesn't have it own options, it needs to call
    'perf_config(perf_default_config, NULL)' to ensure .perfconfig is
    loaded.

    This patch brings perf_config(perf_default_config, NULL) to the very
    start of main(), so subcommands don't need to do it.

    After this patch, 'llvm.clang-path' works for 'perf trace'.

    Signed-off-by: Wang Nan
    Suggested-and-Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexei Starovoitov
    Cc: Jiri Olsa
    Cc: Li Zefan
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1456479154-136027-4-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

08 Jan, 2016

1 commit

  • Using perf_hpp__register_sort_field interface instead of directly adding
    the entry.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Noel Grandin
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1452158050-28061-13-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

07 Jan, 2016

2 commits

  • This is a preparation to support dynamic sort keys for tracepoint
    events. Dynamic sort keys can be created for specific fields in trace
    events so it needs the event information.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1450804030-29193-5-git-send-email-namhyung@kernel.org
    [ Moving the evlist creation earlier in top was split to a previous patch ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • This is a preparation to add more info into the hist_entry. Also it
    already passes too many argument, so passing sample directly will reduce
    the overhead of the function call.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1450804030-29193-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

13 Aug, 2015

1 commit

  • This patch introduce "call-graph=no" to disable per-event callgraph.

    Here is an example.

    perf record -e 'cpu/cpu-cycles,call-graph=fp/,cpu/instructions,call-graph=no/' sleep 1

    perf report --stdio

    # To display the perf.data header info, please use
    --header/--header-only options.
    #
    #
    # Total Lost Samples: 0
    #
    # Samples: 6 of event 'cpu/cpu-cycles,call-graph=fp/'
    # Event count (approx.): 774218
    #
    # Children Self Command Shared Object Symbol
    # ........ ........ ....... ................ ........................................
    #
    61.94% 0.00% sleep [kernel.vmlinux] [k] entry_SYSCALL_64_fastpath
    |
    ---entry_SYSCALL_64_fastpath
    |
    |--97.30%-- __brk
    |
    --2.70%-- mmap64
    _dl_check_map_versions
    _dl_check_all_versions

    61.94% 0.00% sleep [kernel.vmlinux] [k] perf_event_mmap
    |
    ---perf_event_mmap
    |
    |--97.30%-- do_brk
    | sys_brk
    | entry_SYSCALL_64_fastpath
    | __brk
    |
    --2.70%-- mmap_region
    do_mmap_pgoff
    vm_mmap_pgoff
    sys_mmap_pgoff
    sys_mmap
    entry_SYSCALL_64_fastpath
    mmap64
    _dl_check_map_versions
    _dl_check_all_versions
    ......

    # Samples: 6 of event 'cpu/instructions,call-graph=no/'
    # Event count (approx.): 359692
    #
    # Children Self Command Shared Object Symbol
    # ........ ........ ....... ................ .................................
    #
    89.03% 0.00% sleep [unknown] [.] 0xffff6598ffff6598
    89.03% 0.00% sleep ld-2.17.so [.] _dl_resolve_conflicts
    89.03% 0.00% sleep [kernel.vmlinux] [k] page_fault

    Signed-off-by: Kan Liang
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1439289050-40510-2-git-send-email-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     

09 May, 2015

1 commit

  • 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: David Ahern
    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

25 Mar, 2015

1 commit

  • Required for off-box analysis to convert kernel addresses.

    Signed-off-by: David Ahern
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1427212317-7018-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

21 Mar, 2015

1 commit

  • Both 'perf diff' and 'perf mem' have 'field-separator' option, which
    causes segfault if passed with empty string. This patch uses previously
    introduced 'OPT_STRING_NOEMPTY' option macro to prevent fault.

    Signed-off-by: Wang Nan
    Tested-by: Arnaldo Carvalho de Melo
    Cc: pi3orama@163.com
    Cc: Namhyung Kim
    Cc: Zefan Li
    Link: http://lkml.kernel.org/r/1426820272-23302-1-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

11 Mar, 2015

1 commit

  • By keeping pointers to machines, evlist and tool in ordered_events.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-0c6huyaf59mqtm2ek9pmposl@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

22 Jan, 2015

3 commits

  • The prior change fixes default output ordering with each column but it
    breaks -o/--order option. This patch prepends a new hpp fmt struct to
    sort list but not to output field list so that it can affect ordering
    without adding a new output column.

    The new hpp fmt uses its own compare functions which treats dummy
    entries (which have no baseline) little differently - the delta field
    can be computed without baseline but others (ratio and wdiff) are not.

    The new output will look like below:

    $ perf diff -o 2 perf.data.{old,cur,new}
    ...
    # Baseline/0 Delta/1 Delta/2 Shared Object Symbol
    # .......... ....... ....... ................. ..........................................
    22.98% +0.51% +0.52% libc-2.20.so [.] _int_malloc
    5.70% +0.28% +0.30% libc-2.20.so [.] free
    4.38% -0.21% +0.25% a.out [.] main
    1.32% -0.15% +0.05% a.out [.] free@plt
    +0.01% [kernel.kallsyms] [k] intel_pstate_timer_func
    +0.01% [kernel.kallsyms] [k] _raw_spin_lock_irqsave
    +0.01% [kernel.kallsyms] [k] timekeeping_update.constprop.8
    +0.01% +0.01% [kernel.kallsyms] [k] apic_timer_interrupt
    0.01% -0.00% [kernel.kallsyms] [k] native_read_msr_safe
    0.01% -0.01% -0.01% [kernel.kallsyms] [k] native_write_msr_safe
    1.31% +0.03% -0.06% a.out [.] malloc@plt
    31.50% -0.74% -0.23% libc-2.20.so [.] _int_free
    32.75% +0.28% -0.83% libc-2.20.so [.] malloc
    0.01% [kernel.kallsyms] [k] scheduler_tick
    +0.01% [kernel.kallsyms] [k] read_tsc
    +0.01% [kernel.kallsyms] [k] perf_adjust_freq_unthr_context.part.82

    In above example, the output was sorted by 'Delta/2' column first, and
    then 'Baseline/0' and finally 'Delta/1'.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1420677949-6719-8-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • When perf diff prints output, it sorts the entries using baseline field
    by default, but entries which don't have baseline are not sorted
    properly. This patch makes it sorted by values of next column.

    Before:

    # Baseline/0 Delta/1 Delta/2 Shared Object Symbol
    # .......... ....... ....... ................. ..........................................
    #
    32.75% +0.28% -0.83% libc-2.20.so [.] malloc
    31.50% -0.74% -0.23% libc-2.20.so [.] _int_free
    22.98% +0.51% +0.52% libc-2.20.so [.] _int_malloc
    5.70% +0.28% +0.30% libc-2.20.so [.] free
    4.38% -0.21% +0.25% a.out [.] main
    1.32% -0.15% +0.05% a.out [.] free@plt
    1.31% +0.03% -0.06% a.out [.] malloc@plt
    0.01% -0.01% -0.01% [kernel.kallsyms] [k] native_write_msr_safe
    0.01% [kernel.kallsyms] [k] scheduler_tick
    0.01% -0.00% [kernel.kallsyms] [k] native_read_msr_safe
    +0.01% [kernel.kallsyms] [k] _raw_spin_lock_irqsave
    +0.01% +0.01% [kernel.kallsyms] [k] apic_timer_interrupt
    +0.01% [kernel.kallsyms] [k] intel_pstate_timer_func
    +0.01% [kernel.kallsyms] [k] perf_adjust_freq_unthr_context.part.82
    +0.01% [kernel.kallsyms] [k] read_tsc
    +0.01% [kernel.kallsyms] [k] timekeeping_update.constprop.8

    After:

    # Baseline/0 Delta/1 Delta/2 Shared Object Symbol
    # .......... ....... ....... ................. ..........................................
    #
    32.75% +0.28% -0.83% libc-2.20.so [.] malloc
    31.50% -0.74% -0.23% libc-2.20.so [.] _int_free
    22.98% +0.51% +0.52% libc-2.20.so [.] _int_malloc
    5.70% +0.28% +0.30% libc-2.20.so [.] free
    4.38% -0.21% +0.25% a.out [.] main
    1.32% -0.15% +0.05% a.out [.] free@plt
    1.31% +0.03% -0.06% a.out [.] malloc@plt
    0.01% -0.01% -0.01% [kernel.kallsyms] [k] native_write_msr_safe
    0.01% [kernel.kallsyms] [k] scheduler_tick
    0.01% -0.00% [kernel.kallsyms] [k] native_read_msr_safe
    +0.01% +0.01% [kernel.kallsyms] [k] apic_timer_interrupt
    +0.01% [kernel.kallsyms] [k] read_tsc
    +0.01% [kernel.kallsyms] [k] perf_adjust_freq_unthr_context.part.82
    +0.01% [kernel.kallsyms] [k] intel_pstate_timer_func
    +0.01% [kernel.kallsyms] [k] _raw_spin_lock_irqsave
    +0.01% [kernel.kallsyms] [k] timekeeping_update.constprop.8

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1420677949-6719-7-git-send-email-namhyung@kernel.org
    [ Fixed up hist_entry__cmp_ method signatures, fallout from making previous cset buildable ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Currently ->cmp, ->collapse and ->sort callbacks doesn't pass
    corresponding fmt. But it'll be needed by upcoming changes in
    perf diff command.

    Suggested-by: Jiri Olsa
    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1420677949-6719-6-git-send-email-namhyung@kernel.org
    [ fix build by passing perf_hpp_fmt pointer to hist_entry__cmp_ methods ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim