From nobody Sat Apr 11 10:53:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7936EC25B0D for ; Thu, 11 Aug 2022 17:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236105AbiHKRQm (ORCPT ); Thu, 11 Aug 2022 13:16:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234479AbiHKRPx (ORCPT ); Thu, 11 Aug 2022 13:15:53 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 027322314C for ; Thu, 11 Aug 2022 10:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660237491; x=1691773491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gwe/m5biPEWSgjEYgmRoCpmAZ2RbdTSZ059leJBW3I0=; b=hOTsI7ifdvvSTigx5iZ2PvBIyWS4NTc//Oyesz+Rgdy9XgeK0Ploxns1 qDUEUo2sC081/Y5wwzhWrk0GlHL9bzx9TcPcJIg0jQubLSRPVDjYJc1A2 4dotAjR+Da7sC1UH+EnhDyF4yc8ZzjsUGMzHUJ0kyqSAndkgu1VkxWbWf pGX4aNt6yrFcjU6+FDIPxLpNjX8z7Fp8+EHqQSJC8SrWY/r9cIDYu7JNV 7oxqkKk1JwD6BKWv+DpGr1ZW22OnIHScnSB/RuGgGfDJhJ2+0LBFloJ7r Fkj9OZ3OiRuW/MOyCg42PZqnJDlOdDKHjc26h9lKTC8boamSDXzZqRJpI Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10436"; a="290161805" X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="290161805" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="602234620" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.35.150]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:28 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] perf script: Fix missing guest option documentation Date: Thu, 11 Aug 2022 20:04:09 +0300 Message-Id: <20220811170411.84154-2-adrian.hunter@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220811170411.84154-1-adrian.hunter@intel.com> References: <20220811170411.84154-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" perf script documentation is missing several options relating to guests. Add them. Fixes: 15a108af1a18 ("perf script: Allow specifying the files to process gu= est samples") Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-script.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Document= ation/perf-script.txt index 4c95e79e2c39..48ee42a891b6 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -487,6 +487,29 @@ include::itrace.txt[] For itrace only show specified functions and their callees for itrace. Multiple functions can be separated by comma. =20 +--guestmount=3D:: + Guest OS root file system mount directory. Users mount guest OS + root directories under by a specific filesystem access method, + typically, sshfs. + For example, start 2 guest OS, one's pid is 8888 and the other's is 9999: +[verse] + $ mkdir \~/guestmount + $ cd \~/guestmount + $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ + $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ + $ perf script --guestmount=3D~/guestmount + +--guestkallsyms=3D:: + Guest OS /proc/kallsyms file copy. perf reads it to get guest + kernel symbols. Users copy it out from guest OS. + +--guestmodules=3D:: + Guest OS /proc/modules file copy. perf reads it to get guest + kernel module information. Users copy it out from guest OS. + +--guestvmlinux=3D:: + Guest OS kernel vmlinux. + --switch-on EVENT_NAME:: Only consider events after this event is found. =20 --=20 2.25.1 From nobody Sat Apr 11 10:53:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0874EC19F2A for ; Thu, 11 Aug 2022 17:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236147AbiHKRQq (ORCPT ); Thu, 11 Aug 2022 13:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235581AbiHKRPx (ORCPT ); Thu, 11 Aug 2022 13:15:53 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF09913CD6 for ; Thu, 11 Aug 2022 10:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660237492; x=1691773492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AlFzoFKeimTAoqlg1xyanI/s9pf5w2ZyBR8pX5BSkwc=; b=lVxuHQHATmbdxsRLJz/b4RtIZsGwRiSHu7qzQLHJ11SRlhDwPceG9wxX 04AkIYWCf5SU6prIWa6hjY9oPrimSKx4IbhHbBmCLg0DUs9Q0iU0hVuf/ KTf4SyRfR8AffmLnTwMtUCBzIosYsQfrxHi0cMOMOExtM+gSG7vCcGtVv RuA8Ml2Du3cBfxmBmHXqe/ElP81vGG7Ciul/14/UwKGts7EiQqNVYO1AE CqsaJzp3vsUJdj9Z+cyPzxj2hiPOZNVnGHangbDWxN/MU1WfubwVuZqK6 Ev+xHcBH2HzWOiMjsT8Azr508HY9eyHkywfbr2fZDOIV3efiIOfjd2qBB g==; X-IronPort-AV: E=McAfee;i="6400,9594,10436"; a="290161818" X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="290161818" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:32 -0700 X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="602234628" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.35.150]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:30 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] perf inject: Fix missing guestmount option documentation Date: Thu, 11 Aug 2022 20:04:10 +0300 Message-Id: <20220811170411.84154-3-adrian.hunter@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220811170411.84154-1-adrian.hunter@intel.com> References: <20220811170411.84154-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" perf inject documentation is missing the guestmount option. Add it. Fixes: 97406a7e4fa6 ("perf inject: Add support for injecting guest sideband= events") Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-inject.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Document= ation/perf-inject.txt index 646aa31586ed..c741ca2107b1 100644 --- a/tools/perf/Documentation/perf-inject.txt +++ b/tools/perf/Documentation/perf-inject.txt @@ -102,6 +102,18 @@ include::itrace.txt[] should be used, and also --buildid-all and --switch-events may be useful. =20 +--guestmount=3D:: + Guest OS root file system mount directory. Users mount guest OS + root directories under by a specific filesystem access method, + typically, sshfs. + For example, start 2 guest OS, one's pid is 8888 and the other's is 9999: +[verse] + $ mkdir \~/guestmount + $ cd \~/guestmount + $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ + $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ + $ perf inject --guestmount=3D~/guestmount + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1], --=20 2.25.1 From nobody Sat Apr 11 10:53:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BC59C19F2A for ; Thu, 11 Aug 2022 17:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235129AbiHKRQu (ORCPT ); Thu, 11 Aug 2022 13:16:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235617AbiHKRPx (ORCPT ); Thu, 11 Aug 2022 13:15:53 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6871924945 for ; Thu, 11 Aug 2022 10:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660237493; x=1691773493; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t6oRrpXV57AhHFylmsZ4bzcUSzGU82BEfHWqfj2j9qo=; b=RocOqBxIT+G+AxLtFqzbUOWCpHn7RjMlB8sdczM6XHDxqyS2X5Iq6hdq XS10XQ99p5ym1i6FAyzAhde+Oaec0RESpR/xKuQzofZIKxGBAMyNQOL+Y hffVxfXxJuRnjCCQjce8Q1OxgsEwTDuy7lvaTVOXhF0lULVmTSbbtM+Mn paTyybuZJqWkIuBRvjsJ5gh4FiUT5jDOc9j2nSiyL0vIEZ9A91cqswyYG 7LWAoNlKD/mjdvbkL7bOLc4OpMTOlRvIHQkD9nDut4iU2b7zL2Oshc8TR 8XEDkCbs7IrVgR1A/n76PVpfqIozoGDp3uh9SYtTpcVyCLhVAu/s6Os9C A==; X-IronPort-AV: E=McAfee;i="6400,9594,10436"; a="290161827" X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="290161827" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:34 -0700 X-IronPort-AV: E=Sophos;i="5.93,230,1654585200"; d="scan'208";a="602234632" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.35.150]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 10:04:33 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] perf tools: Tidy guest option documentation Date: Thu, 11 Aug 2022 20:04:11 +0300 Message-Id: <20220811170411.84154-4-adrian.hunter@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220811170411.84154-1-adrian.hunter@intel.com> References: <20220811170411.84154-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Move common guest options into include files. Use attribute substitution to customize an example, using "[verse]" to define the block instead of a "literal" block which does not permit substitution. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/guest-files.txt | 16 +++++++++++++ tools/perf/Documentation/guestmount.txt | 11 +++++++++ tools/perf/Documentation/perf-inject.txt | 14 +++--------- tools/perf/Documentation/perf-kvm.txt | 25 ++++---------------- tools/perf/Documentation/perf-script.txt | 29 +++--------------------- 5 files changed, 38 insertions(+), 57 deletions(-) create mode 100644 tools/perf/Documentation/guest-files.txt create mode 100644 tools/perf/Documentation/guestmount.txt diff --git a/tools/perf/Documentation/guest-files.txt b/tools/perf/Document= ation/guest-files.txt new file mode 100644 index 000000000000..8cc0b092f996 --- /dev/null +++ b/tools/perf/Documentation/guest-files.txt @@ -0,0 +1,16 @@ +include::guestmount.txt[] + +--guestkallsyms=3D:: + Guest OS /proc/kallsyms file copy. perf reads it to get guest + kernel symbols. Users copy it out from guest OS. + +--guestmodules=3D:: + Guest OS /proc/modules file copy. perf reads it to get guest + kernel module information. Users copy it out from guest OS. + +--guestvmlinux=3D:: + Guest OS kernel vmlinux. + +--guest-code:: + Indicate that guest code can be found in the hypervisor process, + which is a common case for KVM test programs. diff --git a/tools/perf/Documentation/guestmount.txt b/tools/perf/Documenta= tion/guestmount.txt new file mode 100644 index 000000000000..6edf12363add --- /dev/null +++ b/tools/perf/Documentation/guestmount.txt @@ -0,0 +1,11 @@ +--guestmount=3D:: + Guest OS root file system mount directory. Users mount guest OS + root directories under by a specific filesystem access method, + typically, sshfs. + For example, start 2 guest OS, one's pid is 8888 and the other's is 9999: +[verse] + $ mkdir \~/guestmount + $ cd \~/guestmount + $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ + $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ + $ perf {GMEXAMPLECMD} --guestmount=3D~/guestmount {GMEXAMPLESUBCMD} diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Document= ation/perf-inject.txt index c741ca2107b1..ffc293fdf61d 100644 --- a/tools/perf/Documentation/perf-inject.txt +++ b/tools/perf/Documentation/perf-inject.txt @@ -102,17 +102,9 @@ include::itrace.txt[] should be used, and also --buildid-all and --switch-events may be useful. =20 ---guestmount=3D:: - Guest OS root file system mount directory. Users mount guest OS - root directories under by a specific filesystem access method, - typically, sshfs. - For example, start 2 guest OS, one's pid is 8888 and the other's is 9999: -[verse] - $ mkdir \~/guestmount - $ cd \~/guestmount - $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ - $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ - $ perf inject --guestmount=3D~/guestmount +:GMEXAMPLECMD: inject +:GMEXAMPLESUBCMD: +include::guestmount.txt[] =20 SEE ALSO -------- diff --git a/tools/perf/Documentation/perf-kvm.txt b/tools/perf/Documentati= on/perf-kvm.txt index 83c742adf86e..2ad3f5d9f72b 100644 --- a/tools/perf/Documentation/perf-kvm.txt +++ b/tools/perf/Documentation/perf-kvm.txt @@ -77,26 +77,11 @@ OPTIONS Collect host side performance profile. --guest:: Collect guest side performance profile. ---guestmount=3D:: - Guest os root file system mount directory. Users mounts guest os - root directories under by a specific filesystem access meth= od, - typically, sshfs. For example, start 2 guest os. The one's pid is 8888 - and the other's is 9999. - #mkdir ~/guestmount; cd ~/guestmount - #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ - #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ - #perf kvm --host --guest --guestmount=3D~/guestmount top ---guestkallsyms=3D:: - Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get gue= st - kernel symbols. Users copy it out from guest os. ---guestmodules=3D:: - Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest - kernel module information. Users copy it out from guest os. ---guestvmlinux=3D:: - Guest os kernel vmlinux. ---guest-code:: - Indicate that guest code can be found in the hypervisor process, - which is a common case for KVM test programs. + +:GMEXAMPLECMD: kvm --host --guest +:GMEXAMPLESUBCMD: top +include::guest-files.txt[] + -v:: --verbose:: Be more verbose (show counter open errors, etc). diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Document= ation/perf-script.txt index 48ee42a891b6..68e37de5fae4 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -487,29 +487,6 @@ include::itrace.txt[] For itrace only show specified functions and their callees for itrace. Multiple functions can be separated by comma. =20 ---guestmount=3D:: - Guest OS root file system mount directory. Users mount guest OS - root directories under by a specific filesystem access method, - typically, sshfs. - For example, start 2 guest OS, one's pid is 8888 and the other's is 9999: -[verse] - $ mkdir \~/guestmount - $ cd \~/guestmount - $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ - $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ - $ perf script --guestmount=3D~/guestmount - ---guestkallsyms=3D:: - Guest OS /proc/kallsyms file copy. perf reads it to get guest - kernel symbols. Users copy it out from guest OS. - ---guestmodules=3D:: - Guest OS /proc/modules file copy. perf reads it to get guest - kernel module information. Users copy it out from guest OS. - ---guestvmlinux=3D:: - Guest OS kernel vmlinux. - --switch-on EVENT_NAME:: Only consider events after this event is found. =20 @@ -530,9 +507,9 @@ include::itrace.txt[] The known limitations include exception handing such as setjmp/longjmp will have calls/returns not match. =20 ---guest-code:: - Indicate that guest code can be found in the hypervisor process, - which is a common case for KVM test programs. +:GMEXAMPLECMD: script +:GMEXAMPLESUBCMD: +include::guest-files.txt[] =20 SEE ALSO -------- --=20 2.25.1