All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 2/5] perf kvm: Introduce guest interfaces for sampling callchains
@ 2023-10-12 22:07 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2023-10-12 22:07 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: include/linux/perf_event.h:1531:41: sparse: sparse: no identifier for function argument"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <SY4P282MB10842B9353422CD2C86DCB929DCFA@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM>
References: <SY4P282MB10842B9353422CD2C86DCB929DCFA@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM>
TO: Tianyi Liu <i.pear@outlook.com>
TO: seanjc@google.com
TO: pbonzini@redhat.com
TO: peterz@infradead.org
TO: mingo@redhat.com
TO: acme@kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: kvmarm@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: linux-perf-users@vger.kernel.org
CC: kvm@vger.kernel.org
CC: x86@kernel.org
CC: mark.rutland@arm.com
CC: alexander.shishkin@linux.intel.com
CC: jolsa@kernel.org
CC: namhyung@kernel.org
CC: irogers@google.com
CC: adrian.hunter@intel.com
CC: Tianyi Liu <i.pear@outlook.com>

Hi Tianyi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa]

url:    https://github.com/intel-lab-lkp/linux/commits/Tianyi-Liu/KVM-Add-arch-specific-interfaces-for-sampling-guest-callchains/20231008-230042
base:   8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
patch link:    https://lore.kernel.org/r/SY4P282MB10842B9353422CD2C86DCB929DCFA%40SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM
patch subject: [PATCH v2 2/5] perf kvm: Introduce guest interfaces for sampling callchains
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-062-20231012 (https://download.01.org/0day-ci/archive/20231013/202310130614.KeOsd089-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231013/202310130614.KeOsd089-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202310130614.KeOsd089-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   fs/netfs/main.c: note: in included file (through include/linux/trace_events.h, include/trace/trace_events.h, include/trace/define_trace.h, ...):
>> include/linux/perf_event.h:1531:41: sparse: sparse: no identifier for function argument
   include/linux/perf_event.h:1531:48: sparse: sparse: no identifier for function argument
   include/linux/perf_event.h:1531:55: sparse: sparse: no identifier for function argument

vim +1531 include/linux/perf_event.h

87b940a0675e25 Sean Christopherson 2021-11-11  1504  
1c3430516b0732 Sean Christopherson 2021-11-11  1505  static inline unsigned int perf_guest_state(void)
1c3430516b0732 Sean Christopherson 2021-11-11  1506  {
87b940a0675e25 Sean Christopherson 2021-11-11  1507  	return static_call(__perf_guest_state)();
1c3430516b0732 Sean Christopherson 2021-11-11  1508  }
1c3430516b0732 Sean Christopherson 2021-11-11  1509  static inline unsigned long perf_guest_get_ip(void)
1c3430516b0732 Sean Christopherson 2021-11-11  1510  {
87b940a0675e25 Sean Christopherson 2021-11-11  1511  	return static_call(__perf_guest_get_ip)();
1c3430516b0732 Sean Christopherson 2021-11-11  1512  }
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1513  static inline unsigned long perf_guest_get_frame_pointer(void)
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1514  {
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1515  	return static_call(__perf_guest_get_frame_pointer)();
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1516  }
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1517  static inline bool perf_guest_read_virt(void *addr, void *dest, unsigned int length)
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1518  {
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1519  	return static_call(__perf_guest_read_virt)(addr, dest, length);
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1520  }
1c3430516b0732 Sean Christopherson 2021-11-11  1521  static inline unsigned int perf_guest_handle_intel_pt_intr(void)
1c3430516b0732 Sean Christopherson 2021-11-11  1522  {
87b940a0675e25 Sean Christopherson 2021-11-11  1523  	return static_call(__perf_guest_handle_intel_pt_intr)();
1c3430516b0732 Sean Christopherson 2021-11-11  1524  }
2934e3d09350c1 Sean Christopherson 2021-11-11  1525  extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs);
2934e3d09350c1 Sean Christopherson 2021-11-11  1526  extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs);
2aef6f306b39bb Sean Christopherson 2021-11-11  1527  #else
2aef6f306b39bb Sean Christopherson 2021-11-11  1528  static inline unsigned int perf_guest_state(void)		 { return 0; }
2aef6f306b39bb Sean Christopherson 2021-11-11  1529  static inline unsigned long perf_guest_get_ip(void)		 { return 0; }
7b615fa3e48fd3 Tianyi Liu          2023-10-08  1530  static inline unsigned long perf_guest_get_frame_pointer(void)	{ return 0; }
7b615fa3e48fd3 Tianyi Liu          2023-10-08 @1531  static inline bool perf_guest_read_virt(void*, void*, unsigned int)	{ return 0; }
2aef6f306b39bb Sean Christopherson 2021-11-11  1532  static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; }
2aef6f306b39bb Sean Christopherson 2021-11-11  1533  #endif /* CONFIG_GUEST_PERF_EVENTS */
39447b386c846b Zhang, Yanmin       2010-04-19  1534  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH v2 0/5] perf: KVM: Enable callchains for guests
@ 2023-10-08 14:48 Tianyi Liu
  2023-10-08 14:53   ` Tianyi Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Tianyi Liu @ 2023-10-08 14:48 UTC (permalink / raw)
  To: seanjc, pbonzini, peterz, mingo, acme
  Cc: linux-arm-kernel, kvmarm, linux-kernel, linux-perf-users, kvm,
	x86, mark.rutland, alexander.shishkin, jolsa, namhyung, irogers,
	adrian.hunter, Tianyi Liu

Hi there,

This series of patches enables callchains for guests (used by perf kvm),
which holds the top spot on the perf wiki TODO list [1]. This allows users
to perform guest OS callchain or performance analysis from external
using PMU events.

The event processing flow is as follows (shown as backtrace):
  #0 kvm_arch_vcpu_get_frame_pointer / kvm_arch_vcpu_read_virt (per arch)
  #1 kvm_guest_get_frame_pointer / kvm_guest_read_virt
     <callback function pointers in `struct perf_guest_info_callbacks`>
  #2 perf_guest_get_frame_pointer / perf_guest_read_virt
  #3 perf_callchain_guest
  #4 get_perf_callchain
  #5 perf_callchain

Between #0 and #1 is the interface between KVM and the arch-specific
impl, while between #1 and #2 is the interface between Perf and KVM.
The 1st patch implements #0. The 2nd patch extends interfaces between #1
and #2, while the 3rd patch implements #1. The 4th patch implements #3
and modifies #4 #5. The last patch is for userspace utils.

Since arm64 hasn't provided some foundational infrastructure (interface
for reading from a virtual address of guest), the arm64 implementation
is stubbed for now because it's a bit complex, and will be implemented
later.

Tested with both 32-bit and 64-bit guest operating systems / unikernels,
that `perf script` could correctly show the certain callchains.
FlameGraphs can also be generated with this series of patches and [2].

Any feedback will be greatly appreciated.

[1] https://perf.wiki.kernel.org/index.php/Todo
[2] https://github.com/brendangregg/FlameGraph

v1:
https://lore.kernel.org/kvm/SYYP282MB108686A73C0F896D90D246569DE5A@SYYP282MB1086.AUSP282.PROD.OUTLOOK.COM/

Changes since v1:
- v1 only includes partial KVM modifications, while v2 is a complete
implementation. Also updated based on Sean's feedback.

Tianyi Liu (5):
  KVM: Add arch specific interfaces for sampling guest callchains
  perf kvm: Introduce guest interfaces for sampling callchains
  KVM: implement new perf interfaces
  perf kvm: Support sampling guest callchains
  perf tools: Support PERF_CONTEXT_GUEST_* flags

 arch/arm64/kvm/arm.c                | 17 +++++++++
 arch/x86/events/core.c              | 56 +++++++++++++++++++++++------
 arch/x86/kvm/x86.c                  | 18 ++++++++++
 include/linux/kvm_host.h            |  4 +++
 include/linux/perf_event.h          | 18 +++++++++-
 kernel/bpf/stackmap.c               |  8 ++---
 kernel/events/callchain.c           | 27 +++++++++++++-
 kernel/events/core.c                | 17 ++++++++-
 tools/perf/builtin-timechart.c      |  6 ++++
 tools/perf/util/data-convert-json.c |  6 ++++
 tools/perf/util/machine.c           |  6 ++++
 virt/kvm/kvm_main.c                 | 25 +++++++++++++
 12 files changed, 191 insertions(+), 17 deletions(-)


base-commit: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-12 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 22:07 [PATCH v2 2/5] perf kvm: Introduce guest interfaces for sampling callchains kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-10-08 14:48 [PATCH v2 0/5] perf: KVM: Enable callchains for guests Tianyi Liu
2023-10-08 14:53 ` [PATCH v2 2/5] perf kvm: Introduce guest interfaces for sampling callchains Tianyi Liu
2023-10-08 14:53   ` Tianyi Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.