Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbdHOPNZ (ORCPT ); Tue, 15 Aug 2017 11:13:25 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36965 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbdHOPNV (ORCPT ); Tue, 15 Aug 2017 11:13:21 -0400 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, taeung@kosslab.kr, Namhyung Kim , Jiri Olsa Subject: [PATCH v2 2/4] perf annotate: Period and samples view can't be used at the same time Date: Wed, 16 Aug 2017 00:13:15 +0900 Message-Id: <1502809995-18194-1-git-send-email-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1275 Lines: 40 If users give two options --show-total-period and --show-nr-samples, show their proper usage because the two options can not be used at the same time. Cc: Namhyung Kim Cc: Jiri Olsa Signed-off-by: Taeung Song --- tools/perf/builtin-annotate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index acde4cc..9d25c27 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -403,7 +403,7 @@ int cmd_annotate(int argc, const char **argv) struct perf_data_file file = { .mode = PERF_DATA_MODE_READ, }; - const struct option options[] = { + struct option options[] = { OPT_STRING('i', "input", &input_name, "file", "input file name"), OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]", @@ -452,8 +452,12 @@ int cmd_annotate(int argc, const char **argv) stdio__config_color, "always"), OPT_END() }; - int ret = hists__init(); + int ret; + + set_option_flag(options, 0, "show-total-period", PARSE_OPT_EXCLUSIVE); + set_option_flag(options, 0, "show-nr-samples", PARSE_OPT_EXCLUSIVE); + ret = hists__init(); if (ret < 0) return ret; -- 2.7.4