Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-18 Thread Marc Zyngier
On 2020-09-18 11:35, Sergey Senozhatsky wrote: On (20/09/18 09:20), Marc Zyngier wrote: On 2020-09-18 01:32, Sergey Senozhatsky wrote: > On (20/09/17 12:53), Marc Zyngier wrote: > > Feel free to add a *new* tracepoint instead. > > Wouldn't we want a whole bunch of new tracepoints in this case?

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-18 Thread Sergey Senozhatsky
On (20/09/18 09:20), Marc Zyngier wrote: > On 2020-09-18 01:32, Sergey Senozhatsky wrote: > > On (20/09/17 12:53), Marc Zyngier wrote: > > > Feel free to add a *new* tracepoint instead. > > > > Wouldn't we want a whole bunch of new tracepoints in this case? > > Yes. I don't have a better solution

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-18 Thread Marc Zyngier
On 2020-09-18 01:32, Sergey Senozhatsky wrote: On (20/09/17 12:53), Marc Zyngier wrote: Feel free to add a *new* tracepoint instead. Wouldn't we want a whole bunch of new tracepoints in this case? Yes. I don't have a better solution as long as tracepoints are ABI. Get someone to sign-off on

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Sergey Senozhatsky
On (20/09/17 12:53), Marc Zyngier wrote: > Feel free to add a *new* tracepoint instead. Wouldn't we want a whole bunch of new tracepoints in this case? (almost all of the existing ones with the extra vcpu_id field). Right now we have 3 types of events: - events with no vcpu at all// nil -

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
Hi Sergey, On Thu, Sep 17, 2020 at 08:00:28PM +0900, Sergey Senozhatsky wrote: > On (20/09/17 11:21), Marc Zyngier wrote: > > > > On Arm64, ftrace tracepoint "kvm_entry" doesn't contain the field "id" > > > > or field "vcpu_id", thus it always reads out the "id" is 0 and it is > > Right, Leo, I s

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
On Thu, Sep 17, 2020 at 12:53:02PM +0100, Marc Zyngier wrote: > On 2020-09-17 12:42, Leo Yan wrote: > > On Thu, Sep 17, 2020 at 11:21:15AM +0100, Marc Zyngier wrote: > > > > [...] > > > > > > > > +const char *vcpu_id_str = "id"; > > > > > > > > > > On Arm64, ftrace tracepoint "kvm_entry" doesn't

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Marc Zyngier
On 2020-09-17 12:42, Leo Yan wrote: On Thu, Sep 17, 2020 at 11:21:15AM +0100, Marc Zyngier wrote: [...] > > > +const char *vcpu_id_str = "id"; > > > > On Arm64, ftrace tracepoint "kvm_entry" doesn't contain the field "id" > > or field "vcpu_id", thus it always reads out the "id" is 0 and it is

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
On Thu, Sep 17, 2020 at 11:21:15AM +0100, Marc Zyngier wrote: [...] > > > > +const char *vcpu_id_str = "id"; > > > > > > On Arm64, ftrace tracepoint "kvm_entry" doesn't contain the field "id" > > > or field "vcpu_id", thus it always reads out the "id" is 0 and it is > > > recorded into Perf's st

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Sergey Senozhatsky
On (20/09/17 11:21), Marc Zyngier wrote: > > > On Arm64, ftrace tracepoint "kvm_entry" doesn't contain the field "id" > > > or field "vcpu_id", thus it always reads out the "id" is 0 and it is Right, Leo, I saw that. I put "id", because there is ... well, there is nothing we can put there. The tra

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Marc Zyngier
On 2020-09-17 11:12, Leo Yan wrote: Add Marc at this time, sorry for spamming. On Thu, Sep 17, 2020 at 06:09:50PM +0800, Leo Yan wrote: [ + Marc ] On Thu, Sep 17, 2020 at 09:36:45AM +0900, Sergey Senozhatsky wrote: [...] > diff --git a/tools/perf/arch/arm64/util/kvm-stat.c b/tools/perf/arch

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
Add Marc at this time, sorry for spamming. On Thu, Sep 17, 2020 at 06:09:50PM +0800, Leo Yan wrote: > [ + Marc ] > > On Thu, Sep 17, 2020 at 09:36:45AM +0900, Sergey Senozhatsky wrote: > > [...] > > > diff --git a/tools/perf/arch/arm64/util/kvm-stat.c > > b/tools/perf/arch/arm64/util/kvm-stat.

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
[ + Marc ] On Thu, Sep 17, 2020 at 09:36:45AM +0900, Sergey Senozhatsky wrote: [...] > diff --git a/tools/perf/arch/arm64/util/kvm-stat.c > b/tools/perf/arch/arm64/util/kvm-stat.c > new file mode 100644 > index ..32e58576f186 > --- /dev/null > +++ b/tools/perf/arch/arm64/util/kvm-st

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Sergey Senozhatsky
On (20/09/17 16:47), Leo Yan wrote: [..] > > +static void event_get_key(struct evsel *evsel, > > + struct perf_sample *sample, > > + struct event_key *key) > > +{ > > + key->info = 0; > > + key->key = perf_evsel__intval(evsel, sample, kvm_exit_reason); >

Re: [PATCHv3] perf kvm: add kvm-stat for arm64

2020-09-17 Thread Leo Yan
On Thu, Sep 17, 2020 at 09:36:45AM +0900, Sergey Senozhatsky wrote: > Add support for perf kvm stat on arm64 platform. > > Example: > # perf kvm stat report > > Analyze events for all VMs, all VCPUs: > > VM-EXITSamples Samples% Time%Min TimeMax Time > Avg time > >