Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2712361pxa; Fri, 7 Aug 2020 19:43:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlHD4QYxTZUdt/R0tE7NnRnMPX4asxyfHczPJx9vyAhQxZamxxRq8UT3SPkabvLhnFn5JY X-Received: by 2002:a17:906:8608:: with SMTP id o8mr12842440ejx.156.1596854638259; Fri, 07 Aug 2020 19:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596854638; cv=none; d=google.com; s=arc-20160816; b=ebjo1Wg8ZUzBJWF4UuUTd6fzP/9M1HNHifKNGEGFYweL1TZLcumBt2/i9il0N2iQ7z jF++9/Ef3Zqx1zCFEqTPFG1YOVeyAcaz60szaiUZpR6mhwHwtrOBc27bvKiYtvER2Z/Z Qjv/3HGC23FfX/MdRZNcnWAfIAd2tvsxT4ot6dwVV2RhsBFxK+3z5H1lsWj6apcCFnTx d7jjfzitXj6QQR9HoA9Zrtxapi0i+XR1/gE7YGmbsMzBttMOMPPEZb53ZTr46yrrqi9l 7vzqWQ47ULfSXG0P23zeKK5fPC+PY9/8ubhotia0F9m1lkkXz/AgfnUfo7bZLqyqjt7i L7Sg== 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=IWSxyHgRGMtaTnOrzJW2QC3+VdqmDel3IxSs33RL4c4=; b=m58ex0e3m1S3h33jQhFz4DViSLu/lrzlY/dmNC3cpnHZjoV+tUw4zlTf17jz2EOJJJ xB5Y2LKtQyNuEnviWtsCOhJGRgAKD+kT7qCgZcsS6Px2BOhgGWBQhvYp1IoBptmEAF9c +FSkGj8VYV3kXLTsXtp73Ay/N7rANKAxXZXvZEIsPIRdQORvGQ0zwbman7TCixsTiBuO zD6Dm+golo593yzaLAMC3iocElGXq3vNA003OmC/RZRo7Z2y/QOtcUTLtqCr8DqIEDgA h1KLMMoYbn0Td/gKYWEe71TpQaw1xnYA652eFKW6Oku6xim3sDEzHk6KQfsbzO4TvnhD nsLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UoX1IhZN; 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 b16si6249280edw.147.2020.08.07.19.43.35; Fri, 07 Aug 2020 19:43:58 -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=UoX1IhZN; 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 S1726824AbgHHCkE (ORCPT + 99 others); Fri, 7 Aug 2020 22:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgHHCkD (ORCPT ); Fri, 7 Aug 2020 22:40:03 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C94BC061756 for ; Fri, 7 Aug 2020 19:40:03 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id s23so2773132qtq.12 for ; Fri, 07 Aug 2020 19:40:03 -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=IWSxyHgRGMtaTnOrzJW2QC3+VdqmDel3IxSs33RL4c4=; b=UoX1IhZNYZ32XrE9giZbmYawQsQuxREOq3ZF2kYecSswoa55sCwryQvdnjsZntSe46 bDE+SxumE4b7JXS+jT90dlnzmfD+FyrvBzJFqNCCxM1cpOMJiDGn8xfPluJekbPvxNo+ 6ED0qjfBBhAQ5+jsLqpLRK9ju+vPC6ZT0E5VMxqYXYRlejRPPz6UzI337jG3xi2JwZTi HkW8Y9omgdIm52BTGcJHavhVse09jmWaClLW+EPJEbMvxQAE1+0v2wfyaqQzNjiCTByL 6F9bssH+wCjNzP8klFfkY6FgrU6mmTnC4PuV4efACvRtQuo4Sq7uQb+VBdOefbt9veUW HR1g== 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=IWSxyHgRGMtaTnOrzJW2QC3+VdqmDel3IxSs33RL4c4=; b=LF9lmKZlRTGPVarGv6BLp7iSEPBH2aO2DvJY47GPkI18GcudiCTEb8dYvyibo7avHB swWkGjJtgDz5pzyvN12lTaGGWDFiFOrpfsblFeBPN+VUrAZDWDx3taI7lFaSG8zDvJeS qd+0V93srTr0oXKmdhZR+hICz+zEnfRizbmsX3IWABMgTVrJzY+LLmB6lSjROFr7rnBW eaHyeuCXEmTH1X25r0pFrGL1LED4sdo4n8QoT2JJFEwz6IZsvJPxoikQt7RXLs20TfZ1 YL7b+k8kkP5zVnKxf6jg+/t4K9hIMPe/0B5OSEaDXHyMn6PtS0lzISkwVuH0fIW6loi9 YQCw== X-Gm-Message-State: AOAM530Z1SY2WGG44Y+WLAahBhc68i8DEtHKR5kD3wCgZjB5vBjTEzjL Gg3W8nz+94PYDzYxHNKXvoQ= X-Received: by 2002:ac8:429d:: with SMTP id o29mr17677840qtl.230.1596854402776; Fri, 07 Aug 2020 19:40:02 -0700 (PDT) Received: from vultr.guest ([66.42.85.36]) by smtp.gmail.com with ESMTPSA id n33sm7818702qtd.43.2020.08.07.19.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 19:40:02 -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 v8 16/18] perf ftrace: add option --tid to filter by thread id Date: Sat, 8 Aug 2020 10:31:39 +0800 Message-Id: <20200808023141.14227-17-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200808023141.14227-1-changbin.du@gmail.com> References: <20200808023141.14227-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 29c684b3b3fd..78358af9a1c4 100644 --- a/tools/perf/Documentation/perf-ftrace.txt +++ b/tools/perf/Documentation/perf-ftrace.txt @@ -39,6 +39,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 5f9a9ebea0a2..13abb737fd12 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -812,6 +812,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