From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E22C04AB3 for ; Mon, 27 May 2019 22:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A868C20859 for ; Mon, 27 May 2019 22:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558996798; bh=+ZvAnmNjuw0iWhWDTrueRdjXjuuNaGvKHIq2mTdbGMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2AA5ghQMD9JWTtPRvRAT6d2+Efm6nVsrL/FLbxvoMgmqh/VkT2W/ndShbHt9FJPfN rpwX5aPFEKkhVNi4BJpCKLkOp6iaWivosmqWLvBKyG38zUIAAdeFuRl5Emf5YjGw2u c8MVX8/140jAT89xK2E5+ZIpBWbvWwsQbxlZmRX4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727951AbfE0Wj6 (ORCPT ); Mon, 27 May 2019 18:39:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:45752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbfE0Wj4 (ORCPT ); Mon, 27 May 2019 18:39:56 -0400 Received: from quaco.ghostprotocols.net (179-240-171-7.3g.claro.net.br [179.240.171.7]) (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 242D8208C3; Mon, 27 May 2019 22:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558996795; bh=+ZvAnmNjuw0iWhWDTrueRdjXjuuNaGvKHIq2mTdbGMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BhREAO6jEIzn2SVNKITJiSFKZUCi5sgUIzvhbdi45Qz6p099X17TiCjUOjL3Fjy8e 4xx5j7XSxv9OU+QZEVNa8bCU1IeFaauBnh/NI6yalCzvXZe7694+sSSliTe54Fu+n8 tcCTDOI0rKQJ4jc9AyYc9PRjV+r+IQ3gGbdJTp+g= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Hari Bathini , Jiri Olsa , Krister Johansen , Arnaldo Carvalho de Melo Subject: [PATCH 28/44] perf top: Add --namespaces option Date: Mon, 27 May 2019 19:37:14 -0300 Message-Id: <20190527223730.11474-29-acme@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527223730.11474-1-acme@kernel.org> References: <20190527223730.11474-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim Since 'perf record' already have this option, let's have it for 'perf top' as well. Signed-off-by: Namhyung Kim Cc: Hari Bathini Cc: Jiri Olsa Cc: Krister Johansen Link: http://lkml.kernel.org/r/20190522053250.207156-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-top.txt | 5 +++++ tools/perf/builtin-top.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index 44d89fb9c788..cfea87c6f38e 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -262,6 +262,11 @@ Default is to monitor all CPUS. The number of threads to run when synthesizing events for existing processes. By default, the number of threads equals to the number of online CPUs. +--namespaces:: + Record events of type PERF_RECORD_NAMESPACES and display it with the + 'cgroup_id' sort key. + + INTERACTIVE PROMPTING KEYS -------------------------- diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index fbbb0da43abb..31d78d874fc7 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1208,6 +1208,9 @@ static int __cmd_top(struct perf_top *top) init_process_thread(top); + if (opts->record_namespaces) + top->tool.namespace_events = true; + ret = perf_event__synthesize_bpf_events(top->session, perf_event__process, &top->session->machines.host, &top->record_opts); @@ -1500,6 +1503,8 @@ int cmd_top(int argc, const char **argv) 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"), + OPT_BOOLEAN(0, "namespaces", &opts->record_namespaces, + "Record namespaces events"), OPT_END() }; struct perf_evlist *sb_evlist = NULL; -- 2.20.1