Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1941887ybh; Fri, 17 Jul 2020 05:35:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynILsz/sH6sNa4EEJjnVmcXOubvA7cOtu9NoxQuHsq1XCHkRSptUQhye3Azn+3eRB28OFJ X-Received: by 2002:a17:906:1394:: with SMTP id f20mr8584429ejc.114.1594989339435; Fri, 17 Jul 2020 05:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594989339; cv=none; d=google.com; s=arc-20160816; b=NlIHJCL38FS7EHVZLMq4tnPpqlxCwQ5tMijuK8BDDj+Ty4kEUODLK102aVBO9OhXpL kS13QW+ZCjbd8DlOHLO0lDhL5sgz4/GpbTSLKRz6D/srKs8esNEII7gt7VfY4p+7M2oy 60fJDKC6AV7IdMN0BEFF4o/CdVaqgMKb28lKhBm7/lDL/UGDpcUz+mwzaIg/EmTuQTz5 EhlMMxE+RlmCIFxRfwCj8Vw52KIZubQPf+EaiTtN/EQ9FgVlBJGp8xZ29vhZeQ5hWsBC jHMn5cHRCVE2QexvyNQ0+mXcmc65EYWL2/4ZqMH/nLwNto5rMDyqGATQGJDOZOKxYRIS GWyA== 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=KdjMv9j6OcoxUiwY3g91bnsQlhf+SymfWgc7CPl7LYY=; b=Lt9UMmQYHcmh6RJMdql48657bdFEBMzSkKSM62RKYBHLDQEBOSTTWLxeiTxTJQW9aH t3B5nAEKLtHFM0nBW+AtBOZNHkXScV+8LmGoQYbhvB1nyauTgI3detOrPNpPDt+/FquT +vcdWIGxqdsK/ABUSeZUlK1C68SZt82/K/HHrx3r/jJLUTEG697pfHWXeKkg4y8hF+GQ XEdCNxsQCzaTbLCmU24EL2ARxzZwUessDKQiJh+ZfLTIO8qJTb4o4j3DZZsqd0qz7Wgk 9H1T7xGgEZYYK9OcrrjQrwyPxvUdyN+sNVVlne3Td/MD4NYztBvtPv5n4X9K1OFWd10n zSCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ajmTmmG9; 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 h8si643723ejj.516.2020.07.17.05.35.16; Fri, 17 Jul 2020 05:35:39 -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=@kernel.org header.s=default header.b=ajmTmmG9; 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 S1726238AbgGQMei (ORCPT + 99 others); Fri, 17 Jul 2020 08:34:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:38664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbgGQMei (ORCPT ); Fri, 17 Jul 2020 08:34:38 -0400 Received: from quaco.ghostprotocols.net (179.176.12.94.dynamic.adsl.gvt.net.br [179.176.12.94]) (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 B9457206BE; Fri, 17 Jul 2020 12:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594989278; bh=33tjZQH1C4xO/jHnWjoKMYBh6IKIV2OgfAuYgQAMOA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ajmTmmG928Wru9EYzGoaDRLYHvtvENN3tmjKPD5ncu1wGTRMze7CtoXRHIyKjiiMG tJOK+Rrl/00fx5OwmoCQy8a21jDRDlxmD9JP0UrDNYrnqx2EWbAvXc8QJRiaeaFg8E pibEGdnRzF+ZEFIXFZAvn+j6mZl6V6dI/QEeLEco= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 364B740482; Fri, 17 Jul 2020 09:34:35 -0300 (-03) Date: Fri, 17 Jul 2020 09:34:35 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: acme@redhat.com, jolsa@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] libsubcmd: Fix OPT_CALLBACK_SET() Message-ID: <20200717123435.GC77866@kernel.org> References: <20200619133412.50705-1-ravi.bangoria@linux.ibm.com> <3b15af42-bfb2-07dd-8bb2-df9cd6b32a34@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b15af42-bfb2-07dd-8bb2-df9cd6b32a34@linux.ibm.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jul 17, 2020 at 09:10:45AM +0530, Ravi Bangoria escreveu: > Hi Arnaldo, > > Can you please consider this trivial fix. Trivial but important, sorry for taking so long, applied to perf/urgent, aimed at v5.8, - Arnaldo > Ravi > > On 6/19/20 7:04 PM, Ravi Bangoria wrote: > > Any option macro with _SET suffix should set opt->set variable which > > is not happening for OPT_CALLBACK_SET(). This is causing issues with > > perf record --switch-output-event. Fix that. > > > > Before: > > # ./perf record --overwrite -e sched:*switch,syscalls:sys_enter_mmap \ > > --switch-output-event syscalls:sys_enter_mmap > > ^C[ perf record: Woken up 1 times to write data ] > > [ perf record: Captured and wrote 0.297 MB perf.data (657 samples) ] > > > > After: > > > > $ ./perf record --overwrite -e sched:*switch,syscalls:sys_enter_mmap \ > > --switch-output-event syscalls:sys_enter_mmap > > [ perf record: dump data: Woken up 1 times ] > > [ perf record: Dump perf.data.2020061918144542 ] > > [ perf record: dump data: Woken up 1 times ] > > [ perf record: Dump perf.data.2020061918144608 ] > > [ perf record: dump data: Woken up 1 times ] > > [ perf record: Dump perf.data.2020061918144660 ] > > ^C[ perf record: dump data: Woken up 1 times ] > > [ perf record: Dump perf.data.2020061918144784 ] > > [ perf record: Woken up 0 times to write data ] > > [ perf record: Dump perf.data.2020061918144803 ] > > [ perf record: Captured and wrote 0.419 MB perf.data. ] > > > > Fixes: 636eb4d001b1 ("libsubcmd: Introduce OPT_CALLBACK_SET()") > > Signed-off-by: Ravi Bangoria > > --- > > tools/lib/subcmd/parse-options.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/tools/lib/subcmd/parse-options.c b/tools/lib/subcmd/parse-options.c > > index dbb9efbf718a..39ebf6192016 100644 > > --- a/tools/lib/subcmd/parse-options.c > > +++ b/tools/lib/subcmd/parse-options.c > > @@ -237,6 +237,9 @@ static int get_value(struct parse_opt_ctx_t *p, > > return err; > > case OPTION_CALLBACK: > > + if (opt->set) > > + *(bool *)opt->set = true; > > + > > if (unset) > > return (*opt->callback)(opt, NULL, 1) ? (-1) : 0; > > if (opt->flags & PARSE_OPT_NOARG) > > -- - Arnaldo