Add report.percentage option for setting default value of the
symbol_conf.filter_relative.  It affects the report output only if a
filter applied.

An user can write .perfconfig file like below to show absolute
percentage of filtered entries by default:

  $ cat ~/.perfconfig
  [report]
  percentage = absolute

And it can be changed through command line:

  $ perf report --percentage relative

Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/builtin-report.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 535bd6745355..1bb9e989c7bd 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -71,6 +71,16 @@ static int report__config(const char *var, const char 
*value, void *cb)
                rep->min_percent = strtof(value, NULL);
                return 0;
        }
+       if (!strcmp(var, "report.percentage")) {
+               if (!strcmp(value, "relative"))
+                       symbol_conf.filter_relative = true;
+               else if (!strcmp(value, "absolute"))
+                       symbol_conf.filter_relative = false;
+               else
+                       return -1;
+
+               return 0;
+       }
 
        return perf_default_config(var, value, cb);
 }
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to