aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-02-06 22:06:07 -0500
committerJiri Olsa <jolsa@redhat.com>2014-04-16 11:16:03 -0400
commit33db4568e1f41efe6d0e4695483f968fc1135bf3 (patch)
tree864186165ad27a133c773d36dd83b20cf5a19abc /tools/perf/builtin-report.c
parentf2148330544a697481219b5bc34261f6dd049bfb (diff)
perf top: Add --percentage option
The --percentage option is for controlling overhead percentage displayed. It can only receive either of "relative" or "absolute". Move the parser callback function into a common location since it's used by multiple commands now. For more information, please see previous commit same thing done to "perf report". Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1397145720-8063-4-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 7ec351bda833..af8cb7a2c9b6 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -717,20 +717,6 @@ parse_percent_limit(const struct option *opt, const char *str,
717 return 0; 717 return 0;
718} 718}
719 719
720static int
721parse_percentage(const struct option *opt __maybe_unused, const char *str,
722 int unset __maybe_unused)
723{
724 if (!strcmp(str, "relative"))
725 symbol_conf.filter_relative = true;
726 else if (!strcmp(str, "absolute"))
727 symbol_conf.filter_relative = false;
728 else
729 return -1;
730
731 return 0;
732}
733
734int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) 720int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
735{ 721{
736 struct perf_session *session; 722 struct perf_session *session;
@@ -854,7 +840,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
854 OPT_CALLBACK(0, "percent-limit", &report, "percent", 840 OPT_CALLBACK(0, "percent-limit", &report, "percent",
855 "Don't show entries under that percent", parse_percent_limit), 841 "Don't show entries under that percent", parse_percent_limit),
856 OPT_CALLBACK(0, "percentage", NULL, "relative|absolute", 842 OPT_CALLBACK(0, "percentage", NULL, "relative|absolute",
857 "how to display percentage of filtered entries", parse_percentage), 843 "how to display percentage of filtered entries", parse_filter_percentage),
858 OPT_END() 844 OPT_END()
859 }; 845 };
860 struct perf_data_file file = { 846 struct perf_data_file file = {