Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6310221imd; Wed, 31 Oct 2018 09:47:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5dd9OtEvg0Eb5EoCOXm37C+eXizaJUIK1MSqLpAM/HpjJcbvfhCbUm6Kb2n+J10ujJQ73Yt X-Received: by 2002:a62:9702:: with SMTP id n2-v6mr4143207pfe.222.1541004425072; Wed, 31 Oct 2018 09:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541004425; cv=none; d=google.com; s=arc-20160816; b=j+MDkn37auJ2ALtedfbVSLEE6aIEflx23wj5dlypZhi1hMryLO1kxwN6y08ZueCZAT JDIlGOaz6ackEhJIKIPzsUHwI4zwdmPKR2hQDxhF3nRzCR8F1umaGKXNqDFW2VZTp80B Kfy8Yg++Li35pdB4KSRmeKmhZvpncOtn6J+1M+yugutAmxxClN8ZN7fXt8aRxK+p62YD BL8MbH5FFhON9Oam/LcE1ZmKfRl1+dAaY8iEgpgaRLiFiUjQ7WLDzkA9bbq/He+ishhm 0FJWobYWoBAH7gi5cMOqiVZQQEnXw/3adSoCp3LIiR/YHhexw8mW92LI9DbXYtW4za0D CYNA== 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=VCiVsUzR8VNKX23l18xD+YGznbrD/g5K/dFttmCVkgY=; b=wEPRMg4GK1D69kO3Z+YLeXKfISMVvigWNaDg7cOVFSNGNlu8vNMxq8/7vcFDE9++pf MK8HD3Fp/lAvWJA+juU7K2XZM/1v7pd45INpknh6mMPWH+odZXCDhIzEcrZCVJbq2Ch5 zpG+IAZNRA6NuRLmdVNlydep/T0AfjvMm84ALhNZlceWpZmL9ds5mewRTs1+SQ0XzuzD hxOvLrgMeOHvJIDrOkCzRTx98vqKhEHIGU9zZT1/JDO8rptSNGrCzsf+njbSfajgfY/e 5Pihc/UC7UH9ipVkP2e4Nn5pliQTJ7fU6diwDmoMUTSR4Vl2lv7JAM4hmwZG8shDbSen nW8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yUdyqMRV; 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 r3-v6si28871676pgn.313.2018.10.31.09.46.49; Wed, 31 Oct 2018 09:47:05 -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=yUdyqMRV; 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 S1730037AbeKABor (ORCPT + 99 others); Wed, 31 Oct 2018 21:44:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:59328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729847AbeKABoq (ORCPT ); Wed, 31 Oct 2018 21:44:46 -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 4C9E62082E; Wed, 31 Oct 2018 16:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541004358; bh=+3JUxhVKdTpjUtA8dfWW/YCyhGoqX7gu9bW44hP9f3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yUdyqMRVFcPrwBcK3HShE16L1FbNlLhs+Zyh9sMav44YVr6bSZKS1g9e22qys0OWJ Uj5MxiG9QHNlKSrVNToIKKaspuldMkEflwI7BE/YalUCekBvEfYx7yV2zWn5uTaRB3 fGRNLicHrVmWkKZMI+SF7dtye9Ej+L7WKeHl4m6M= 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 , Andi Kleen , David Ahern , Jin Yao , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Wang Nan Subject: [PATCH 10/28] perf top: Allow disabling the overwrite mode Date: Wed, 31 Oct 2018 13:44:50 -0300 Message-Id: <20181031164508.4784-11-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 In ebebbf082357 ("perf top: Switch default mode to overwrite mode") we forgot to leave a way to disable that new default, add a --overwrite option that can be disabled using --no-overwrite, since the code already in such a way that we can readily disable this mode. This is useful when investigating bugs with this mode like the recent report from David Miller where lots of unknown symbols appear due to disabling the events while processing them which disables all record types, not just PERF_RECORD_SAMPLE, which makes it impossible to resolve maps when we lose PERF_RECORD_MMAP records. This can be easily seen while building a kernel, when there are lots of short lived processes. Reported-by: David Miller Acked-by: Kan Liang Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Fixes: ebebbf082357 ("perf top: Switch default mode to overwrite mode") Link: https://lkml.kernel.org/n/tip-oqgsz2bq4kgrnnajrafcdhie@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-top.txt | 5 +++++ tools/perf/builtin-top.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index 114fda12aa49..d4be6061fe1c 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -242,6 +242,11 @@ Default is to monitor all CPUS. --hierarchy:: 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. + --force:: Don't do ownership validation. diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index d21d8751e749..214fad747b04 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1372,6 +1372,8 @@ int cmd_top(int argc, const char **argv) "Show raw trace event output (do not use print fmt or plugins)"), 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"), 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