Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp736083ybh; Tue, 21 Jul 2020 06:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPo7PIGeJs021PlMQtwj4CK45DgTNvhwrWt2uT5Ay00RGaB/iIw7WTrty2OupQSdzrZ1zW X-Received: by 2002:a05:6402:b4b:: with SMTP id bx11mr25185431edb.286.1595339213043; Tue, 21 Jul 2020 06:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595339213; cv=none; d=google.com; s=arc-20160816; b=0wS2Q8JQP3QZ0lBU5s4DYUy9GhkOrSuJQhwB8USEwp7XXfLMdCAkYNr0nrWf0JrHb2 B1yOUcRclYp5xw708j12EWS8iuqtHxBfOjmSEEkaAi7YCP75bfbPmMeKUwOt3Su5mA0h 1R86TNUf2WnYIBbf9WgJXiYQtSIBiuVtzxYRsUg7nlCXtEgSY9P3PqSHRg0IW1jfnRq2 MvzBx9gJkAwcm/dfz8haNE4JeTW+Qx3Mcy7bAHf2fggcBcc5ezyRhVa5MUaR5k6eP6AJ xfr+Q0HmSwHN3h9fj+MES4xHGG8IM6lt8cYvY6+o1gIvuvewdzgqlqoaXXTsNSvdZoJm SSeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Pn4rxXnLcED95PLyId2IwjI1AP4bvRug3vOgdxoJ9U0=; b=FKMJzzIhvUFe2IZEd1P3+O9w8DFwfeR7mwmrGa8CfQGkw/J5yUmvN5gCorbkQlwiz8 LdWw2pTXpvqVXlD7QksnID3sJZ/icGtasOdRqWmEKEDU5krrtNw1mfx5IbBNPrKObQQL EoGLe+TvU11rXFEIhsOx5nIsLXYLeom0q6gxSyYlPhXtY1mggnz+p28ZSZJ+WFhLmxS4 cg7/h1M2xPLJBsHdbUMrPjOx7ofDDoNndLdT1kjmsi78WQNMQU1uABBbnZ/oCxZGfKRr OC9D3GmdpmoJuqi16ab1xcyvp5YAYoxtheBwUxdS9+qCnfPxV3dyVuOUZ8ita3LDOtHo Y5aA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si12957357ejj.523.2020.07.21.06.46.29; Tue, 21 Jul 2020 06:46:53 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727978AbgGUNo6 (ORCPT + 99 others); Tue, 21 Jul 2020 09:44:58 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38391 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgGUNo5 (ORCPT ); Tue, 21 Jul 2020 09:44:57 -0400 Received: by mail-wr1-f66.google.com with SMTP id a14so6413447wra.5 for ; Tue, 21 Jul 2020 06:44:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pn4rxXnLcED95PLyId2IwjI1AP4bvRug3vOgdxoJ9U0=; b=ZpuI0VPhPxoW0pAkJ3nkHHSCDP4y1Ho9895Lf50XrZegXI2XGrrCZXDskEet0aLJMc Zp0OR2YXFQASC86FTMpIJbpVw9JmJeXPyI4cLSbKzLOOPRoQTkEXe2bxHZX5tngwLkbX heh/gqbop85i1CGRcHE1hw3V4mkUJ6RNlXlcU/nrPQYbiEWxWtvB/kOooQyWTtNdU4C3 56YjSjhPhIhEe0eBrZT1alGxfZmGoi2uwO0jeA7HP0JGHkyvktroaNLjkqld5shY0jwm /xCRkphXTvPbfcnDOP31gGPQauCzsoez30AAsn1KM7iqr9IYnWu300VmXIDuIpchlO7A CGMg== X-Gm-Message-State: AOAM530ozCwLsJGqSVIVRyQliCmxtLyogF8qTyY2/0yZIlgOn28u04Ny +KLViYRLNLQN1UA5YiFeQvYymjN3XGt7tipDDKs= X-Received: by 2002:adf:dfd0:: with SMTP id q16mr973909wrn.60.1595339095514; Tue, 21 Jul 2020 06:44:55 -0700 (PDT) MIME-Version: 1.0 References: <20200711124035.6513-1-changbin.du@gmail.com> <20200711124035.6513-4-changbin.du@gmail.com> <20200716153630.GD374956@kernel.org> <20200717132650.i32oovllal22b35i@mail.google.com> <20200717130124.54e85349@oasis.local.home> <20200717174053.GE712240@kernel.org> <20200717135351.5fb1ce95@oasis.local.home> <20200717193455.GD77866@kernel.org> <20200717154421.4e3aee99@oasis.local.home> In-Reply-To: <20200717154421.4e3aee99@oasis.local.home> From: Namhyung Kim Date: Tue, 21 Jul 2020 22:44:44 +0900 Message-ID: Subject: Re: [PATCH v5 03/17] perf ftrace: add option -t/--tid to filter by thread id To: Steven Rostedt Cc: Arnaldo Carvalho de Melo , Changbin Du , Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On Sat, Jul 18, 2020 at 4:44 AM Steven Rostedt wrote: > > On Fri, 17 Jul 2020 16:34:55 -0300 > Arnaldo Carvalho de Melo wrote: > > Thinking a bit more, I have to ask. Does perf use the kernel when > getting all the children of an existing task, or is that done only in > userspace? > > That is, is there a perf syscall that says "start tracing this task and > all its existing children"? > > Or is it done by perf user space looking at the /proc filesystem (like > ps does). Yep, perf does look up the /proc to get a list of threads in a process. Thanks Namhyung > > I'm asking because if perf has a syscall to do that, then I probably > should add a way to do that with ftrace as well. But that's really > trivial, because all it would take is grabbing the task_list lock and > iterating over all the children. Getting new children was the > non-trivial part, which was what I focused on (with the fork options). > > If perf does it with proc files, then we don't need to change anything > as that could still be used with ftrace. > > > Changbin, you can take from here :-) > > > > And to reiterate, for me the value of 'perf ftrace' is to allow people > > used to perf to be able to switch to ftrace quickly, just changing: > > > > perf record/top/stat/trace/report/script/etc --pid 1234 > > > > by: > > > > perf ftrace --pid 1234 > > > > And have the tracefs ftrace knobs set up to have what is expected in > > terms of targets to trace as the other perf tools. > > > > And not just --pid and --tid, but --cgroup, --cpu, etc. > > > > i.e., 'perf ftrace' being _a_ front-end aplication to ftrace. > > > > :-) > > > I have no problem with this, and I'm quite excited about it. I would > like it to use libtracefs, as it looks to be exactly what we are > working on. And this is now a high priority to get out, and I don't > expect another year (or two) in doing so ;-) > > -- Steve