All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, acme@redhat.com, a.p.zijlstra@chello.nl,
	treeze.taeung@gmail.com, tglx@linutronix.de, jolsa@kernel.org,
	linux-kernel@vger.kernel.org, namhyung@kernel.org,
	mingo@kernel.org
Subject: [tip:perf/core] perf diff: Add diff.order config option
Date: Mon, 13 Feb 2017 22:38:35 -0800	[thread overview]
Message-ID: <tip-d49dd15d69731589de4436a6dcfca59567320fdf@git.kernel.org> (raw)
In-Reply-To: <20170210073614.24584-3-namhyung@kernel.org>

Commit-ID:  d49dd15d69731589de4436a6dcfca59567320fdf
Gitweb:     http://git.kernel.org/tip/d49dd15d69731589de4436a6dcfca59567320fdf
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Fri, 10 Feb 2017 16:36:12 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 13 Feb 2017 14:29:37 -0300

perf diff: Add diff.order config option

In many cases, I need to look at differences between two data so I often
used the -o option to sort the result base on the difference first.
It'd be nice to have a config option to set it by default.

The diff.order config option is to set the default value of -o/--order
option.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Taeung Song <treeze.taeung@gmail.com>
Link: http://lkml.kernel.org/r/20170210073614.24584-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-config.txt |  7 +++++++
 tools/perf/Documentation/perf-diff.txt   |  6 +++++-
 tools/perf/builtin-diff.c                | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 9365b75..49ab79d 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -498,6 +498,13 @@ record.*::
 		But if this option is 'no-cache', it will not update the build-id cache.
 		'skip' skips post-processing and does not update the cache.
 
+diff.*::
+	diff.order::
+		This option sets the number of columns to sort the result.
+		The default is 0, which means sorting by baseline.
+		Setting it to 1 will sort the result by delta (or other
+		compute method selected).
+
 SEE ALSO
 --------
 linkperf:perf[1]
diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt
index af80284..7c014c9 100644
--- a/tools/perf/Documentation/perf-diff.txt
+++ b/tools/perf/Documentation/perf-diff.txt
@@ -99,7 +99,11 @@ OPTIONS
 
 -o::
 --order::
-       Specify compute sorting column number.
+       Specify compute sorting column number.  0 means sorting by baseline
+       overhead (default) and 1 means sorting by computed value of column 1
+       (data from the first file other base baseline).  Values more than 1
+       can be used only if enough data files are provided.
+       The default value can be set using the diff.order config option.
 
 --percentage::
 	Determine how to display the overhead percentage of filtered entries.
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 781c9e6..181ff99 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -17,6 +17,7 @@
 #include "util/symbol.h"
 #include "util/util.h"
 #include "util/data.h"
+#include "util/config.h"
 
 #include <stdlib.h>
 #include <math.h>
@@ -1291,6 +1292,17 @@ static int data_init(int argc, const char **argv)
 	return 0;
 }
 
+static int diff__config(const char *var, const char *value,
+			void *cb __maybe_unused)
+{
+	if (!strcmp(var, "diff.order")) {
+		sort_compute = perf_config_int(var, value);
+		return 0;
+	}
+
+	return 0;
+}
+
 int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
 {
 	int ret = hists__init();
@@ -1298,6 +1310,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (ret < 0)
 		return ret;
 
+	perf_config(diff__config, NULL);
+
 	argc = parse_options(argc, argv, options, diff_usage, 0);
 
 	if (symbol__init(NULL) < 0)

  reply	other threads:[~2017-02-14  6:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10  7:36 [PATCHSET 0/4] perf diff: Introduce delta-abs compute method (v2) Namhyung Kim
2017-02-10  7:36 ` [PATCH v2 1/4] perf diff: Add 'delta-abs' compute method Namhyung Kim
2017-02-14  6:38   ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-02-10  7:36 ` [PATCH v2 2/4] perf diff: Add diff.order config option Namhyung Kim
2017-02-14  6:38   ` tip-bot for Namhyung Kim [this message]
2017-02-10  7:36 ` [PATCH v2 3/4] perf diff: Add diff.compute " Namhyung Kim
2017-02-14  6:39   ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-02-10  7:36 ` [PATCH v2 4/4] perf diff: Change default setting to "delta-abs" Namhyung Kim
2017-02-10 16:18   ` [PATCH v2.1 " Namhyung Kim
2017-02-14  6:39     ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-02-10  7:41 ` [PATCHSET 0/4] perf diff: Introduce delta-abs compute method (v2) Ingo Molnar
2017-02-10  9:14   ` Namhyung Kim
2017-02-10 10:29     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-d49dd15d69731589de4436a6dcfca59567320fdf@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=treeze.taeung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.