From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965417AbcLTTZb (ORCPT ); Tue, 20 Dec 2016 14:25:31 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35620 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755472AbcLTTZZ (ORCPT ); Tue, 20 Dec 2016 14:25:25 -0500 Date: Tue, 20 Dec 2016 11:25:08 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: a.p.zijlstra@chello.nl, hpa@zytor.com, namhyung@kernel.org, tglx@linutronix.de, mingo@kernel.org, jolsa@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, dsahern@gmail.com Reply-To: jolsa@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl, namhyung@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org In-Reply-To: <1481538943-21874-6-git-send-email-jolsa@kernel.org> References: <1481538943-21874-6-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf record: Force ignore_missing_thread for uid option Git-Commit-ID: 23dc4f1586159470aac707caae526824dd077e25 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: 23dc4f1586159470aac707caae526824dd077e25 Gitweb: http://git.kernel.org/tip/23dc4f1586159470aac707caae526824dd077e25 Author: Jiri Olsa AuthorDate: Mon, 12 Dec 2016 11:35:43 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 15 Dec 2016 16:25:46 -0300 perf record: Force ignore_missing_thread for uid option Enable perf_evsel::ignore_missing_thread for -u option to ignore complete failure if any of the user's processes die between its enumeration and time we open the event. Committer notes: While doing a 'make -j4 allmodconfig' we sometimes get into the race: Before: # perf record -u acme Error: The sys_perf_event_open() syscall returned with 3 (No such process) for event (cycles:ppp). /bin/dmesg may provide additional information. No CONFIG_PERF_EVENTS=y kernel support configured? # After: [root@jouet ~]# perf record -u acme WARNING: Ignored open failure for pid 9888 WARNING: Ignored open failure for pid 18059 [root@jouet ~]# Which is an improvement, with the races not preventing the remaining threads for the specified user from being monitored, but the message probably needs further clarification. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1481538943-21874-6-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index fa26865..74d6a03 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1687,6 +1687,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) goto out; } + /* Enable ignoring missing threads when -u option is defined. */ + rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX; + err = -ENOMEM; if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0) usage_with_options(record_usage, record_options);