From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754261AbcKUVeP (ORCPT ); Mon, 21 Nov 2016 16:34:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753548AbcKUVeL (ORCPT ); Mon, 21 Nov 2016 16:34:11 -0500 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: [PATCH 3/6] perf c2c report: Add -f/--force option Date: Mon, 21 Nov 2016 22:33:28 +0100 Message-Id: <1479764011-10732-4-git-send-email-jolsa@kernel.org> In-Reply-To: <1479764011-10732-1-git-send-email-jolsa@kernel.org> References: <1479764011-10732-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 21 Nov 2016 21:33:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Link: http://lkml.kernel.org/n/tip-p035bwv1lr24lf6n5apt2lwn@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/Documentation/perf-c2c.txt | 4 ++++ tools/perf/builtin-c2c.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt index 21810d711f5f..5eda9336267e 100644 --- a/tools/perf/Documentation/perf-c2c.txt +++ b/tools/perf/Documentation/perf-c2c.txt @@ -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 diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 15addb06d611..d873977b8fb6 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -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) -- 2.7.4