Messages in this thread Patch in this message | | | From | Masami Hiramatsu <> | Subject | [PATCH -tip 10/12] perf probe: Warn when more than two lines are given | Date | Wed, 30 Mar 2011 18:26:34 +0900 |
| |
Print warning which warns only the last specified --line option is valid.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> ---
tools/perf/builtin-probe.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 2c0e64d..4f3460a 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -134,10 +134,15 @@ static int opt_show_lines(const struct option *opt __used, { int ret = 0; - if (str) - ret = parse_line_range_desc(str, ¶ms.line_range); - INIT_LIST_HEAD(¶ms.line_range.line_list); + if (!str) + return 0; + + if (params.show_lines) + pr_warning("Warning: more than two --line option are" + " detected. Only last option is valid.\n"); params.show_lines = true; + ret = parse_line_range_desc(str, ¶ms.line_range); + INIT_LIST_HEAD(¶ms.line_range.line_list); return ret; }
| |