linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 00/14] perf kvm: Support histograms and TUI mode
Date: Mon, 27 Feb 2023 18:40:13 -0300	[thread overview]
Message-ID: <Y/0jPa9xu371PtRS@kernel.org> (raw)
In-Reply-To: <20230226042053.1492409-1-leo.yan@linaro.org>

Em Sun, Feb 26, 2023 at 12:20:39PM +0800, Leo Yan escreveu:
> This patch set is to enable histograms and (partially) TUI mode in perf
> kvm tool.
> 
> Current tool uses its own RB tree to maintain KVM events, it's not easy
> to extend to support more metrics and have no chance to support TUI
> mode.  For this reason, we need firstly to refactor the code by using
> histograms and its associated RB tree; based on histograms we can add
> dimensions for KVM event statistics.  Finally, we need to enable TUI
> mode in the tool.  This is the methodology applied in this series.
> 
> This series enables TUI mode for 'perf kvm stat report', but it doesn't
> support TUI mode for 'perf kvm stat live'; this is because live mode is
> different from report for TUI mode, which will be implemented in later
> (TBH, I need to look into more details in histograms for this part).
> 
> Patches 01 ~ 04 are minor refactoring and they are preparation for later
> enabling histograms and dimensions.
> 
> Patches 05 ~ 10 are for enabling histograms and dimensions; with these
> changes the cached list is replaced by histograms list, and we extend to
> support more sorting keys (max time, min time, mean time).
> 
> Patches 11 ~ 13 are to enable TUI mode in stat report, after this patch
> TUI mode will be default mode, and user needs to input option '--stdio'
> for stdio mode rather than TUI mode.
> 
> Patch 14 updates documentation for new sorting and 'stdio' mode.
> 
> After changes:
> 
> Please see the screenshot for the TUI with 'perf kvm stat report':
> https://people.linaro.org/~leo.yan/debug/perf/perf_kvm_stat_report_tui.png
> 
> And I verified the '--stdio' mode and confirmed it has the same result
> with before applying this series.

Can you provide precise instructions for all the steps involved? from
'perf kvm record', I'm trying here with a simple 'perf kvm record' and
then starting vm and having trouble.

- Arnaldo
 
>   # perf kvm stat report --stdio
> 
> 
>   Analyze events for all VMs, all VCPUs:
> 
>                VM-EXIT    Samples  Samples%     Time%    Min Time    Max Time         Avg time 
> 
>              MSR_WRITE        520    60.05%     0.07%      0.74us     16.92us      2.62us ( +-   2.66% )
>                    HLT        179    20.67%    99.82%     64.53us  17159.69us  10123.40us ( +-   4.68% )
>     EXTERNAL_INTERRUPT         71     8.20%     0.07%      1.16us     79.63us     17.56us ( +-  10.92% )
>          EPT_MISCONFIG         68     7.85%     0.03%      5.53us     64.64us      8.09us ( +-  12.50% )
>       PREEMPTION_TIMER         18     2.08%     0.01%      1.91us     12.06us      5.53us ( +-  10.25% )
>       INTERRUPT_WINDOW          7     0.81%     0.00%      0.91us      1.66us      1.30us ( +-   9.09% )
>               MSR_READ          3     0.35%     0.00%      4.06us      4.84us      4.42us ( +-   5.11% )
> 
>   Total Samples:866, Total events handled time:1815367.45us.
> 
>   # perf kvm stat live
>   12:10:10.786799
> 
>   Analyze events for all VMs, all VCPUs:
> 
>                VM-EXIT    Samples  Samples%     Time%    Min Time    Max Time         Avg time 
> 
>              MSR_WRITE        121    66.85%    12.90%      0.67us  62918.87us    667.19us ( +-  80.72% )
>                    HLT         34    18.78%    76.61%   2069.99us  52171.44us  14103.37us ( +-  14.25% )
>     EXTERNAL_INTERRUPT         20    11.05%    10.49%      1.61us  47469.17us   3282.16us ( +-  75.75% )
>       PREEMPTION_TIMER          5     2.76%     0.00%      3.98us      7.39us      5.84us ( +-  10.51% )
>       INTERRUPT_WINDOW          1     0.55%     0.00%      2.01us      2.01us      2.01us ( +-   0.00% )
> 
>   Total Samples:181, Total events handled time:625919.05us.
> 
> 
> Leo Yan (14):
>   perf kvm: Refactor overall statistics
>   perf kvm: Add pointer to 'perf_kvm_stat' in kvm event
>   perf kvm: Move up metrics helpers
>   perf kvm: Use subtraction for comparison metrics
>   perf kvm: Introduce histograms data structures
>   perf kvm: Pass argument 'sample' to kvm_alloc_init_event()
>   perf kvm: Parse address location for samples
>   perf kvm: Add dimensions for KVM event statistics
>   perf kvm: Use histograms list to replace cached list
>   perf kvm: Polish sorting key
>   perf kvm: Support printing attributions for dimensions
>   perf kvm: Add dimensions for percentages
>   perf kvm: Add TUI mode for stat report
>   perf kvm: Update documentation to reflect new changes
> 
>  tools/perf/Documentation/perf-kvm.txt |   9 +-
>  tools/perf/builtin-kvm.c              | 847 +++++++++++++++++++++-----
>  tools/perf/util/kvm-stat.h            |  26 +-
>  3 files changed, 707 insertions(+), 175 deletions(-)
> 
> -- 
> 2.34.1
> 

-- 

- Arnaldo

  parent reply	other threads:[~2023-02-27 21:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-26  4:20 [PATCH v1 00/14] perf kvm: Support histograms and TUI mode Leo Yan
2023-02-26  4:20 ` [PATCH v1 01/14] perf kvm: Refactor overall statistics Leo Yan
2023-02-26  4:20 ` [PATCH v1 02/14] perf kvm: Add pointer to 'perf_kvm_stat' in kvm event Leo Yan
2023-02-26  4:20 ` [PATCH v1 03/14] perf kvm: Move up metrics helpers Leo Yan
2023-02-26  4:20 ` [PATCH v1 04/14] perf kvm: Use subtraction for comparison metrics Leo Yan
2023-02-26  4:20 ` [PATCH v1 05/14] perf kvm: Introduce histograms data structures Leo Yan
2023-02-26  4:20 ` [PATCH v1 06/14] perf kvm: Pass argument 'sample' to kvm_alloc_init_event() Leo Yan
2023-02-26  4:20 ` [PATCH v1 07/14] perf kvm: Parse address location for samples Leo Yan
2023-02-26  4:20 ` [PATCH v1 08/14] perf kvm: Add dimensions for KVM event statistics Leo Yan
2023-02-26  4:20 ` [PATCH v1 09/14] perf kvm: Use histograms list to replace cached list Leo Yan
2023-02-26  4:20 ` [PATCH v1 10/14] perf kvm: Polish sorting key Leo Yan
2023-02-26  4:20 ` [PATCH v1 11/14] perf kvm: Support printing attributions for dimensions Leo Yan
2023-02-26  4:20 ` [PATCH v1 12/14] perf kvm: Add dimensions for percentages Leo Yan
2023-02-26  4:20 ` [PATCH v1 13/14] perf kvm: Add TUI mode for stat report Leo Yan
2023-02-26  4:20 ` [PATCH v1 14/14] perf kvm: Update documentation to reflect new changes Leo Yan
2023-02-27 21:40 ` Arnaldo Carvalho de Melo [this message]
2023-02-28  8:51   ` [PATCH v1 00/14] perf kvm: Support histograms and TUI mode Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/0jPa9xu371PtRS@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).