Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp177215ybh; Fri, 17 Jul 2020 23:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn2P0xhmbQGFhvPys6y7aAOTRD9Z1xM/fHSQoX2Xk/VRuFFMCQ4pG7WuZ5CNFWvDG2T7gh X-Received: by 2002:a50:8143:: with SMTP id 61mr12840968edc.202.1595055247578; Fri, 17 Jul 2020 23:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595055247; cv=none; d=google.com; s=arc-20160816; b=ZX964ANH3t8Xx5u9pSrKSw6S/GRKVh/7EcY+xB+UL4OfWOu7bZ+eSDL/q2Mtd2yn65 /6FvlrLhIZ/aQaRiMnvN0uZl6AHCZ5QY7VWobjA2r2p/Zv/geOsUjfPf4Mx1+KdtbM+z mq4PVxcXsi4AEXFnjIeTElOvDIGaXXhA1mXze+U9zjU3jTOXjMz4yLlChP2AS8qTTttf 16uNVU4br2aKgouQToVOqYxxSU5RXxOvYQB2qbTHA+hoOR2ycG9V7rdybEvL+CB43WvA zBRPssdtIU2bVPKOPAJPwo1LOd11u/eJq0lh+PI/2avxNSsjL784Ot3/U9EZJoxoDHN2 yqgA== 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=4ILcbTPlZOCIVf/7yt+0/wleV1z8z1rhYIwv+MSgreQ=; b=pMISM3xYcCio+OWLB42f7WFK/mbMgcRbPKKz15ckiTrQXpwo082bBAXMjPSl19ZdVW mztw4o7jD6ko35R6oau+jd8Rt4P1gIRhqM4/cOpGnwbpxskYkrwQUzit11P/Z81bvxf0 IJk6DRaX+YfpLv+LmUbEgpIqcNJCahhAnql2pbEa8ibXu3EOBwd4eqoIREP1O/1zHR7d eWGdrAQQn5mFHQJWb+NCtH2yK2C3NMxOkCkQkYkRt8xPrnLGpBATCcmWXYIu+LEH5qzN iAKsC5c03jPEhILvmQ9lFT9S9wTCXjCGGiCGw6I7qiml4tvJlP/XcjavsOc0KChzTBlo 3+Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rvb5jLhP; 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 dg12si6522533edb.81.2020.07.17.23.53.45; Fri, 17 Jul 2020 23:54:07 -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=Rvb5jLhP; 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 S1727042AbgGRGvA (ORCPT + 99 others); Sat, 18 Jul 2020 02:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbgGRGu7 (ORCPT ); Sat, 18 Jul 2020 02:50:59 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374B4C0619D2 for ; Fri, 17 Jul 2020 23:50:59 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a9so1841964pjd.3 for ; Fri, 17 Jul 2020 23:50:59 -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=4ILcbTPlZOCIVf/7yt+0/wleV1z8z1rhYIwv+MSgreQ=; b=Rvb5jLhPq9FXChm3Q8qmnT3HtAsh95qrKiX0B2kiQ0v1ED80y1gvh16QIYX3HcTATB DgEqRjU2pQtX5jdQvM8LD9vcHmfK4GjMGK61QmrEzcIXnu3W52QBCjjy0FoCgDOi+/iQ TLt2Vt+1W6KWxsjU1FiLEZdYVsks2V9+l997yI6W/jShGciyu80PCAcyY4f8m97gSW1D Px8OtHB1uqSl8uIle54RwtIpjgzEXPwSnt73sx5tij13JkqqfXd6h/6xc56HBCLBMSm2 WFy/S/SaZYSESTaDSAhKqpD91o/U0C4thLjKpGl0PC9D8myJkSpwt+W49xEgk/POW0HS 8iyA== 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=4ILcbTPlZOCIVf/7yt+0/wleV1z8z1rhYIwv+MSgreQ=; b=oanQukP1/okPL8Cpgp8BtAev20gfUH3LtQnkWwTXjps6wGkgV3lyNQRe9tXypgeUFK 7QtCSJKTR3HSEcvn5em9EZE0moQVVsGqkUaS5vfqTiqwBEPixTQ2tIO8tlSIZQUDgVw0 r5pFSWk7QoY5TXKK3T7te4S0ykKpop5fXU1oLYMoBMT9G1TqW7nCqkZvEE8rckAKSzfv KxuIOO90s1R2jkz8AVX5gc5ct4qcghy8nYH9NMNfr7b1YGK1ZT0+Pog6xTCiNOSP4YGx DcGQZhX/mla/2Cz54lN9XB6TCP2RamoSqdgYlDtGNkro9dJKWOwQ9XVnrz7Hlhyk3t/h 3NLA== X-Gm-Message-State: AOAM531Ym1GScbt9fNQg4egDKEbkE0k+PHyYY3SKBKL6CIVCi9I1wa+a GavKzSOZMCTZhh0UbPq/peU= X-Received: by 2002:a17:90a:8e:: with SMTP id a14mr13703751pja.206.1595055058832; Fri, 17 Jul 2020 23:50:58 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id q10sm10422781pfk.86.2020.07.17.23.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 23:50:58 -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 v7 16/18] perf ftrace: add option --tid to filter by thread id Date: Sat, 18 Jul 2020 14:48:24 +0800 Message-Id: <20200718064826.9865-17-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200718064826.9865-1-changbin.du@gmail.com> References: <20200718064826.9865-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 | 3 +++ tools/perf/builtin-ftrace.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt index 077249c979f2..546a8cd01b7e 100644 --- a/tools/perf/Documentation/perf-ftrace.txt +++ b/tools/perf/Documentation/perf-ftrace.txt @@ -38,6 +38,9 @@ OPTIONS --pid=:: Trace on existing process id (comma separated list). +--tid=:: + Trace on existing thread id (comma separated list). + -D:: --delay:: Time (ms) to wait before starting tracing after program start. diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 64b68331048a..b07f71722b97 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -794,6 +794,9 @@ 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"), + /* TODO: Add short option -t after -t/--tracer can be removed. */ + OPT_STRING(0, "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