Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1495381rdd; Thu, 11 Jan 2024 00:23:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCFEJ1V0FlQA5UVHRxRIjxyIz/W4Z0sGXvwDo9rj3QIZOqdUOS3kJoUwlaz3tBo/zGVfah X-Received: by 2002:a17:903:2343:b0:1d4:55e0:bd0e with SMTP id c3-20020a170903234300b001d455e0bd0emr916313plh.18.1704961423645; Thu, 11 Jan 2024 00:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704961423; cv=none; d=google.com; s=arc-20160816; b=gAoyWsZ3c7T0l889xLw5O/lNh2r8Ogmi9Z3cU4RBINOg+PKwo4Cjp485FEf0ZnhXI2 CHpJWD/x+2yubJwBSH9d4iAonOXntGvbThCpbRw9U1BuI/9iMuI8GLOwIY2MnAMFZmAZ +J2j0RzCZ5nzH8q9dooT5MVPnw7n5a3tYbrb+c/D60CkEREaIGYA8stpmVs2HmpGmFyy AjoXdo9BLRuL0sH7nqRIwFCNaPXWKp4TyFeTPba36J5uoPR3WQJ98tqhuumlHLIb+Pe/ 8gV31WKLWgjRvvWqKONovzPfNSOAPK6H+kQjVYCKJKD39JEURiBgQvhdFSNlzESQfkdg wZ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=iwU8fLYk78QWRG8m1MmZvHL2cdxqtG4tSq850+7AarY=; fh=cd6f3jNh3j7Qvd5mXmd/oCoIQnwAYeKd0j29JiSirLE=; b=jOd61NIxfHaLVBq8+PBIKsxrwkyACyxOJWTPO97PDF6Q+yrD9KVBIBvmDn048M4fCN Y4Kfd90GM0ATQgZVUkdPPN/zYqXMhi8dpKJTI5xW/AwAW4GoEpHAezoDRdhi8ImOja32 5BTo8hiFPRRbv2ocN3o0T1bCl6VsRrdJZ4zgmBdi/7AO6Yil5nrWX/2pMg6PbY2ok9Ie AL/pkY49jimUEIEnIhbCZauvHJMaSk5em53cEZKxvinPpHWyfwM5ZWFmD/thE5sVrRfa +Yyl/pRLNTvkINHdgq+jzZ2QNqBUuddpppHlrXQl91JYYC6PzYy48ASsQtoG/qWMa9E6 z69Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Tno/F8WX"; spf=pass (google.com: domain of linux-kernel+bounces-23209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id kh5-20020a170903064500b001d4b4daa27dsi575605plb.19.2024.01.11.00.23.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 00:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Tno/F8WX"; spf=pass (google.com: domain of linux-kernel+bounces-23209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1EFE528AC2F for ; Thu, 11 Jan 2024 08:22:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B82C12E79; Thu, 11 Jan 2024 08:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Tno/F8WX" 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 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: 8bit 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/Documentation/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. +*aux-action=start-paused*:: +Start tracing paused, refer to the section <<_pause_or_resume_tracing,Pause or Resume Tracing>> + 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>> +*aux-action*:: + Used to pause or resume tracing, refer to the section + <<_pause_or_resume_tracing,Pause or Resume Tracing>> AUX area sampling option ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1911,6 +1917,70 @@ For pipe mode, the order of events and timestamps can presumably be messed up. +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=pause" is used with events that are to pause Intel PT tracing. + +"aux-action=resume" is used with events that are to resume Intel PT tracing. + +"aux-action=start-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 running the +command line utility uname: + + $ perf record --kcore -e intel_pt/aux-action=start-paused/k,syscalls:sys_enter_newuname/aux-action=resume/,syscalls:sys_exit_newuname/aux-action=pause/ 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]) preempt_count_add + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) in_lock_functions + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) preempt_count_sub + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) up_read + uname 30805 [000] 24001.058784629: ([kernel.kallsyms]) preempt_count_add + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) in_lock_functions + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) preempt_count_sub + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) _copy_to_user + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) syscall_exit_to_user_mode + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) syscall_exit_work + uname 30805 [000] 24001.058784838: ([kernel.kallsyms]) perf_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 ------- -- 2.34.1