Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2242114ybh; Fri, 17 Jul 2020 12:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUYhqZcHqOoeBSBJI2bxlML/PyLtLddSYoA5AyyUQqCbImeIwQl8iwM+daDbmlGRKoK2BS X-Received: by 2002:a05:6402:1c0f:: with SMTP id ck15mr10413916edb.155.1595015237668; Fri, 17 Jul 2020 12:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595015237; cv=none; d=google.com; s=arc-20160816; b=vbKAqNdrWf6qWZatVeTEWFRiHn7OY0LpepkgbB4KkOWlP8lcr/vAfdL2ChM0vxoqmX 56LsnXA0Yl51GwRnGVceTR8o/VL6BLJD6+126238W9zD/1ie+e04YfkLZxKLUclCnKda 5KN+Bj3Msp0Q20JkAaYB3RrNwHkALM79t/p+t4L6CvZBNoJZu4q9/QX1caPlCd7lMh78 MhKB/NdWvd/rfxrjDfjaRLk+NmH/YI3PtKg2wYb95Zj/crRbpe2zZ9T4j+GnjWfV82s1 aPSjzyJH+wr0gnJ1+CyPSyWEh7WQg6RRi33knuJkAROHr0tQjKbwe/XvxzpfHAjcZ3zV XXIQ== 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:subject:cc:to:from:date; bh=SD187apcga9pY3dynY29ogITpHp5xH0x8Z+11WhNNAU=; b=dICe9SKHeS3jGMIUv8DRqfEQZrnGQ4GMnY34Kaia37CDeXI+hCOO4bLZEEyX7NTGLS ZXUIeuRjzskVfL2DcXY4WiY+R1n22HcBx+AwggGj7tvKbPZbt+8G18PTm6dyE0HO2j0/ 3bTtYm9sFMwanY3BsWyepYVsXtoJ/76rVN+7Zp9/9BA/Ea/vIPxmgS31j8vsbSmSGxQk ZV5ljVmuuifwUvXQcz+IF6uILupUonXbJmD6aT4mbq1saCqAlcO7Pyl8XeX1feIAAOcW SrDrK9Caiv3yTkOvuM6dCdJ+mgKD+7nyXPIcQewDJeSj7D9kLzlJHjBPEG24adeid45V nplw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si5670557edp.72.2020.07.17.12.46.55; Fri, 17 Jul 2020 12:47:17 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728706AbgGQToZ (ORCPT + 99 others); Fri, 17 Jul 2020 15:44:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:50330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728183AbgGQToZ (ORCPT ); Fri, 17 Jul 2020 15:44:25 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70A7F20684; Fri, 17 Jul 2020 19:44:23 +0000 (UTC) Date: Fri, 17 Jul 2020 15:44:21 -0400 From: Steven Rostedt To: Arnaldo Carvalho de Melo Cc: Changbin Du , Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 03/17] perf ftrace: add option -t/--tid to filter by thread id Message-ID: <20200717154421.4e3aee99@oasis.local.home> In-Reply-To: <20200717193455.GD77866@kernel.org> 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> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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