Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1289322ybt; Sat, 11 Jul 2020 05:43:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd72s20SvV3IWq7KzVWotshdoEo+UF9WIY7JtMB3sJFZRLXNtzHbArn2wBtMH+EKKvCZ7U X-Received: by 2002:a17:906:5595:: with SMTP id y21mr67340359ejp.61.1594471403441; Sat, 11 Jul 2020 05:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594471403; cv=none; d=google.com; s=arc-20160816; b=dIJgRC6jdNDs0aWyufuV8pU9Jh7msUMjynPoKHB+PRW0EpTY9EXzx8noQ8bnrJ9MbZ 4elDKGQo6xy7mpJ1seMtrZJyJ/AmYXNPd4CYvGd5tFcBS+hCncB5EMg0z/arxqOQqV8J FcUzexuvKLAjFkXdLJnFe+NV4V+kM9v9I9rTDeND+z1QZaR1SSdYkCK8vUFwsplREhLR i7PF+I1BVIw5fcpE/83LnAhY21hyLNs6nXh4Of0h41Ygq1JrDj5YODASYSjDWj07Y+FU ILX+FOJDh+7/GJYYKzO7zApWFEVSxYAttPa6dx3HImrEeag3i7H4ovEuScuArIzSrgDa mlhg== 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=y320XfPzoNaadeQDy/OZtIDkv7kPrH0jALn3dot67DvMsmWS91nh7w2awHNELaE8yH qxo0f+LuLwg5atQJVTBVf03LpqsoqO8uPyLtWmKWdU3fM5Dnv/Zlb1RhmLjceXjfzDXj QyhKiwyUWAv/0ldaGC+ZmXlwipkHew4OfgMbRBRHiu87ApCYN6hUkN8t5e3DmUX/kjlz 1utR0ji7+AwwOVUlbtRnmVyBSwB51qXIHSOAIMyk3BFjKC96mo8p2Ed7Jzjyzf7p1p80 fD4lG8cfX0ldns/FVUL+5K/JOhq3KBW/YALmXOxT5J8Q552lbWIRpcdAnt9EsX5RyLSP nm7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T7Bhox7o; 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 c89si6114598edf.35.2020.07.11.05.43.00; Sat, 11 Jul 2020 05:43:23 -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=T7Bhox7o; 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 S1728294AbgGKMma (ORCPT + 99 others); Sat, 11 Jul 2020 08:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgGKMm1 (ORCPT ); Sat, 11 Jul 2020 08:42:27 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D722C08C5DD for ; Sat, 11 Jul 2020 05:42:27 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id l63so3741127pge.12 for ; Sat, 11 Jul 2020 05:42:27 -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=T7Bhox7ofulwsbETIPGGFK7F1UMSiwKt9NyrXamJhZecsP3w30qZP6gV8cXiquRsDN DBvB7iDCycid/EniXSn+VS9WK87DjN/UfwG/xsm11W6qgq8o4/KPWTCPJJf2CFTNCRO7 nVvbQeDT0ce9c5oJMZZ3oKRYAqk5Dj+d6Zylg5NcAtNTcZyvcDNnvVdYWDv18tPKXGfy z92Rp8nsiyLBV0tfQZmjWcUZF49CNXzKnve0glJxSKKGgr1PzUXF6vTdS/yCYueaBJxU unga80+ibLh0B4hfptP3kelSATPWvohpmEdPueC1CN7OCkL6LN5NoEQKFlrqym0fQ/it L6Gg== 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=keL/7L/aSZxa5t21eUL6KMPqKWVOVwUQktxM3LMXZoNTWCWyljaoQK6sKZtZJbs4oo N1qX1x/XnKcx8fr0WzDShQn8YVQOrc1Lw598XPdsIyrJaSCro8AEFtaODmyR2KAZxxXP rsknPcgjcniT9q8UGxh9zIs8qht8iBf1M5iVaJ59OxiOHRtaiL7UMd4HTzGRRoZ/Wsdp dw+BeqCmFbRK36Pa8WatCzb/Nf7ffncPtqmXtsub+IMuL00s1BcR+aj/YHtCqtFjBCnn aHR8MTma9kR8lC9KVKIpupa+ASybp+GYFSwJ9X17Qk/vdtFUqn0/Frn3mIRM+mtT2bnA 45OA== X-Gm-Message-State: AOAM530/qhQ1/BSgxEdjav6sjV45zvci7cUgcRO5IkDiw06cgM6iOlkz Ft7lNNZG0HHwRjGHi30yoHM= X-Received: by 2002:a63:d30a:: with SMTP id b10mr61219517pgg.430.1594471346858; Sat, 11 Jul 2020 05:42:26 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id c19sm8352899pjs.11.2020.07.11.05.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 05:42:26 -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 v5 03/17] perf ftrace: add option -t/--tid to filter by thread id Date: Sat, 11 Jul 2020 20:40:21 +0800 Message-Id: <20200711124035.6513-4-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200711124035.6513-1-changbin.du@gmail.com> References: <20200711124035.6513-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