Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1381072ybt; Sat, 27 Jun 2020 06:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd5Ng/NbKOwzCUz9xgFhu76pirl116t6pMvGtJpHoS2EsLx3ib+lwWP5FEkUeKplxxnYcT X-Received: by 2002:a05:6402:1a42:: with SMTP id bf2mr2544647edb.292.1593265239434; Sat, 27 Jun 2020 06:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593265239; cv=none; d=google.com; s=arc-20160816; b=xou348JrYJO9hntBi88O8gForoC5M9PpdZ4LruIU+WHnTxvdnfv0/pEObsdNOepFoC 0QCZSu9OZUEXv46AfLHrvKFNh/G3KFS3BVfJNaz/LMAzvCwbKvClgFzxoQZdYX8TSZWl 98tA4fzI1vxnYfCPA6fcvtm6qbTsG7G9MGKbw32l3YlaX6ouf9A0Mcr6KQJimIEH/ou4 RpPmz4mOl9tLV99DOYGelC1gKQaYJ0l42jne4S6naLHF4wHv1G6U98ch1cMzPTfWjexZ osPwghslj6/J/DaBOTHVwG0k6O0DFC2bym/HG4kNIh2j0dqOM2hPaxTvBu+JRfF8q0Fj Q39g== 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=t+mGbz+jBKo9dHNxI3C3wVTjmOKtqRlnc8Twc3V90cY=; b=N8iyGzQTJYq/YWJ/jaoxX5eo50aFSlqDPyjUSxulIMJynB4BNdAHL9sLhJukx1zFd8 hLu4QDSSfGqAMZLMmTjcJOSPEPf2MZ6LlK41M7WUqIXtMmLeBiCfcwfV+Gb4euqEbDkx OwoDumtyiHyv+y930Q9hqDbwDPF1yH450FxyvnG7N08xzHaFtpzFv0WyL5pG6TktGBUC 2a4c2HgRDpOo5nfKhhjCBfgO79XcQpBiOg0T3wP1ckWaW9ipSFA78dsn2XsY9oQQEMW/ C/fgsu+IZNzHjQpfsNgc35cflmyfUZLqUC/cIf718AM/+0QWqCRzsbdsKwizCaZVPg0a fUUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=guoXZ4AP; 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 c22si21282962edx.584.2020.06.27.06.40.16; Sat, 27 Jun 2020 06:40:39 -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=guoXZ4AP; 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 S1726706AbgF0Nhm (ORCPT + 99 others); Sat, 27 Jun 2020 09:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbgF0Nhm (ORCPT ); Sat, 27 Jun 2020 09:37:42 -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 338E0C061794 for ; Sat, 27 Jun 2020 06:37:42 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id e8so6269857pgc.5 for ; Sat, 27 Jun 2020 06:37:42 -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=t+mGbz+jBKo9dHNxI3C3wVTjmOKtqRlnc8Twc3V90cY=; b=guoXZ4APiOya6AozC6bNh5rbpfaVz3kRq2xsWVZAqnqQGRR1YQ8dzA5st8aIlP2t6T 4DfyeuOgD5Q2lDXUbfmNT9/fz6dMMPZxWKj7JHVg+QNpfsZUqlpANrPDrEdVbrCT/XFw 4mAtd7tXrSe00la0wwl2AiAXdjZYaM+xTR6C+JTSzUZp3w5fRepLzP9PJBDZo3Cqx7wj LD6HKuWYctHJ0YinTtG5Ih15plg6xQAEBycuVZ6FKY2NWeakf7hHLw1PckjBVoxs6WUx IlOYz89swHIcFh3JlHGEcE5iGdSR6b9LDKu+WkPGUbgAgivrg0MhJVp8lK+7WpUAY5W9 ZujQ== 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=t+mGbz+jBKo9dHNxI3C3wVTjmOKtqRlnc8Twc3V90cY=; b=K3VUrc2YlXeeDynSe7Sj9fxfjpk0Lx4SDgwbE/KIkHsfgzqPFs2raV7PlYzcaZeoQ5 xs7We8WqEO87vzhU+KAzEqZ7Ll+ReDyRkgNx9TepseZnYREXLtLmQdg1uu5TEvXWuNdh yOFpdDnAkFVZozkdsxoCwcgJYhI8UOfz4HJBwS0QCr8LCuqJb/lmub6u4eHPajDJl+9j u1ES1FnDtu7U61JaUal1p4Nwv8zBTglELp7oYguTW0loqq7ESOjCQzWmDOUnizhTQiHR vpWJJ6yn34GEaCgnqYKo7Kc/Ke93mpmf875mzzDBtnpsj4Pq2MoNsiE7S/LW1K4J0xf6 s80w== X-Gm-Message-State: AOAM532yuU5T8eC1dLc/dcx5EmtuY7ADqLgJT6s0FWqYDBjuRjlID5yD Zn1tv3/LV7jHk1MRvVWytvw= X-Received: by 2002:a63:fd03:: with SMTP id d3mr3346641pgh.76.1593265061737; Sat, 27 Jun 2020 06:37:41 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id x8sm15060086pje.31.2020.06.27.06.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2020 06:37:41 -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 v2 03/15] perf ftrace: add option -t/--tid to filter by thread id Date: Sat, 27 Jun 2020 21:36:42 +0800 Message-Id: <20200627133654.64863-4-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200627133654.64863-1-changbin.du@gmail.com> References: <20200627133654.64863-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 e793118e83a9..b427ab3977ad 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