From: Anju T Sudhakar <hidden> Date: 2019-07-18 18:18:07
Move kvm-stat header file to the common include section, and make the
definitions in the header file under the conditional inclusion
`#ifdef HAVE_KVM_STAT_SUPPORT`.
This helps to define other perf kvm related function prototypes in
kvm-stat header file, which may not need kvm-stat support.
Signed-off-by: Anju T Sudhakar <redacted>
---
tools/perf/builtin-kvm.c | 2 +-
tools/perf/util/kvm-stat.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
From: Anju T Sudhakar <hidden> Date: 2019-07-18 18:18:10
'perf kvm record' uses 'cycles'(if the user did not specify any event) as
the default event to profile the guest.
This will not provide any proper samples from the guest incase of
powerpc architecture, since in powerpc the PMUs are controlled by
the guest rather than the host.
Patch adds a function to pick an arch specific event for 'perf kvm record',
instead of selecting 'cycles' as a default event for all architectures.
For powerpc this function checks for any user specified event, and if there
isn't any it returns invalid instead of proceeding with 'cycles' event.
Signed-off-by: Anju T Sudhakar <redacted>
---
Changes from v1->v2
* Cross-build issue for aarch64, reported by Ravi is fixed.
---
tools/perf/arch/powerpc/util/kvm-stat.c | 37 +++++++++++++++++++++++++
tools/perf/builtin-kvm.c | 12 +++++++-
tools/perf/util/kvm-stat.h | 1 +
3 files changed, 49 insertions(+), 1 deletion(-)
From: Anju T Sudhakar <hidden> Date: 2019-07-18 18:18:16
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record'
in powerpc.
Signed-off-by: Anju T Sudhakar <redacted>
---
tools/perf/arch/powerpc/util/kvm-stat.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
From: tip-bot2 for Anju T Sudhakar <hidden> Date: 2019-09-20 16:21:34
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 2bff2b828502b5e5d5ea5a52643d3542053df03f
Gitweb: https://git.kernel.org/tip/2bff2b828502b5e5d5ea5a52643d3542053df03f
Author: Anju T Sudhakar [off-list ref]
AuthorDate: Thu, 18 Jul 2019 23:47:49 +05:30
Committer: Arnaldo Carvalho de Melo [off-list ref]
CommitterDate: Fri, 20 Sep 2019 10:28:26 -03:00
perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record'
in powerpc.
Signed-off-by: Anju T Sudhakar <redacted>
Reviewed-by: Ravi Bangoria <redacted>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <redacted>
Cc: Madhavan Srinivasan <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lore.kernel.org/lkml/20190718181749.30612-3-anju@linux.vnet.ibm.com
[ Add missing pmu.h header, needed because this patch uses pmu_have_event() ]
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
---
tools/perf/arch/powerpc/util/kvm-stat.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
From: tip-bot2 for Anju T Sudhakar <hidden> Date: 2019-09-20 16:22:15
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 124eb5f82bf9395419b20205c4dcc1b8fcda7f29
Gitweb: https://git.kernel.org/tip/124eb5f82bf9395419b20205c4dcc1b8fcda7f29
Author: Anju T Sudhakar [off-list ref]
AuthorDate: Thu, 18 Jul 2019 23:47:48 +05:30
Committer: Arnaldo Carvalho de Melo [off-list ref]
CommitterDate: Fri, 20 Sep 2019 10:28:26 -03:00
perf kvm: Add arch neutral function to choose event for perf kvm record
'perf kvm record' uses 'cycles'(if the user did not specify any event)
as the default event to profile the guest.
This will not provide any proper samples from the guest incase of
powerpc architecture, since in powerpc the PMUs are controlled by the
guest rather than the host.
Patch adds a function to pick an arch specific event for 'perf kvm
record', instead of selecting 'cycles' as a default event for all
architectures.
For powerpc this function checks for any user specified event, and if
there isn't any it returns invalid instead of proceeding with 'cycles'
event.
Signed-off-by: Anju T Sudhakar <redacted>
Reviewed-by: Ravi Bangoria <redacted>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <redacted>
Cc: Madhavan Srinivasan <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lore.kernel.org/lkml/20190718181749.30612-2-anju@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
---
tools/perf/arch/powerpc/util/kvm-stat.c | 37 ++++++++++++++++++++++++-
tools/perf/builtin-kvm.c | 12 +++++++-
tools/perf/util/kvm-stat.h | 1 +-
3 files changed, 49 insertions(+), 1 deletion(-)
From: tip-bot2 for Anju T Sudhakar <hidden> Date: 2019-09-20 16:22:36
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 8067b3da970baa12e6045400fdf009673b8dd3c2
Gitweb: https://git.kernel.org/tip/8067b3da970baa12e6045400fdf009673b8dd3c2
Author: Anju T Sudhakar [off-list ref]
AuthorDate: Thu, 18 Jul 2019 23:47:47 +05:30
Committer: Arnaldo Carvalho de Melo [off-list ref]
CommitterDate: Fri, 20 Sep 2019 10:28:26 -03:00
perf kvm: Move kvm-stat header file from conditional inclusion to common include section
Move kvm-stat header file to the common include section, and make the
definitions in the header file under the conditional inclusion `#ifdef
HAVE_KVM_STAT_SUPPORT`.
This helps to define other 'perf kvm' related function prototypes in
kvm-stat header file, which may not need kvm-stat support.
Signed-off-by: Anju T Sudhakar <redacted>
Reviewed-By: Ravi Bangoria <redacted>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <redacted>
Cc: Madhavan Srinivasan <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lore.kernel.org/lkml/20190718181749.30612-1-anju@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
---
tools/perf/builtin-kvm.c | 2 +-
tools/perf/util/kvm-stat.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)