From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdBWMsw (ORCPT ); Thu, 23 Feb 2017 07:48:52 -0500 Received: from mail.kernel.org ([198.145.29.136]:57290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbdBWMsv (ORCPT ); Thu, 23 Feb 2017 07:48:51 -0500 Date: Thu, 23 Feb 2017 09:48:39 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: Ingo Molnar , masami.hiramatsu.pt@hitachi.com, mingo@redhat.com, brendan.d.gregg@gmail.com, peterz@infradead.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jolsa@kernel.org, ak@linux.intel.com, treeze.taeung@gmail.com, mathieu.poirier@linaro.org, hekuang@huawei.com, sukadev@linux.vnet.ibm.com, ananth@in.ibm.com, naveen.n.rao@linux.vnet.ibm.com, colin.ing@canonical.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, hemant@linux.vnet.ibm.com Subject: Re: [RFC] perf/sdt: Directly record SDT event with 'perf record' Message-ID: <20170223124839.GA3595@kernel.org> References: <20170203151826.GA2712@redhat.com> <20170216101617.4791-1-ravi.bangoria@linux.vnet.ibm.com> <20170220070851.GA8974@gmail.com> <58AAA712.5040408@linux.vnet.ibm.com> <20170220084224.GA24404@gmail.com> <58AACC9E.8070009@linux.vnet.ibm.com> <20170220141117.GJ4109@kernel.org> <58AE99B2.7090202@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58AE99B2.7090202@linux.vnet.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 23, 2017 at 01:43:38PM +0530, Ravi Bangoria escreveu: > Thanks Arnaldo, > > I'm working on this but it's taking bit longer time. Will post out a patch within > few days. Take your time and thanks for giving consideration to my observations, Regards, - Arnaldo > Ravi > > On Monday 20 February 2017 07:41 PM, Arnaldo Carvalho de Melo wrote: > > Em Mon, Feb 20, 2017 at 04:31:50PM +0530, Ravi Bangoria escreveu: > >> Thanks Ingo, > >> > >> On Monday 20 February 2017 02:12 PM, Ingo Molnar wrote: > >>> * Ravi Bangoria wrote: > >>> > >>>> What should be the behavior of the tool? Should it record only one > >>>> 'sdt_libpthread:mutex_entry' which exists in uprobe_events? Or it > >>>> should record all the SDT events from libpthread? We can choose either > >>>> of two but both the cases are ambiguous. > >>> They are not ambiguous really if coded right: just pick one of the outcomes and > >>> maybe print a warning to inform the user that something weird is going on because > >>> not all markers are enabled? > >>> > >>> As a user I'd expect 'perf record' to enable all markers and print a warning that > >>> the markers were in a partial state. This would result in consistent behaviour. > >> Yes, makes sense. > >> > >>> Does it make sense to only enable some of the markers that alias on the same name? > >>> If not then maybe disallow that in perf probe - or change perf probe to do the > >>> same thing as perf record. > >> 'perf probe' is doing that correctly. It fetches all events with given name from > >> probe-cache and creates entries for them in uprobe_events. > >> > >> The problem is the 2-step process of adding probes and then recording, > >> allowing users to select individual markers to record on. > > So, the more streamlined one works for most people, i.e. just use perf > > record, no need to perf probe anything. But, for people who "know what > > they are doing", perf probe can be used first to control exactly which > > SDT probes one wants in place, and then those will be used. > > > > We need to make sure that when processing the file there is information > > that says which probes were in place and enabled in the record session, > > tho. Is that possible? > > > >>> I.e. this is IMHO an artificial problem that users should not be exposed to and > >>> which can be solved by tooling. > >>> > >>> In particular if it's possible to enable only a part of the markers then perf > >>> record not continuing would be a failure mode: if for example a previous perf > >>> record session segfaulted (or ran out of RAM or was killed in the wrong moment or > >>> whatever) then it would not be possible to (easily) clean up the mess. > >> Agreed. We need to make this more robust. > > Right, disambiguating a 'probes left by a session that did auto-probing' > > from a 'hey, those probes are there intentionally, just use those' is > > important. > > > >>>> Not allowing 'perf probe' for SDT event will solve all such issues. > >>>> Also it will make user interface simple and consistent. Other current > >>>> tooling (systemtap, for instance) also do not allow probing individual > >>>> markers when there are multiple markers with the same name. > >>> In any case if others agree with your change in UI flow too then it's fine by me, > >>> but please make it robust, i.e. if perf record sees partially enabled probes it > >>> should still continue. > >> @Masami, can you please provide your thoughts as well. > > Yeah, if technically possible to allow both variants, we should leave > > it up to users to decide what is best? > > > > I.e. most people will do auto-probing, not using 'perf probe' at all, > > documentation should state the pitfalls in doing so. > > > > So, after writing the above, perhaps we should warn the user that > > pre-existing probes are being used, as this will be the odd case? > > > > The normal flow will be just using perf record with SDT probes, that > > will auto-probe them and remove on exit, or better drop a reference to > > them, as simultaneous use also needs to be covered? > > > > - Arnaldo > >