Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6310306imd; Wed, 31 Oct 2018 09:47:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5fh9JsoDTAAp3sOQ9Q4LThV1CYXfSaJ+1Lu5kaHiIiOfeeBonl/oACI/WUpCiX9kux7kfgp X-Received: by 2002:a17:902:6b4b:: with SMTP id g11-v6mr4143093plt.213.1541004430853; Wed, 31 Oct 2018 09:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541004430; cv=none; d=google.com; s=arc-20160816; b=iamEq9w3qmGji2GtFCDKQteBhxQVVOvrtsaUMT35A5dFYbuGTt5KT/qpQ4zvOpz6Sk XVGxpc0Iteu9HnrCi0UT1EPhUwE/oZD0cERc6FBA/65d8CQGNL8Pm8fYcQbU761lwceK bulS0Q1oHUHKpFC/D8FQ5RsvxCI3ZPehNDQGeexrFT7g1h3CF9dJ4bvhkOTBtiwrQIDG RSN616iFyWpOnER/XemaSXRJuD87KeKKNDRvLTc2KcegnRF7ZFDdcP9H33MBOhxFDtWK vNeoDQuIiX2GGRBkA9QySOBOUbZwxf66+/AfqfcGqS/seUD1QCCCWdf7V+WTYI2L3BLT tIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=xr9okmvgo8sXOJ/53s2A8Y9NvLc2UY5jDn9622ZOKe0=; b=dnqfL/NSewfgL+RK+Q3yHoO6yKZ7qFiatvix1tMbGomHKghgIAvnLB79gk/pD8p6dR 8EZRj55rcnIpr4PXYAymU81gQXTJlpgGgf1ShNVWMi7PE/9FnxNJAWQez6zEFI6B/6RP 1DwF0GvUcKMZfGHnzrOkep/HpL9eMeCtIMVfBg7f/zzdbDa+b2l4lBwgsJPnnS8alu1Z zCBIwPz731pEQcRFZ+bBfd57BlJJThXTxa4pLW6lsC9gZWxG5WH+O4/P/qjFcZHoDfaH cPyg+TUccL7HjrULp40Bh04Jgd+q5keLJaHgHptzrgdyueDziuiOo8CM0pXbZB66++PA OQjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IV2YNNXm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u128-v6si25459856pfb.181.2018.10.31.09.46.55; Wed, 31 Oct 2018 09:47:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IV2YNNXm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730048AbeKABou (ORCPT + 99 others); Wed, 31 Oct 2018 21:44:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:59400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729827AbeKABou (ORCPT ); Wed, 31 Oct 2018 21:44:50 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E82920821; Wed, 31 Oct 2018 16:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541004362; bh=jTgGvFzOzafwt+CY8S7+Ne1yJ6WwkdJJd0PeBYmocuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IV2YNNXml9F+veJQm8Gy57dk0TEE2L3AqtefbaLk9we9lguBAP5zjNy30eF2jo/Xo nvtBQJucXs3dJDKqH5oCtUVb5Axfd42e5AVZTDc5uZUd2q8Ea1lIciRJS+sBhhSuZZ wZEpeBYPYzrumstQuYcworAgtiV3wXkNokdQOKFA= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 11/28] perf top: Do not use overwrite mode by default Date: Wed, 31 Oct 2018 13:44:51 -0300 Message-Id: <20181031164508.4784-12-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181031164508.4784-1-acme@kernel.org> References: <20181031164508.4784-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo Enabling --overwrite mode allows us to to use just the most recent records, which helps in high core count machines such as Knights Landing/Mill, but right now is being disabled by default as the pausing used in this technique is leading to loss of metadata events such as PERF_RECORD_MMAP which makes 'perf top' unable to resolve samples, leading to lots of unknown samples appearing on the UI. Enabling this may be useful if you are in such machines and profiling a workload that doesn't creates short lived threads and/or doesn't uses many executable mmap operations. Work is being planed to solve this situation, till then, this will remain disabled by default. Reported-by: David Miller Acked-by: Kan Liang Link: https://lkml.kernel.org/r/4f84468f-37d9-cf1b-12c1-514ef74b6a48@linux.intel.com Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Fixes: ebebbf082357 ("perf top: Switch default mode to overwrite mode") Link: https://lkml.kernel.org/n/tip-ehvf77vi1si9409r7p4wx788@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-top.txt | 11 ++++++++--- tools/perf/builtin-top.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index d4be6061fe1c..808b664343c9 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -243,9 +243,14 @@ Default is to monitor all CPUS. Enable hierarchy output. --overwrite:: - This is the default, but for investigating problems with it or any other strange - behaviour like lots of unknown samples, we may want to disable this mode by using - --no-overwrite. + Enable this to use just the most recent records, which helps in high core count + machines such as Knights Landing/Mill, but right now is disabled by default as + the pausing used in this technique is leading to loss of metadata events such + as PERF_RECORD_MMAP which makes 'perf top' unable to resolve samples, leading + to lots of unknown samples appearing on the UI. Enable this if you are in such + machines and profiling a workload that doesn't creates short lived threads and/or + doesn't uses many executable mmap operations. Work is being planed to solve + this situation, till then, this will remain disabled by default. --force:: Don't do ownership validation. diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 214fad747b04..8e29e0cc8626 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1257,7 +1257,14 @@ int cmd_top(int argc, const char **argv) .uses_mmap = true, }, .proc_map_timeout = 500, - .overwrite = 1, + /* + * FIXME: This will lose PERF_RECORD_MMAP and other metadata + * when we pause, fix that and reenable. Probably using a + * separate evlist with a dummy event, i.e. a non-overwrite + * ring buffer just for metadata events, while PERF_RECORD_SAMPLE + * stays in overwrite mode. -acme + * */ + .overwrite = 0, }, .max_stack = sysctl__max_stack(), .annotation_opts = annotation__default_options, @@ -1373,7 +1380,7 @@ int cmd_top(int argc, const char **argv) OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy, "Show entries in a hierarchy"), OPT_BOOLEAN(0, "overwrite", &top.record_opts.overwrite, - "Use a backward ring buffer, default: yes"), + "Use a backward ring buffer, default: no"), OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"), OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize, "number of thread to run event synthesize"), -- 2.14.4