perf c2c report: Add -f/--force option
authorJiri Olsa <jolsa@kernel.org>
Mon, 21 Nov 2016 21:33:28 +0000 (22:33 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 23 Nov 2016 13:44:04 +0000 (10:44 -0300)
Adding -f/--force option to go through ownership validation:

  $ sudo perf c2c report
  File perf.data not owned by current user or root (use -f to override)
  $
  $ sudo perf c2c report -f
  < c2c report output >
  $

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-c2c.txt
tools/perf/builtin-c2c.c

index 21810d711f5f0c06c754d83c2191f387b5cd7ff5..5eda9336267ed6db77e0e06c789f33422f30ac4a 100644 (file)
@@ -100,6 +100,10 @@ REPORT OPTIONS
 --show-all::
        Show all captured HITM lines, with no regard to HITM % 0.0005 limit.
 
+-f::
+--force::
+       Don't do ownership validation.
+
 C2C RECORD
 ----------
 The perf c2c record command setup options related to HITM cacheline analysis
index 15addb06d61177ab8f5294926b89bc8b9f17a250..d873977b8fb66dcbde30778985ad73da6ddea092 100644 (file)
@@ -2523,6 +2523,7 @@ static int perf_c2c__report(int argc, const char **argv)
        OPT_STRING('d', "display", &display, NULL, "lcl,rmt"),
        OPT_STRING('c', "coalesce", &coalesce, "coalesce fields",
                   "coalesce fields: pid,tid,iaddr,dso"),
+       OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
        OPT_END()
        };
        int err = 0;
@@ -2538,7 +2539,8 @@ static int perf_c2c__report(int argc, const char **argv)
        if (!input_name || !strlen(input_name))
                input_name = "perf.data";
 
-       file.path = input_name;
+       file.path  = input_name;
+       file.force = symbol_conf.force;
 
        err = setup_display(display);
        if (err)