From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbdBTNTB (ORCPT ); Mon, 20 Feb 2017 08:19:01 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40146 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752821AbdBTNS5 (ORCPT ); Mon, 20 Feb 2017 08:18:57 -0500 Subject: Re: [RFC] perf/sdt: Directly record SDT event with 'perf record' To: Ingo Molnar , masami.hiramatsu.pt@hitachi.com 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> Cc: mingo@redhat.com, acme@kernel.org, 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, Ravi Bangoria From: Ravi Bangoria Date: Mon, 20 Feb 2017 16:31:50 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20170220084224.GA24404@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022011-0040-0000-0000-000002AAE453 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006650; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000204; SDB=6.00824496; UDB=6.00403607; IPR=6.00601952; BA=6.00005156; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014357; XFM=3.00000011; UTC=2017-02-20 11:02:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022011-0041-0000-0000-0000069E07A8 Message-Id: <58AACC9E.8070009@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-20_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702200110 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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. > >> 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. Thanks, Ravi