Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2790828ybg; Sat, 6 Jun 2020 01:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8tGPmeDUkSoER8aizl7cv3GG/6/B/47taOF758+Ya7d8axRGct9HCAhYERoAKAyoA/KfK X-Received: by 2002:aa7:c6d1:: with SMTP id b17mr13721694eds.39.1591432238391; Sat, 06 Jun 2020 01:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591432238; cv=none; d=google.com; s=arc-20160816; b=yP1q8Oi0iyTMK/kQGo5joexM0JoPXZXNYY8ZCB6K0Zr11Q40DW8+/QT71LgSHYjQwT z+YAaJsDwwkhly0XA77iKW/sF1Amh1RXNLMVBWo9DClJMrteHu3YFeFIt1zcKcns3Gup fSdR8M4IO0zlxi/BUQPuyvLbyfAkQGypUD5UVKIk8hqHX/7y4DA4SC8alAqr8J8prw9v UY6fBYc/zSEfiC8dXE3/shB5UtM7mez0NrgrrQ8DSBRP5gFipzuVf4TTTlg5agsU9ZzO j+1a0wuh2xKy8uFtOSvBVXL7oWxWZ7XSj8wlmot7Fi134SP6aIlATiE7ONzC4+CJ4tMN ps8w== 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=cI+J3XaYv4s5eMcqs0Xe5DiyhG/i5iBDcjDr1HvW0xY=; b=OPrpukSQi3paeulJiX+SzgPTUcRTZjW6PL5kfxnnlKK1kUzWrilUIXBluWH0IJL8rq suZfvPA8iOhclGZN4XxnlIngUsxiEMTZvB4u8kRqsQur7KmdMft8IJgFnT4eF234xmVR HIYv6BzAD1A9h5aWYPjqVl7woAadfBBebbRYE4ifIwu0wJk7w9AL9yvhuYNuDj3qoOWf +hZpoWsT7Dy4tWOp6vy3FAa+bfZZzssg+eik7eIUTZ8dawea0Bqpnf0EqDhpUCCfIO0C IbT7IjznuuTD1nCKysLMOmpRXi6JpC5NA5RN9crL+SJavPdOg+J8ZGQeuG0AP4Xa0Ck5 Poug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AEQP4mJx; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si5215272eju.597.2020.06.06.01.30.02; Sat, 06 Jun 2020 01:30:38 -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=@redhat.com header.s=mimecast20190719 header.b=AEQP4mJx; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbgFFI2F (ORCPT + 99 others); Sat, 6 Jun 2020 04:28:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:52374 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgFFI2D (ORCPT ); Sat, 6 Jun 2020 04:28:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591432081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cI+J3XaYv4s5eMcqs0Xe5DiyhG/i5iBDcjDr1HvW0xY=; b=AEQP4mJxj9KjcpurUukjIbFBh3bkqd/5PCJtGCSs6Zkz1LZf2bl2Aw3kwzYcQHz90iUqdA RGXsY1QfmkPPdSTuFa5olWXMmJYLtdI8AckNMyAWRokkKjlvhA+SKrM1vcgEuXFwn/SOrj KQepouxfrB+z3WoJrD13PnULzfbb8u8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-M5wIGaAROM6cAWbn1D6Ung-1; Sat, 06 Jun 2020 04:27:58 -0400 X-MC-Unique: M5wIGaAROM6cAWbn1D6Ung-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9F6764AD0; Sat, 6 Jun 2020 08:27:56 +0000 (UTC) Received: from krava (unknown [10.40.192.28]) by smtp.corp.redhat.com (Postfix) with SMTP id 84A31610AF; Sat, 6 Jun 2020 08:27:54 +0000 (UTC) Date: Sat, 6 Jun 2020 10:27:53 +0200 From: Jiri Olsa To: Alexey Budankov Cc: Adrian Hunter , Andi Kleen , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel Subject: Re: [PATCH v5 13/13] perf record: introduce --ctl-fd[-ack] options Message-ID: <20200606082753.GA1449048@krava> References: <923c40c7-7c0b-9fad-314d-69e7acbee201@intel.com> <937c8cc1-b4c2-8531-3fa4-d0ad9df6a65f@linux.intel.com> <20200601233732.GA691017@tassilo.jf.intel.com> <1bc7c72b-9d78-5184-a27c-8025beadaaf0@linux.intel.com> <935187e8-6fc8-5f47-b88d-6e8c92a27286@intel.com> <20200605105108.GB1404794@krava> <3ac6d0b8-5fae-348f-8556-4bf7a66285f6@linux.intel.com> <20200605135743.GD1404794@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 05, 2020 at 05:47:28PM +0300, Alexey Budankov wrote: > > On 05.06.2020 16:57, Jiri Olsa wrote: > > On Fri, Jun 05, 2020 at 04:15:52PM +0300, Alexey Budankov wrote: > >> > >> On 05.06.2020 13:51, Jiri Olsa wrote: > >>> On Tue, Jun 02, 2020 at 04:43:58PM +0300, Adrian Hunter wrote: > >>>> On 2/06/20 12:12 pm, Alexey Budankov wrote: > >>>>> > >>>>> On 02.06.2020 11:32, Alexey Budankov wrote: > >>>>>> > >>>>>> On 02.06.2020 2:37, Andi Kleen wrote: > >>>>>>>>> or a pathname, or including also the event default of "disabled". > >>>>>>>> > >>>>>>>> For my cases conversion of pathnames into open fds belongs to external > >>>>>>>> controlling process e.g. like in the examples provided in the patch set. > >>>>>>>> Not sure about "event default of 'disabled'" > >>>>>>> > >>>>>>> It would be nicer for manual use cases if perf supported the path names > >>>>>>> directly like in Adrian's example, not needing a complex wrapper script. > >>>>>> > >>>>>> fds interface is required for VTune integration since VTune wants control > >>>>>> over files creation aside of Perf tool process. The script demonstrates > >>>>>> just one possible use case. > >>>>>> > >>>>>> Control files could easily be implemented on top of fds making open operations > >>>>>> for paths and then initializing fds. Interface below is vague and with explicit > >>>>>> options like below it could be more explicit: > >>>>>> --ctl-file /tmp/my-perf.fifo --ctl-file-ack /tmp/my-perf-ack.fifo > >>>>> > >>>>> Or even clearer: > >>>>> > >>>>> --ctl-fifo /tmp/my-perf --ctl-fifo-ack /tmp/my-perf-ack > >>>> > >>>> If people are OK with having so many options, then that is fine by me. > >>> > >>> the single option Adrian suggested seems better to me: > >>> > >>> --control > >>> --control 11 > >>> --control 11,15 > >> > >> What if a user specifies fifos named like this above, not fds? > >> > >>> --control 11,15,disabled > >>> --control 11,,disabled > >>> --control /tmp/my-perf.fifo > >>> --control /tmp/my-perf.fifo,/tmp/my-perf-ack.fifo > >> > >> What if a user wants not fifos but other type of comm channels? > >> > >>> --control /tmp/my-perf.fifo,/tmp/my-perf-ack.fifo,disabled > >>> --control /tmp/my-perf.fifo,,disabled > >>> > >>> we already support this kind of options arguments, like for --call-graph > >>> > >>> jirka > >>> > >> > >> IMHO, > >> this interface, of course, looks more compact (in amount of options) however > >> the other side it is less user friendly. One simple option for one simple > >> purpose is more convenient as for users as for developers. Also complex > >> option syntax tends to have limitations and there are probably more > >> non-obvious ones. > >> > >> Please speak up. I might have missed something meaningful. > > > > how about specify the type like: > > > > --control fd:1,2,... > > What do these ... mean? other possible options > > > --control fifo:/tmp/fifo1,/tmp/fifo2 > > --control xxx:.... > > > > this way we can extend the functionality in the future > > and stay backward compatible, while keeping single option > > Well, it clarifies more. However it still implicitly assumes > and requires proper ordering e.g. 1 is ctl-fd and 2 is ack-fd > and if there are some more positions there will be gaps like > --control fd:10,,something,,something ... right, that's what we do for other options > > Why is one single option with complex syntax more preferable > than several simple options? Also it would still consume almost > equal amount of command line space in shell. I think it's better for future.. say if there's going to be support for passing file paths you'll need to add something like --ctl-fifo and --ctl-fifo-ack no? with single option we'd just add something like: --control fifo:/tmp/my-perf.fifo,/tmp/my-perf-ack.fifo jirka