Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4108312pxy; Mon, 26 Apr 2021 18:42:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0FYZCBeAjYdaCuBuchpTqjb5vc/rz+IPg84TPrbYgqVnoZGNnI2Zy81whKECDXTcnQnhb X-Received: by 2002:a17:90a:be10:: with SMTP id a16mr2074381pjs.112.1619487720498; Mon, 26 Apr 2021 18:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619487720; cv=none; d=google.com; s=arc-20160816; b=0Dd8BDcFu++CvkWYG76Y2D5JDqCJqFRhIsYrdD+0OiDuAhZ4BkREu9WLhJakJHmTdB VojBHhDlsRd93GC6wT45PzInIYnU6kI+ZB6xQF+jUjqN1Sb70Sz064icUxv6cHgBIgnk mFbp9fqJt+Gs0K01pc0ZBeKzYrOKLTZx0J1FeRsc7UdWPbdK9eTno3zFL6PkqxueD+lc Dm3G9SNhPY1ztIYDeSaDEBVz/eOQGXFQdj9LGRuff6gb/Hw3sKzW6rD745F2+438s7ql SowKQ/7tJgIMy/QX4ckW7SJznGDMMj0hQ38B1fotPp14ss5mnPbMRDBAzftSJtm1JD5K I58Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=nds5UsnFfWyLneoZ29mCNCHjuwAf8rMG4lYQhbzz8Fg=; b=xKGNlwAf/rfHDSs+68ifcUKu71Vlq3xAlPFz47sbfiLYh6ApSfeq6TKSn2Zr3P6WKy QHrZmpLnc2fXricoMcMwrEoDG68Bkl/EC3uvzbIXZoeUP8YEmX8GbUgRS3Zmej7JM1wW wtRrsYcg3+SqnEFUp9laxIgYs8uqIZ7H7FMMgkz/CUInjSVlpJXyvySfj6y2ptJQreDL duTxQ3LICYG77JISzfMg+FhDl1zNxkFCBtG+CpE4LmFC9UPer2df+vtrQoHfILEJrEig gkcL0MUJqsebJ4YqEePECMOXKl1zkMcJwSQZ4szmenU7m3IzIByNuPD7Juq1LkR84esA 7zvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M4UG5LY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id n12si18947048pgp.275.2021.04.26.18.41.48; Mon, 26 Apr 2021 18:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M4UG5LY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236243AbhD0BiR (ORCPT + 99 others); Mon, 26 Apr 2021 21:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236339AbhD0BiO (ORCPT ); Mon, 26 Apr 2021 21:38:14 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F093C06175F for ; Mon, 26 Apr 2021 18:37:30 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id y136so26486566qkb.1 for ; Mon, 26 Apr 2021 18:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nds5UsnFfWyLneoZ29mCNCHjuwAf8rMG4lYQhbzz8Fg=; b=M4UG5LY+9RAykfAcBIS8bjYPsVRRnjmN7g7q5VJam0ecKOykjkic/MGXTb74/fTPzU Te2b6e/Uu6N3fFrQE/Ki2IbuBu9tnRpA9iST/2aC5jUaot9h0yTuAGecDExIoi5MJIMu 8IB1j21skSRSCScc9VrKWUKnvYXdlaxp+gfn7M4bJqJDrjWridCvN48/+ciiyZMtV5Mq g2c6ujrgBB5yjfGpv4xCJZ3F0haVbx56MAJdjaRqf4oVnydExCi/mTpXfvSS7KPdNg3q Ew0nWepAI5uSE7EdzKjuYCJoC1ZAdeKOY1Hy9U3AwEWzRdxnoEj4912bd0mX0pj9rW31 sBZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nds5UsnFfWyLneoZ29mCNCHjuwAf8rMG4lYQhbzz8Fg=; b=DjhQO79rPjmO5FSlodQuWfXSD52BOkLYDjMVFafP4u20Rfv5y5dUPRC30C+YQsVUjf iOzrTtSJ0WDAWPY/ysyl3zT0miYTVvZ23W54ysYfUas1mZ8Jmzd4KajDgF9whFyP2GQH 969c4VeyQkKIN5DjE7IAR7yYZeqQ/CLbsAjeLqLwzmPCD8dEFIoT9dO3sduBN/N3LbaW CS2Fwwqx4dOZzhJaYxUXYy07UDkM8EHQL2YPB1qMkAPfemUPO5Xq354sYpUKFBUhLZET mpQbMlQSqO1XOza66iUkMIo6Hg1lNVi3A1ZObf4CQHJl6UCYQMKV0W7FH+UMZAd6Bd2J jIWg== X-Gm-Message-State: AOAM530HEmd4aN8UhHZjZnrTkEcLbyEcfQL0Uqlp07ARIOVQX5y+rN4u sCpkTFu4czFxo1l4HjlV2tA= X-Received: by 2002:a37:8a01:: with SMTP id m1mr20849260qkd.85.1619487449477; Mon, 26 Apr 2021 18:37:29 -0700 (PDT) Received: from balhae.roam.corp.google.com ([50.238.223.130]) by smtp.gmail.com with ESMTPSA id q67sm1858622qkb.89.2021.04.26.18.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 18:37:29 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Andi Kleen , Ian Rogers Subject: [PATCH v2 5/6] perf report: Make --skip-empty as default Date: Mon, 26 Apr 2021 18:37:16 -0700 Message-Id: <20210427013717.1651674-6-namhyung@kernel.org> X-Mailer: git-send-email 2.31.1.527.g47e6f16901-goog In-Reply-To: <20210427013717.1651674-1-namhyung@kernel.org> References: <20210427013717.1651674-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org so that the compact output is shown by default. Also add 'report.skip-empty' config option to override the default. Users can also use --no-skip-empty command line option to change the behavior anytime. Signed-off-by: Namhyung Kim --- tools/perf/Documentation/perf-config.txt | 5 +++++ tools/perf/builtin-report.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 154a1ced72b2..b0872c801866 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -123,6 +123,7 @@ Example queue-size = 0 children = true group = true + skip-empty = true [llvm] dump-obj = true @@ -531,6 +532,10 @@ Variables 0.07% 0.00% noploop ld-2.15.so [.] strcmp 0.03% 0.00% noploop [kernel.kallsyms] [k] timerqueue_del + report.skip-empty:: + This option can change default stat behavior with empty results. + If it's set true, 'perf report --stat' will not show 0 stats. + top.*:: top.children:: Same as 'report.children'. So if it is enabled, the output of 'top' diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 4910194acaa6..36f9ccfeb38a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -136,6 +136,11 @@ static int report__config(const char *var, const char *value, void *cb) return 0; } + if (!strcmp(var, "report.skip-empty")) { + rep->skip_empty = perf_config_bool(var, value); + return 0; + } + return 0; } @@ -1160,6 +1165,7 @@ int cmd_report(int argc, const char **argv) .pretty_printing_style = "normal", .socket_filter = -1, .annotation_opts = annotation__default_options, + .skip_empty = true, }; const struct option options[] = { OPT_STRING('i', "input", &input_name, "file", -- 2.31.1.527.g47e6f16901-goog