linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: perf/urgent] perf diff: Use llabs() with 64-bit values
       [not found] <tip-pn7szy5uw384ntjgk6zckh6a@git.kernel.org>
  2019-11-29  6:02 ` [tip: perf/urgent] perf diff: Use llabs() with 64-bit values tip-bot2 for Arnaldo Carvalho de Melo
@ 2019-11-29  6:02 ` tip-bot2 for Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 2+ messages in thread
From: tip-bot2 for Arnaldo Carvalho de Melo @ 2019-11-29  6:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Jin Yao, Adrian Hunter, Jiri Olsa, Namhyung Kim,
	Arnaldo Carvalho de Melo, x86, LKML

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     98e93245113d0f5c279ef77f4a9e7d097323ad71
Gitweb:        https://git.kernel.org/tip/98e93245113d0f5c279ef77f4a9e7d097323ad71
Author:        Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate:    Wed, 27 Nov 2019 09:58:22 -03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Thu, 28 Nov 2019 08:08:37 -03:00

perf diff: Use llabs() with 64-bit values

To fix these build errors on a debian mipsel cross build environment:

  builtin-diff.c: In function 'block_cycles_diff_cmp':
  builtin-diff.c:550:6: error: absolute value function 'labs' given an argument of type 's64' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
    550 |  l = labs(left->diff.cycles);
        |      ^~~~
  builtin-diff.c:551:6: error: absolute value function 'labs' given an argument of type 's64' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
    551 |  r = labs(right->diff.cycles);
        |      ^~~~

Fixes: 99150a1faab2 ("perf diff: Use hists to manage basic blocks per symbol")
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-pn7szy5uw384ntjgk6zckh6a@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-diff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 376dbf1..eae8793 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -547,8 +547,8 @@ static int64_t block_cycles_diff_cmp(struct hist_entry *left,
 	if (!pairs_left && !pairs_right)
 		return 0;
 
-	l = labs(left->diff.cycles);
-	r = labs(right->diff.cycles);
+	l = llabs(left->diff.cycles);
+	r = llabs(right->diff.cycles);
 	return r - l;
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: perf/urgent] perf diff: Use llabs() with 64-bit values
       [not found] <tip-pn7szy5uw384ntjgk6zckh6a@git.kernel.org>
@ 2019-11-29  6:02 ` tip-bot2 for Arnaldo Carvalho de Melo
  2019-11-29  6:02 ` tip-bot2 for Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 2+ messages in thread
From: tip-bot2 for Arnaldo Carvalho de Melo @ 2019-11-29  6:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Jin Yao, Adrian Hunter, Jiri Olsa, Namhyung Kim,
	Arnaldo Carvalho de Melo, x86, LKML

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     2b1ac6403f8800babed0f16ab1d29ee3300be122
Gitweb:        https://git.kernel.org/tip/2b1ac6403f8800babed0f16ab1d29ee3300be122
Author:        Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate:    Wed, 27 Nov 2019 09:58:22 -03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Thu, 28 Nov 2019 08:08:38 -03:00

perf diff: Use llabs() with 64-bit values

To fix this build error on a debian mipsel cross build environment:

  builtin-diff.c: In function 'compute_cycles_diff':
  builtin-diff.c:649:10: error: absolute value function 'labs' given an argument of type 's64' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
    649 |    val = labs(pair->block_info->cycles_spark[i] -
        |          ^~~~

Fixes: cebf7d51a6c3 ("perf diff: Report noisy for cycles diff")
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-pn7szy5uw384ntjgk6zckh6a@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index eae8793..f8b6ae5 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -646,7 +646,7 @@ static void compute_cycles_diff(struct hist_entry *he,
 			if (i >= he->block_info->num || i >= NUM_SPARKS)
 				break;
 
-			val = labs(pair->block_info->cycles_spark[i] -
+			val = llabs(pair->block_info->cycles_spark[i] -
 				     he->block_info->cycles_spark[i]);
 
 			update_spark_value(pair->diff.svals, NUM_SPARKS,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-29  6:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tip-pn7szy5uw384ntjgk6zckh6a@git.kernel.org>
2019-11-29  6:02 ` [tip: perf/urgent] perf diff: Use llabs() with 64-bit values tip-bot2 for Arnaldo Carvalho de Melo
2019-11-29  6:02 ` tip-bot2 for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).