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,URIBL_BLOCKED,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 E6D69C28CC0 for ; Wed, 29 May 2019 13:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFB7D21902 for ; Wed, 29 May 2019 13:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559137072; bh=+ZvAnmNjuw0iWhWDTrueRdjXjuuNaGvKHIq2mTdbGMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KJzFTJzI1bcCA70j6V5VL+jK8FoGWE+M0qTlejg3nGo/ioXQacJjmAkDdJJhbPfe7 adeeqEKkQF2UfrDzdqumG5XTTItvckmBqmueuBsy5d6f761Hh0pXwlENhSSox7frJG aLiX9rBjVqi07+C13i+ABra1EaDuCnjSEMYGyGl4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbfE2Nhv (ORCPT ); Wed, 29 May 2019 09:37:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:53336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbfE2Nhu (ORCPT ); Wed, 29 May 2019 09:37:50 -0400 Received: from quaco.ghostprotocols.net (unknown [177.195.211.85]) (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 72B7820883; Wed, 29 May 2019 13:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559137070; bh=+ZvAnmNjuw0iWhWDTrueRdjXjuuNaGvKHIq2mTdbGMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pxqmdc27kbXajpHnm9J3iDi0EJ1VClTfHiu9yi4m/k/Uc7KGVZk80sF/ks+Jj1Px5 mdavDtiQnNTARbREkMsEIxa+p34I63aeKEDsLziNVMZRgz8xGM8vStGlTp0C3MK4pV pAkZbRArMNgYI5bzNk973EXIY37ks7WHszG6//dc= 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 20/41] perf top: Add --namespaces option Date: Wed, 29 May 2019 10:35:44 -0300 Message-Id: <20190529133605.21118-21-acme@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529133605.21118-1-acme@kernel.org> References: <20190529133605.21118-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