From nobody Thu Dec 25 23:30:17 2025 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FEFA12E5B; Thu, 11 Jan 2024 08:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Tno/F8WX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704961221; x=1736497221; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=URPY2Q+tBosWcEFXoClywjzD6iiLnMiyG3Xuko2X9Hg=; b=Tno/F8WXqCOWESFeAv7m6SGWeGn0qHiUhzj9LHQ9vSKeI++gWuEOgdAq HbwKn9S6L55+Avgmv8/sY708hz3iFwVpxe+L5f/0tqkqgSQ71xDCu8EGF Pj5G05ON+G7pp1r0bhBwaCCUow/GojsrmUC+d5jPWLX3rIVbDkR7cjhOo 0HYZtJnM+Pvlwthw2uT+MmDY17XP6Jrseyc90HjP5GzYcrteh/3Vg5mia AdJie12BuwsNO2zOK7aGVEjkYYfI1bxlyX9WeVOYKFXQWmDqXgjYd7A+D jHH3BvpuZgOwtVRFprWdu83frLQRrQXBHGpf+clXMKdye8kz6vOWLQz+s Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="465166595" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="465166595" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="925923186" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="925923186" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.52.224]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:16 -0800 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V4 10/11] perf intel-pt: Add documentation for pause / resume Date: Thu, 11 Jan 2024 10:19:13 +0200 Message-Id: <20240111081914.3123-11-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111081914.3123-1-adrian.hunter@intel.com> References: <20240111081914.3123-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Type: text/plain; charset="utf-8" Document the use of aux-action config term and provide a simple example. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-intel-pt.txt | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Docume= ntation/perf-intel-pt.txt index b3d9fb29ffd3..3a0d73bf8bc2 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -551,6 +551,9 @@ Support for this feature is indicated by: which contains "1" if the feature is supported and "0" otherwise. =20 +*aux-action=3Dstart-paused*:: +Start tracing paused, refer to the section <<_pause_or_resume_tracing,Paus= e or Resume Tracing>> + =20 config terms on other events ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -566,6 +569,9 @@ and PEBS-via-PT. In those cases, the other events can = have config terms below: Used to select PEBS-via-PT, refer to the section <<_pebs_via_intel_pt,PEBS via Intel PT>> =20 +*aux-action*:: + Used to pause or resume tracing, refer to the section + <<_pause_or_resume_tracing,Pause or Resume Tracing>> =20 AUX area sampling option ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1911,6 +1917,70 @@ For pipe mode, the order of events and timestamps ca= n presumably be messed up. =20 =20 +Pause or Resume Tracing +----------------------- + +With newer Kernels, it is possible to use other selected events to pause +or resume Intel PT tracing. This is configured by using the "aux-action" +config term: + +"aux-action=3Dpause" is used with events that are to pause Intel PT tracin= g. + +"aux-action=3Dresume" is used with events that are to resume Intel PT trac= ing. + +"aux-action=3Dstart-paused" is used with the Intel PT event to start in a +paused state. + +For example, to trace only the uname system call (sys_newuname) when runni= ng the +command line utility uname: + + $ perf record --kcore -e intel_pt/aux-action=3Dstart-paused/k,syscalls:sy= s_enter_newuname/aux-action=3Dresume/,syscalls:sys_exit_newuname/aux-action= =3Dpause/ uname + Linux + [ perf record: Woken up 1 times to write data ] + [ perf record: Captured and wrote 0.043 MB perf.data ] + $ perf script --call-trace + uname 30805 [000] 24001.058782799: name: 0x7ffc9c1865b0 + uname 30805 [000] 24001.058784424: psb offs: 0 + uname 30805 [000] 24001.058784424: cbr: 39 freq: 3904 MHz (139%) + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) debug_smp= _processor_id + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) __x64_sys= _newuname + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) down_= read + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) _= _cond_resched + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) p= reempt_count_add + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) = in_lock_functions + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) p= reempt_count_sub + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) up_re= ad + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) p= reempt_count_add + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) = in_lock_functions + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) p= reempt_count_sub + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) _copy= _to_user + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) syscall_e= xit_to_user_mode + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) sysca= ll_exit_work + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) p= erf_syscall_exit + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) = debug_smp_processor_id + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_trace_buf_alloc + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_swevent_get_recursion_context + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = debug_smp_processor_id + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = debug_smp_processor_id + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_tp_event + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_trace_buf_update + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = tracing_gen_ctx_irq_test + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_swevent_event + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = __perf_event_account_interrupt + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = __this_cpu_preempt_check + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_event_output_forward + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = perf_event_aux_pause + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = ring_buffer_get + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = __rcu_read_lock + uname 30805 [000] 24001.058785046: ([kernel.kallsyms]) = __rcu_read_unlock + uname 30805 [000] 24001.058785254: ([kernel.kallsyms]) = pt_event_stop + uname 30805 [000] 24001.058785254: ([kernel.kallsyms]) = debug_smp_processor_id + uname 30805 [000] 24001.058785254: ([kernel.kallsyms]) = debug_smp_processor_id + uname 30805 [000] 24001.058785254: ([kernel.kallsyms]) = native_write_msr + uname 30805 [000] 24001.058785463: ([kernel.kallsyms]) = native_write_msr + uname 30805 [000] 24001.058785639: 0x0 + + EXAMPLE ------- =20 --=20 2.34.1