Received: by 10.192.165.156 with SMTP id m28csp668043imm; Fri, 13 Apr 2018 05:57:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49PIAwD6k+8WgaSFeMJb5jvcmC7TQDRkl7NgK4sYPSJ1l9VGQ6zHuO6OUkRhbgufl3bKAoQ X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr3603007pld.163.1523624245258; Fri, 13 Apr 2018 05:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523624245; cv=none; d=google.com; s=arc-20160816; b=DVRLJiLBk4R55pL6LPquEcOfS2qSHi6Ver6KVzQeFBgbWAOdJ4Eu13qveUok71AQRj D/eotwIdTyj6uVLVfITX52K0cvwg2KEGs+71lsdYz3V7bJMh+95PUMifsb7iLUlj2nLr E0g1PVp6RARHUtug2EnUDWie0wjKecT0+n+NDN44KMfYjSADa87Fi7phBleU/Y1C0JIL LNoEvdGWM9zMNBouYtnRbbVHuObfjZpj/1eZenh5tc77N+He8q7z+Nq54xcxC+tK0lJV QQnzDo1KGpkkrBangOkGozuwTR49Kz/DH4pdWpEnU1TbVrOkhr4w668XetJsZi7Psx8p Zyyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Y2p7JwudmruTITQcIlTSJH4nrXmC3C25JOh79x4+mdw=; b=HiJH6MHfPp4pc4A2qcpHfJUOifWKyRmhlYMz3i5CnBsikO6ApiMRxs3bs2gmlAdGL4 fnWqbiH1ERoDlNPlx/U3TF46ldsxNLniQmi5Dj21T5W7WGkJ0wkCbvx1ggdR3EWx8Izz ptCNkpgMEFH2b2TXg2GXEFXEBe/1yQAmUeGdpHsLJt4pEF78huikeN8ZIVivmig2uKXF Gjz3aP3x03CDLR9VQEwKxJ08n1IBuBDAqQ+L6p98J2Riw60r+a6DJeO9h2TLvhg9dPc+ 8T4G26Jjz7/SEN9JsQi1jU4ll1owPMH0dHUIbEUnRwJ3w0rv4Dk1l6ZoeJS4tMEqiqEI 4gNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si5403239plo.216.2018.04.13.05.57.11; Fri, 13 Apr 2018 05:57:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753982AbeDMM4A (ORCPT + 99 others); Fri, 13 Apr 2018 08:56:00 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49688 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753331AbeDMMz7 (ORCPT ); Fri, 13 Apr 2018 08:55:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBD7E4072451; Fri, 13 Apr 2018 12:55:58 +0000 (UTC) Received: from krava (unknown [10.40.205.63]) by smtp.corp.redhat.com (Postfix) with SMTP id 133F12026DFD; Fri, 13 Apr 2018 12:55:55 +0000 (UTC) Date: Fri, 13 Apr 2018 14:55:55 +0200 From: Jiri Olsa To: Ravi Bangoria Cc: acme@redhat.com, mhiramat@kernel.org, kstewart@linuxfoundation.org, tglx@linutronix.de, pombredanne@nexb.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, uneedsihyeon@gmail.com, kjlx@templeofstupid.com Subject: Re: [PATCH 2/3] perf/buildid-cache: Support --list option Message-ID: <20180413125555.GF28241@krava> References: <20180409110633.20767-1-ravi.bangoria@linux.vnet.ibm.com> <20180409110633.20767-3-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409110633.20767-3-ravi.bangoria@linux.vnet.ibm.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 13 Apr 2018 12:55:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 13 Apr 2018 12:55:58 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 09, 2018 at 04:36:32PM +0530, Ravi Bangoria wrote: SNIP > int cmd_buildid_cache(int argc, const char **argv) > { > struct strlist *list; > @@ -304,6 +324,8 @@ int cmd_buildid_cache(int argc, const char **argv) > int ret = 0; > int ns_id = -1; > bool force = false; > + bool list_files = false; > + bool opts_flag = false; > char const *add_name_list_str = NULL, > *remove_name_list_str = NULL, > *purge_name_list_str = NULL, > @@ -327,6 +349,7 @@ int cmd_buildid_cache(int argc, const char **argv) > "file(s) to remove"), > OPT_STRING('p', "purge", &purge_name_list_str, "file list", > "file(s) to remove (remove old caches too)"), > + OPT_BOOLEAN('l', "list", &list_files, "list all cached files"), > OPT_STRING('M', "missing", &missing_filename, "file", > "to find missing build ids in the cache"), > OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), > @@ -344,11 +367,18 @@ int cmd_buildid_cache(int argc, const char **argv) > argc = parse_options(argc, argv, buildid_cache_options, > buildid_cache_usage, 0); > > - if (argc || (!add_name_list_str && !kcore_filename && > - !remove_name_list_str && !purge_name_list_str && > - !missing_filename && !update_name_list_str)) > + opts_flag = add_name_list_str || kcore_filename || > + remove_name_list_str || purge_name_list_str || > + missing_filename || update_name_list_str; > + > + if (argc || !(list_files || opts_flag)) > usage_with_options(buildid_cache_usage, buildid_cache_options); > > + /* -l is exclusive. It can not be used with other options. */ > + if (list_files && opts_flag) > + usage_with_options_msg(buildid_cache_usage, > + buildid_cache_options, "-l is exclusive.\n"); missing {} on multiline condition leg jirka