Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1977801ybh; Fri, 17 Jul 2020 06:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUunaDIY2gqbIhXyzhwWkQFb3prV1fMlnFiVYNfTKlwl3Cr9sz2mHwRlRqtHPm/9pAJZRg X-Received: by 2002:a17:906:57c5:: with SMTP id u5mr8222960ejr.311.1594992571748; Fri, 17 Jul 2020 06:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594992571; cv=none; d=google.com; s=arc-20160816; b=LJFkBgFTdbSecJNDTuGfkQNVEi1hgPop+QxThli/p/+PaxxK+AHPGkXmTz+c6u0ck+ sXOBy863dfeBPeeX9pRSBlJGOqnQQxBzJVCOR7NlwC9ETsR/qQzsaPg3KJtiPSy+TCcH xAegywLEfW7S3x5xdePIz/IXRs46Dgr/HYEaURTd23tcYgCF40EzrSv6pSYvm61mEvjP oi8+PNnxDam2HWDrl2gfqiDOP6X8RlrS9/eZNdkmthmXRhTGF0wbh6jvx507IQ4qf2pH mJclMBfSVMosh/PknEabtuFPU49YWwq3EpwtroTqFpp2B4rH/SCSdkX8HvkGc/g7QtDf 9ebg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zq4eLLHEPFYePLYsXs6ch0tfK/nwjUC8UEFOw6QoLa4=; b=zwtveroLwteQ237cmUeSF6qAvsW9ylvKJw0ZC7EW8mcw4lW8pRwl9FAdC3slCLfKQT AftREOWZjaaWPEZ668m3cO2tE3zYTEtBDRZ0GSWM55VHbOClhA9e6Qin5wEkMyBXLq75 g7DF4quvcgY9uh7fqu0N5PScEsQoEMc4Z7k+n780j81JIG5SUFd1jUTaJ4bxgDQuxanE 2i9ShkFZXcvAT2ZNx3Nio3ajPlycp4PA3BujgVzbQ+SaVGp70S7IYQK4qPwSnlGmP8uI s231nrArJHOnCwuPac4VSZTtEoi7wMok+K8APouHLa10E94sHSHeqSTiH/FbNfIS9dUq Titg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lnaq3z9k; 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 d3si5779800edn.145.2020.07.17.06.29.07; Fri, 17 Jul 2020 06:29:31 -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=Lnaq3z9k; 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 S1726512AbgGQN1B (ORCPT + 99 others); Fri, 17 Jul 2020 09:27:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbgGQN1B (ORCPT ); Fri, 17 Jul 2020 09:27:01 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19DDAC061755 for ; Fri, 17 Jul 2020 06:27:01 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id md7so6365511pjb.1 for ; Fri, 17 Jul 2020 06:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zq4eLLHEPFYePLYsXs6ch0tfK/nwjUC8UEFOw6QoLa4=; b=Lnaq3z9kEZHMV2ApMiDweXrRyPWYk31gywhdPzee8VL9Y1liBih4Qdlsx1mxPcWIo6 msRB1swgM/ShishzCGdhje5EFoPZq2aEwMyHoME5q/2aF/2LUVgaMyH1zxpV7anczIVe ffsLlpvh48FxHxgUaCQ0gWER9ya+fyVtXqq2vgbEp5H4fLz65bgzbSutlRqupte0bCN1 cwriX2q6wlUg8NzCRvy3SHgAkAVTbzaD+BRmT6Pr0cSpn0WFv6+2Y+VfXeK9Y5QCodQW 7sQLVVFXDeAZDj4i8sZa2B/IZZgu4FS1DVOKB7Y0MkKgV698rIJwOT0JrIzQwS8z1ZaT ThVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zq4eLLHEPFYePLYsXs6ch0tfK/nwjUC8UEFOw6QoLa4=; b=t81NLHbLjVa9nP5X6kdSto/YTKXIuHved+9P2WL+Q2ckjYQ/mxb5wChCGWqR9SpeLq P88VL4QGOByJbs4DfnLSGySsJcNdWWAZSQ31A/hG0mg4UvtmQyFK8w6cdrllWk876ikd ZyhblrrEWPglKTYtgivlYJkTuaaSXKp3Z+AGLXlfe/suLPJXtODPYOkAM1cTYXcxhO7J 9BFRNy81hnEoqq1FtXXC3tiYJIWiT1j1RcS8sq6hKtAAKUWJKlk/9hRXc3eB6XgMNXrE oCPt4NVvqT2O7VczYhTgyWjZDehLkLvBvd+u8iwnEQ8B9QArRX+B1zilaffLc5C2qZoI JI4A== X-Gm-Message-State: AOAM532PnHBG3eWGzgjm3rGBQEs0kepfkR4cNfILufyX41bc9PK1TysW zZRO8trgidrP7HW1SbRICZ4= X-Received: by 2002:a17:902:547:: with SMTP id 65mr7541416plf.191.1594992420594; Fri, 17 Jul 2020 06:27:00 -0700 (PDT) Received: from mail.google.com ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id d16sm7877616pfo.156.2020.07.17.06.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 06:26:59 -0700 (PDT) Date: Fri, 17 Jul 2020 21:26:50 +0800 From: Changbin Du To: Arnaldo Carvalho de Melo Cc: Changbin Du , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 03/17] perf ftrace: add option -t/--tid to filter by thread id Message-ID: <20200717132650.i32oovllal22b35i@mail.google.com> References: <20200711124035.6513-1-changbin.du@gmail.com> <20200711124035.6513-4-changbin.du@gmail.com> <20200716153630.GD374956@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716153630.GD374956@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 12:36:30PM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Jul 11, 2020 at 08:40:21PM +0800, Changbin Du escreveu: > > 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). > > + > > > Humm, I just tried: > > [root@five ~]# yes > /dev/null & > [1] 18265 > [root@five ~]# perf ftrace --tid 18265 > ^C[root@five ~]# > > After waiting for a while, nothing, what am I doing wrong? > I got it wrong. Currently ftrace only can filter by pid. If the pid is not the main thread it won't work. So this patch makes no sense. will drop this. > - Arnaldo > > > > -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 > > > > -- > > - Arnaldo -- Cheers, Changbin Du