Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp553256ybt; Fri, 10 Jul 2020 06:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziEMqXHqurHNkYLqGvkK8UL8s+DPNlukW4i6/JyHEA6fwulOAaY1TwcsBPS39eykvlQ+sf X-Received: by 2002:a17:906:7686:: with SMTP id o6mr63479605ejm.326.1594388774785; Fri, 10 Jul 2020 06:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594388774; cv=none; d=google.com; s=arc-20160816; b=ShOjqmkROB4xqUxCw52CjEKjoVVSUR0tNogdBR/v1EZuIDwp11bRXPE2WmrcWYa3+o yfAo7GBEhMbnPAtO4K6VD5Lt6yB3eiljFYDICK3kOp/q3/KVY80uHgMSanMgrkTfS3xe x9TfGpibPW5rTrMpv9/YEgO8EXDdewpOyd/XJBrYEUzdCWIKKscdnVdK708USvBZgRYf 5B2zLYbWr79HON+8w4UxqK9SpxY4XaldHFQ0MOyrOCyYn4mVTAsjFyNr+coh1F2iWtIJ kCQxbYDqb8VWSq5v1vjFCjiIERcu90B9y12eoACUEk58Ws5j5E5AlcqRZ5DYUs2AU4gk /QDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oR1iCdyjqdW0rpMyzFcXJYpdaFj2hk3nZIS6lcn/OyQ=; b=Bo9rR1Z0m9nuemdASQE0ZMinPmDenCh9Me4cPdp6sZ4B1HdOqhBWO335W3H63njYWz e7O3DhrizHndUAFc0TyQGZChWZMR+QMIkFNfxYa+WPYBIMKGryfGzzCNn/NYrY8V341h da39ZFmftJCNAMbaf898N4s4WCuDclIb8atIPorNt41anaVArKB6npSJHldtW1zTWyxM it/xBJtkiNBvGIXMSAln8LUsJpp+T6wDBls+lSP5zwuWYF7HpLyNg40JMheht4yCesSr rlmM6f9Dw5wirxq0uM+zIM+b7nL7+6AMxBPnkQZs6yIORrs9skxrjTH+CHT9jeXroQUX E5aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lSjdprKU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id of23si3889565ejb.414.2020.07.10.06.45.50; Fri, 10 Jul 2020 06:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lSjdprKU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbgGJNoJ (ORCPT + 99 others); Fri, 10 Jul 2020 09:44:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728054AbgGJNoH (ORCPT ); Fri, 10 Jul 2020 09:44:07 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE84C08C5CE for ; Fri, 10 Jul 2020 06:44:07 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id m22so2545253pgv.9 for ; Fri, 10 Jul 2020 06:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oR1iCdyjqdW0rpMyzFcXJYpdaFj2hk3nZIS6lcn/OyQ=; b=lSjdprKUHFRT8IktlGd4X04AGtxXKmyE36+sFI8tYWGn10Fy8tCa1ihP5ukwX70t22 D2XPYZscGKVw0qu4dB97WU2LTfOuAU1l9GlAaP/39htpdbuJLCE2X1/501Di93vvykaG txSL59dcCPdLWGovy43A+lXFYt4sSdsX6YYOj/0J47naNQ2H5vTBwKVjvRUBcJjMrZet ZjILVYCpV5shiJuu8sa3gfOqEcjoElTJBf0/oUldoQeCDs5H7pVqH5bRUGyO33CKYSQr aJNZrXaZy4/GZY8uLeXsbDzcOy+Bb8ajqt/VHdCUbLZYhZjP5m3IykMfoCMkBUxdRZ27 PwEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oR1iCdyjqdW0rpMyzFcXJYpdaFj2hk3nZIS6lcn/OyQ=; b=UVoRRyoBNheqK0LYn65L8rHRSlzVSfaxXpMo/qQFUaE7cKwrxKgdo2tZG/4kXe/1yx TWZZXG7LJz7Fa/ZD61vFaIvmVlssVCO5BiQD5KHBa/nu4h8Cz+QeiBP8/C0vN8O5MyzH fy9p/x4wcgIzmAa1IewmEGzVKDTg/fXs2C/9k6LahiRFyHazuM4BU7Is8Pg9CaZ1ZrpL YdMffhOBAF2sPd3Hl6vTIHGD0enZHHpmoYAEpSJ3fbWtls/jL3RRZbL5UCfjYhGrMP6Z u1vbwTwCvI2Ymxjuk+8ubsSPcUO2dWPsWVjD1hzQLFhrkm8T63UTUikEk5rEEuvDTYgu KSAg== X-Gm-Message-State: AOAM531RizBi5DzF2MnbgJfiKR5Bs8YfYfu/F4ouTeWphOm2+crvgzMf ZMyBbSN3a4lqWWBcQ3Cit7M= X-Received: by 2002:aa7:810c:: with SMTP id b12mr20521313pfi.69.1594388647062; Fri, 10 Jul 2020 06:44:07 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id 198sm6297363pfb.27.2020.07.10.06.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 06:44:06 -0700 (PDT) From: Changbin Du To: Jiri Olsa , Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH v4 03/17] perf ftrace: add option -t/--tid to filter by thread id Date: Fri, 10 Jul 2020 21:43:08 +0800 Message-Id: <20200710134322.15400-4-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710134322.15400-1-changbin.du@gmail.com> References: <20200710134322.15400-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows us to trace single thread instead of the whole process. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 4 ++++ tools/perf/builtin-ftrace.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt index d79560dea19f..e204bf6d50d8 100644 --- a/tools/perf/Documentation/perf-ftrace.txt +++ b/tools/perf/Documentation/perf-ftrace.txt @@ -38,6 +38,10 @@ OPTIONS --pid=:: Trace on existing process id (comma separated list). +-t:: +--tid=:: + Trace on existing thread id (comma separated list). + -a:: --all-cpus:: Force system-wide collection. Scripts run without a diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 244cc8e6bd60..1188b82c6541 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -515,6 +515,8 @@ int cmd_ftrace(int argc, const char **argv) "Show available functions to filter"), OPT_STRING('p', "pid", &ftrace.target.pid, "pid", "trace on existing process id"), + OPT_STRING('t', "tid", &ftrace.target.tid, "tid", + "trace on existing thread id (exclusive to --pid)"), OPT_INCR('v', "verbose", &verbose, "be more verbose"), OPT_BOOLEAN('a', "all-cpus", &ftrace.target.system_wide, -- 2.25.1