From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932452AbbDHPOE (ORCPT ); Wed, 8 Apr 2015 11:14:04 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40324 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbbDHPN4 (ORCPT ); Wed, 8 Apr 2015 11:13:56 -0400 Date: Wed, 8 Apr 2015 08:13:36 -0700 From: tip-bot for Yunlong Song Message-ID: Cc: a.p.zijlstra@chello.nl, mingo@kernel.org, linux-kernel@vger.kernel.org, yunlong.song@huawei.com, tglx@linutronix.de, hpa@zytor.com, wangnan0@huawei.com, paulus@samba.org, acme@redhat.com Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl, paulus@samba.org, acme@redhat.com, tglx@linutronix.de, yunlong.song@huawei.com, wangnan0@huawei.com, hpa@zytor.com In-Reply-To: <1427809596-29559-9-git-send-email-yunlong.song@huawei.com> References: <1427809596-29559-9-git-send-email-yunlong.song@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf sched replay: Support using -f to override perf.data file ownership Git-Commit-ID: f0dd330fdf07d295ac468660cf60341796d5d501 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f0dd330fdf07d295ac468660cf60341796d5d501 Gitweb: http://git.kernel.org/tip/f0dd330fdf07d295ac468660cf60341796d5d501 Author: Yunlong Song AuthorDate: Tue, 31 Mar 2015 21:46:35 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Apr 2015 09:07:26 -0300 perf sched replay: Support using -f to override perf.data file ownership Enable to use perf.data when it is not owned by current user or root. Example: $ ls -al perf.data -rw------- 1 Yunlong.Song Yunlong.Song 5321918 Mar 25 15:14 perf.data $ sudo id uid=0(root) gid=0(root) groups=0(root),64(pkcs11) Before this patch: $ sudo perf sched replay -f run measurement overhead: 98 nsecs sleep measurement overhead: 52909 nsecs the run test took 1000015 nsecs the sleep test took 1054253 nsecs File perf.data not owned by current user or root (use -f to override) As shown above, the -f option does not work at all. After this patch: $ sudo perf sched replay -f run measurement overhead: 221 nsecs sleep measurement overhead: 40514 nsecs the run test took 1000003 nsecs the sleep test took 1056098 nsecs nr_run_events: 10 nr_sleep_events: 1562 nr_wakeup_events: 5 task 0 ( :1: 1), nr_events: 1 task 1 ( :2: 2), nr_events: 1 task 2 ( :3: 3), nr_events: 1 ... ... task 1549 ( :163132: 163132), nr_events: 1 task 1550 ( :163540: 163540), nr_events: 1 task 1551 ( : 0), nr_events: 10 ------------------------------------------------------------ #1 : 50.198, ravg: 50.20, cpu: 2335.18 / 2335.18 #2 : 219.099, ravg: 67.09, cpu: 2835.11 / 2385.17 #3 : 238.626, ravg: 84.24, cpu: 3278.26 / 2474.48 #4 : 200.364, ravg: 95.85, cpu: 2977.41 / 2524.77 #5 : 176.882, ravg: 103.96, cpu: 2801.35 / 2552.43 #6 : 191.093, ravg: 112.67, cpu: 2813.70 / 2578.56 #7 : 189.448, ravg: 120.35, cpu: 2809.21 / 2601.62 #8 : 200.637, ravg: 128.38, cpu: 2849.91 / 2626.45 #9 : 248.338, ravg: 140.37, cpu: 4380.61 / 2801.87 #10 : 511.139, ravg: 177.45, cpu: 3077.73 / 2829.45 As shown above, the -f option really works now. Besides for replay, -f option can also work for latency and map. Signed-off-by: Yunlong Song Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1427809596-29559-9-git-send-email-yunlong.song@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 5ab58c6..7b7b798 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1487,6 +1487,7 @@ static int perf_sched__read_events(struct perf_sched *sched) struct perf_data_file file = { .path = input_name, .mode = PERF_DATA_MODE_READ, + .force = sched->force, }; int rc = -1;