Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp606154ybz; Wed, 29 Apr 2020 06:16:03 -0700 (PDT) X-Google-Smtp-Source: APiQypKmtO0HqMNBfKTA1FXzzAw6mifwTayFnbLeTswh9Ow+4/njcGGljE3H8nkpyN6p36wn45tm X-Received: by 2002:a05:6402:1713:: with SMTP id y19mr2505591edu.40.1588166163331; Wed, 29 Apr 2020 06:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588166163; cv=none; d=google.com; s=arc-20160816; b=0pZ5MiPIvvWEVQ5fZe9gRTWEhiwky8iZMIjezGOe9SRKxtPch99Yy/5/g36OByiSPE SyJ1c8fXyAnzNLy1Bi/fZ3JOQqanBoOAD6o/NspP6Eo1darEzie9Tgjbidb9gKBSQu2S BtBiF4Q85aENbcqWIiwDkzayEX8L16e9i4MLDWwGbHzxKI7A+eeFK23GTuEHGunhOm4y KHMSMpyKU++TpGu+7mGY/jA+jECl1/ePejmH3eIr/97sx7ulGNt0wqskhlSlXC86+sNA vNjGDRhsQQR0KhqgaH5F2tlnE/DKTmd1c6wZS6BGdJL7OZlbgz5KUd9uFZWb/GVzhFTJ U4kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pUw7B2Gq69+GjQunwFmdJ4u0qyDlGjy8O3EzyXaBerk=; b=veSc6KSjZE5TwqPX+PtOGLSiZwDYG0oYNUU+itp9u/BNrk0qQ/DesNEaiyh0g8Yle+ sbsz47nfpsAGgDSoY5CcO6y2RGryZfueDs//CZmUHTBdCmf8VdBEhD39QDgMAmA92AvS sRKchMu08TPxvJORIcG6B42PQ6tMbHovsT0aSi/tRTQBLVxEXn1s68swLw9qM789DW74 TieqkmAMw7OTTvMSvHL2h/M6M9n/Dco6IcIni0y9kMi2TdUDlrAuG2trBqL9deZfSCUI SP3978HKCO2kX6Ya1/IFcn99uMCD6Xl34L0xD75YSAm6V8rIAOelqTukEmNIhP0dwLnJ yasQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kL+yhE70; 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 b24si3338886edr.338.2020.04.29.06.15.38; Wed, 29 Apr 2020 06:16:03 -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=kL+yhE70; 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 S1727082AbgD2NLf (ORCPT + 99 others); Wed, 29 Apr 2020 09:11:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:48536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbgD2NLb (ORCPT ); Wed, 29 Apr 2020 09:11:31 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (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 719142222E; Wed, 29 Apr 2020 13:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588165890; bh=n9EcOT2FkCDsxsKqknM65PlZojf+JnB9Wjlg3PWyG7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kL+yhE70h5XSHlibd6URd3FOB9YRWuJ9w/8oshwVvrhSbbYF66srBejh5Veu9mvKk 5/UgYvPQdMOXm4mcykcwBf/dgibGkviCWgHPWmUbd1nmd1xEfWN+Gov65dC14cEwXV 1pPH5Cs0Sntyld8186oiOWe5lZybrnPUx4dzNkeI= From: Arnaldo Carvalho de Melo To: Jiri Olsa , Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , Song Liu Subject: [PATCH 6/8] libsubcmd: Introduce OPT_CALLBACK_SET() Date: Wed, 29 Apr 2020 10:11:04 -0300 Message-Id: <20200429131106.27974-7-acme@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200429131106.27974-1-acme@kernel.org> References: <20200429131106.27974-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo To register that an option was set, like with the upcoming 'perf record --switch-output-option' one. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200428121601.GB2245@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/subcmd/parse-options.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h index af9def589863..d2414144eb8c 100644 --- a/tools/lib/subcmd/parse-options.h +++ b/tools/lib/subcmd/parse-options.h @@ -151,6 +151,8 @@ struct option { { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } #define OPT_CALLBACK(s, l, v, a, h, f) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f) } +#define OPT_CALLBACK_SET(s, l, v, os, a, h, f) \ + { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .set = check_vtype(os, bool *)} #define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG } #define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \ -- 2.21.1