30 May, 2018

1 commit

  • [ Upstream commit b40982e8468b46b8f7f5bba5a7e541ec04a29d7d ]

    When we use perf report interactive annotate view, we can see
    the position of jump arrow is not correct. For example,

    1. perf record -b ...
    2. perf report
    3. In interactive mode, select Annotate 'function'

    Percent│ IPC Cycle
    │ if (flag)
    1.37 │0.4┌── 1 ↓ je 82
    │ │ x += x / y + y / x;
    0.00 │0.4│ 1310 movsd (%rsp),%xmm0
    0.00 │0.4│ 565 movsd 0x8(%rsp),%xmm4
    │0.4│ movsd 0x8(%rsp),%xmm1
    │0.4│ movsd (%rsp),%xmm3
    │0.4│ divsd %xmm4,%xmm0
    0.00 │0.4│ 579 divsd %xmm3,%xmm1
    │0.4│ movsd (%rsp),%xmm2
    │0.4│ addsd %xmm1,%xmm0
    │0.4│ addsd %xmm2,%xmm0
    0.00 │0.4│ movsd %xmm0,(%rsp)
    │ │ volatile double x = 1212121212, y = 121212;
    │ │
    │ │ s_randseed = time(0);
    │ │ srand(s_randseed);
    │ │
    │ │ for (i = 0; i < 2000000000; i++) {
    1.37 │0.4└─→ 82: sub $0x1,%ebx
    28.21 │0.48 17 ↑ jne 38

    The jump arrow in above example is not correct. It should add the
    width of IPC and Cycle.

    With this patch, the result is:

    Percent│ IPC Cycle
    │ if (flag)
    1.37 │0.48 1 ┌──je 82
    │ │ x += x / y + y / x;
    0.00 │0.48 1310 │ movsd (%rsp),%xmm0
    0.00 │0.48 565 │ movsd 0x8(%rsp),%xmm4
    │0.48 │ movsd 0x8(%rsp),%xmm1
    │0.48 │ movsd (%rsp),%xmm3
    │0.48 │ divsd %xmm4,%xmm0
    0.00 │0.48 579 │ divsd %xmm3,%xmm1
    │0.48 │ movsd (%rsp),%xmm2
    │0.48 │ addsd %xmm1,%xmm0
    │0.48 │ addsd %xmm2,%xmm0
    0.00 │0.48 │ movsd %xmm0,(%rsp)
    │ │ volatile double x = 1212121212, y = 121212;
    │ │
    │ │ s_randseed = time(0);
    │ │ srand(s_randseed);
    │ │
    │ │ for (i = 0; i < 2000000000; i++) {
    1.37 │0.48 82:└─→sub $0x1,%ebx
    28.21 │0.48 17 ↑ jne 38

    Committer notes:

    Please note that only from LBRv5 (according to Jiri) onwards, i.e. >=
    Skylake is that we'll have the cycles counts in each branch record
    entry, so to see the Cycles and IPC columns, and be able to test this
    patch, one need a capable hardware.

    While applying this I first tested it on a Broadwell class machine and
    couldn't get those columns, will add code to the annotate browser to
    warn the user about that, i.e. you have branch records, but no cycles,
    use a more recent hardware to get the cycles and IPC columns.

    Signed-off-by: Jin Yao
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1517223473-14750-1-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jin Yao
     

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
     

14 Oct, 2017

2 commits

  • Make sure the struct perf_hpp_fmt is properly unhooked before we free
    it.

    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/r/20171013083736.15037-3-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Du Changbin reported crash [1] when calling perf_hpp__reset_output_field()
    after unregistering field via perf_hpp__column_unregister().

    This ends up in calling following list_del* sequence on
    the same format:

    perf_hpp__column_unregister:
    list_del(&format->list);
    perf_hpp__reset_output_field:
    list_del_init(&fmt->list);

    where the later list_del_init might touch already freed formats.

    Fixing this by replacing list_del() with list_del_init() in
    perf_hpp__column_unregister().

    [1] http://marc.info/?l=linux-kernel&m=149059595826019&w=2

    Reported-by: Changbin Du
    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Jin Yao
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20171013083736.15037-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

12 Sep, 2017

2 commits

  • We currently update the 'next' variable only with a single step value.
    But it's possible the 'adv' update is bigger than single 'step' value.
    This would leave 'next' value under counted and force unnecessary
    ui_progress__ops->update calls.

    Calculate the amount of steps we need for 'adv' update and increase the
    'next' with that amounts of steps.

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

    Jiri Olsa
     
  • Unlikely, but we could have ui_progress__init being called with total <
    16, which would set the next and step variables to 0. That would force
    unnecessary ui_progress__ops->update calls because 'next' would never
    raise.

    Forcing the next and step values to be always > 0.

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

    Jiri Olsa
     

02 Sep, 2017

1 commit


30 Aug, 2017

1 commit

  • The branch history code has a loop detection function. With this, we can
    get the number of iterations by calculating the removed loops.

    While it would be nice for knowing the average cycles of iterations.
    This patch adds up the cycles in branch entries of removed loops and
    save the result to the next branch entry (e.g. branch entry A).

    Finally it will display the iteration number and average cycles at the
    "from" of branch entry A.

    For example:
    perf record -g -j any,save_type ./div
    perf report --branch-history --no-children --stdio

    --22.63%--main div.c:42 (RET CROSS_2M)
    compute_flag div.c:28 (cycles:2 iter:173115 avg_cycles:2)
    |
    --10.73%--compute_flag div.c:27 (RET CROSS_2M)
    rand rand.c:28 (cycles:1)
    rand rand.c:28 (RET CROSS_2M)
    __random random.c:298 (cycles:1)
    __random random.c:297 (COND_BWD CROSS_2M)
    __random random.c:295 (cycles:1)
    __random random.c:295 (COND_BWD CROSS_2M)
    __random random.c:295 (cycles:1)
    __random random.c:295 (RET CROSS_2M)

    Signed-off-by: Yao Jin
    Reviewed-by: Andi Kleen
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1502111115-18305-1-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     

18 Aug, 2017

2 commits

  • Using the existing 't' hotkey, support the three views: percent, total
    period and number of samples on the annotate TUI browser, circulating
    them like below:

    Percent -> Total Period -> Nr Samples -> Percent ...

    Committer notes:

    Removed new 'e' hotkey, should be resubmitted as a separate patch, with
    proper justification for its inclusion.

    Suggested-by: Namhyung Kim
    Signed-off-by: Taeung Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Milian Wolff
    Link: http://lkml.kernel.org/r/1503046028-5691-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • Support the --show-nr-samples in the TUI browser.

    Committer notes:

    Lift the restriction about --tui but leave it for --gtk:

    $ export LD_LIBRARY_PATH=~/lib64
    $ perf annotate --gtk --show-nr-samples --show-nr-samples is not available in --gtk mode at this time
    $

    Signed-off-by: Taeung Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1503046023-5646-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     

29 Jul, 2017

1 commit

  • Either when we start 'perf annotate' or 'perf report' with
    --show-total-period or when we, in the annotate browser, press 't' to
    toggle period/percent for the first column, we need to adjust the width
    for the 'period' case.

    Based-on-a-patch-by: Taeung Song
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-n2np5qcs20u6qjdr9orygne6@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Jul, 2017

4 commits

  • We have the 't' hotkey to toggle showing either the total period or the
    percentage of samples for a given line, but we forgot to toggle as well
    the column header, always showing "Percent", even when showing the
    period, fix it.

    Signed-off-by: Taeung Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1501172169-6761-1-git-send-email-treeze.taeung@gmail.com
    [ Extracted from a larger patch, s/Event count/Period/g ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • In commit f8f4aaead579 ("perf annotate: Finally display IPC and cycle
    accounting") the 'pcnt_width' variable was abused in a few places to
    also include the optional width of the "IPC" and "cycles" columns, while
    in other places we stopped using 'pcnt_width' and instead its previous
    equation...

    Now that we need to tap into annotate_browser__pcnt_width() to consider
    if --show-total-period is being used and instead of that hardcoded 7
    (strlen("Percent")) we need to use it or strlen("Event count") we need
    this properly clarified to avoid having to touch all the (7 * nr_events)
    places.

    Clarify this by introducing a separate annotate_browser__cycles_width()
    to leave the pcnt_width calculate just what its name implies.

    Cc: Taeung Song
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Andi Kleen
    Link: http://lkml.kernel.org/n/tip-szgb07t4k5wtvks8nzwkg710@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We were showing the number of samples, not the total period, fix it.

    Reported-by: Namhyung Kim
    Signed-off-by: Taeung Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Martin Liška
    Cc: Milian Wolff
    Cc: Jiri Olsa
    Fixes: 0c4a5bcea460 ("perf annotate: Display total number of samples with --show-total-period")
    Link: http://lkml.kernel.org/r/1500500223-16753-1-git-send-email-treeze.taeung@gmail.com
    [ extracted from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • Just paving the way to fix --show-total-period in the TUI, i.e. now
    we save in struct disasm_line_samples not just the number of samples,
    but also the total period.

    Based-on-a-patch-by: Taeung Song
    Cc: Jiri Olsa
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/n/tip-1sup5hkwrxocjvrmrmhs732o@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

21 Jul, 2017

3 commits

  • To make it more clear that it is the sum of all the nr_samples fields in the
    addr[] entries, i.e.:

    sym_hist->nr_samples = sum(sym_hist->addr[0 .. symbol__size(sym)]->nr_samples)

    Committer notes:

    Taeung had renamed it to total_samples, but using nr_samples, as in the
    added explanation above, looks clearer and establishes the direct
    connection, making clear it is about the _number_ of samples.

    Signed-off-by: Taeung Song
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1500500211-16599-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • struct sym_hist has addr[] but it should have not only number of samples
    but also the sample period. So use new struct symhist_entry to pave the
    way to have that.

    Committer notes:

    This initial patch will only introduce the struct sym_hist_entry and use
    only the nr_samples member, which makes the code clearer and paves the
    way to save the period as well.

    Signed-off-by: Taeung Song
    Suggested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1500500205-16553-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     
  • Replacing prefixcmp(), same purpose, inverted result, so standardize on
    the kernel variant, to reduce silly differences among tools/ and the
    kernel sources, making it easier for people to work in both codebases.

    And then doing:

    if (strstarts(option, "no-"))

    Looks clearer than doing:

    if (!prefixcmp(option, "no-"))

    To figure out if option starts witn "no-".

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

    Arnaldo Carvalho de Melo
     

19 Jul, 2017

3 commits

  • Currently perf supports a mode to query inline stack. It works well for
    finding user space inline functions but it doesn't work for kernel ones,
    due to some unnecessary check.

    This patch removes these unnecessary checks. Now kernel inline functions
    can be reported.

    For example:

    perf report --inline -g func --stdio

    |--46.19%--do_huge_pmd_anonymous_page
    | do_huge_pmd_anonymous_page (inline)
    | __do_huge_pmd_anonymous_page (inline)
    | __SetPageUptodate (inline)
    | __set_bit (inline)

    The result is compared with the output of addr2line. They match.

    Signed-off-by: Yao Jin
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Milian Wolff
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1500409892-15904-1-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     
  • For marking fused instructions clearly this patch adds a line before the
    first instruction of pair and joins it with the arrow of the jump to its
    target.

    For example, when "je" is selected in annotate view, the line before
    cmpl is displayed and joins the arrow of "je".

    │ ┌──cmpl $0x0,argp_program_version_hook
    81.93 │ ├──je 20
    │ │ lock cmpxchg %esi,0x38a9a4(%rip)
    │ │↓ jne 29
    │ │↓ jmp 43
    11.47 │20:└─→cmpxch %esi,0x38a999(%rip)

    That means the cmpl+je is a fused instruction pair and they should be
    considered together.

    Changelog:

    v3: Use Arnaldo's fix to improve the arrow origin rendering. To get the
    evsel->evlist->env->cpuid, save the evsel in annotate_browser.

    v2: new function "ins__is_fused" to check if the instructions are fused.

    Signed-off-by: Yao Jin
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1499403995-19857-3-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     
  • Macro fusion merges two instructions to a single micro-op. Intel core
    platform performs this hardware optimization under limited
    circumstances.

    For example, CMP + JCC can be "fused" and executed /retired together.
    While with sampling this can result in the sample sometimes being on the
    JCC and sometimes on the CMP. So for the fused instruction pair, they
    could be considered together.

    On Nehalem, fused instruction pairs:

    cmp/test + jcc.

    On other new CPU:

    cmp/test/add/sub/and/inc/dec + jcc.

    This patch adds an x86-specific function which checks if 2 instructions
    are in a "fused" pair. For non-x86 arch, the function is just NULL.

    Changelog:

    v4: Move the CPU model checking to symbol__disassemble and save the CPU
    family/model in arch structure.

    It avoids checking every time when jump arrow printed.

    v3: Add checking for Nehalem (CMP, TEST). For other newer Intel CPUs
    just check it by default (CMP, TEST, ADD, SUB, AND, INC, DEC).

    v2: Remove the original weak function. Arnaldo points out that doing it
    as a weak function that will be overridden by the host arch doesn't
    work. So now it's implemented as an arch-specific function.

    Committer fix:

    Do not access evsel->evlist->env->cpuid, ->env can be null, introduce
    perf_evsel__env_cpuid(), just like perf_evsel__env_arch(), also used in
    this function call.

    The original patch was segfaulting 'perf top' + annotation.

    But this essentially disables this fused instructions augmentation in
    'perf top', the right thing is to get the cpuid from the running kernel,
    left for a later patch tho.

    Signed-off-by: Yao Jin
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1499403995-19857-2-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     

11 Jul, 2017

1 commit

  • When the jump instruction is displayed at the row 0 in annotate view,
    the arrow is broken. An example:

    16.86 │ ┌──je 82
    0.01 │ movsd (%rsp),%xmm0
    │ movsd 0x8(%rsp),%xmm4
    │ movsd 0x8(%rsp),%xmm1
    │ movsd (%rsp),%xmm3
    │ divsd %xmm4,%xmm0
    │ divsd %xmm3,%xmm1
    │ movsd (%rsp),%xmm2
    │ addsd %xmm1,%xmm0
    │ addsd %xmm2,%xmm0
    │ movsd %xmm0,(%rsp)
    │82: sub $0x1,%ebx
    83.03 │ ↑ jne 38
    │ add $0x10,%rsp
    │ xor %eax,%eax
    │ pop %rbx
    │ ← retq

    The patch increments the row number before checking with 0.

    Signed-off-by: Yao Jin
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Cc: stable@vger.kernel.org
    Fixes: 944e1abed9e1 ("perf ui browser: Add method to draw up/down arrow line")
    Link: http://lkml.kernel.org/r/1496901704-30275-1-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     

20 Jun, 2017

3 commits

  • In annotate browser, we will add support to check fused instructions.
    While this is x86-specific feature so we need the annotate browser to
    know what the arch it runs on.

    symbol__disassemble() has figured out the arch. This patch just lets the
    arch return from symbol__disassemble and save the arch in annotate
    browser.

    Signed-off-by: Yao Jin
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1497840958-4759-2-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     
  • The annotate browser is divided into 2 frames. Left frame contains 3
    columns (some platforms only have one column).

    For example:

    │26 int compute_flag()
    │27 {
    22.80 1.20 │ sub $0x8,%rsp
    │25 int i;

    │27 i = rand() % 2;
    22.78 1.20 1 │ → callq rand@plt

    While it's hard for user to understand what the data is.

    This patch adds the titles "Percent", "IPC" and "Cycle" on columns.

    Percent IPC Cycle │
    │25 __attribute__((noinline))
    │26 int compute_flag()
    │27 {
    22.80 1.20 │ sub $0x8,%rsp
    │25 int i;

    │27 i = rand() % 2;
    22.78 1.20 1 │ → callq rand@plt

    The titles are displayed at row 0 of annotate browser if row 0 doesn't
    have values of percent, ipc and cycle.

    Signed-off-by: Yao Jin
    Acked-by: Milian Wolff
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Cc: Yao Jin
    Link: http://lkml.kernel.org/r/1493909895-9668-3-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     
  • In annotate_browser_write(),

    if (dl->offset != -1 && percent_max != 0.0) {
    if (percent_max != 0.0) {
    ...
    }
    ...
    }

    The second check of (percent_max != 0.0) is not necessary, remove it.

    Signed-off-by: Yao Jin
    Acked-by: Milian Wolff
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Cc: Yao Jin
    Link: http://lkml.kernel.org/r/1493909895-9668-2-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     

24 May, 2017

1 commit

  • The __hpp__sort_acc() sorts entries using callchain depth in order to
    put callers above in children mode. But it assumed the callchain order
    was callee-first. Now default (for children) is caller-first so the
    order of entries is reverted.

    For example, consider following case:

    $ perf report --no-children
    ..l
    # Overhead Command Shared Object Symbol
    # ........ ....... ................... ..........................
    #
    99.44% a.out a.out [.] main
    |
    ---main
    __libc_start_main
    _start

    Then children mode should show 'start' above '__libc_start_main' since
    it's the caller (parent) of the __libc_start_main. But it's reversed:

    # Children Self Command Shared Object Symbol
    # ........ ........ ....... ............... .....................
    #
    99.61% 0.00% a.out libc-2.25.so [.] __libc_start_main
    99.61% 0.00% a.out a.out [.] _start
    99.54% 99.44% a.out a.out [.] main

    This patch fixes it.

    # Children Self Command Shared Object Symbol
    # ........ ........ ....... ............... .....................
    #
    99.61% 0.00% a.out a.out [.] _start
    99.61% 0.00% a.out libc-2.25.so [.] __libc_start_main
    99.54% 99.44% a.out a.out [.] main

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Milian Wolff
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yao Jin
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20170524062129.32529-8-namhyung@kernel.org
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     

27 Apr, 2017

1 commit


25 Apr, 2017

1 commit


21 Apr, 2017

2 commits


20 Apr, 2017

9 commits


11 Apr, 2017

1 commit