perf build: Minor cleanup
cover perf build: Minor cleanup
This series includes two minor cleanup for perf build, with using the GCC-15 (15.0.1 20250327).
Leo Yan (2):
perf build: Remove unused LIBPERF_CLFAGS
perf hist: Refine signed integer checking
tools/perf/Makefile.config | 2 -- tools/perf/ui/stdio/hist.c | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 perf build: Remove unused LIBPERF_CLFAGS
Since commit 91009a3a9913 ("perf build: Install libperf locally when building"), the LIBPERF_CFLAGS flag is never populated to libperf.
As the flag is not used anymore, remove it.
--- tools/perf/Makefile.config | 2 -- 1 file changed, 2 deletions(-)
tools/perf/Makefile.config +0 -2
@@ -389,8 +389,6 @@ CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS) CXXFLAGS += $(INC_FLAGS) -LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS) - ifeq ($(feature-pthread-attr-setaffinity-np), 1) CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP endif
Signature · 1 line
2.34.1
Re: [PATCH 1/2] perf build: Remove unused LIBPERF_CLFAGS
Quoted 7 lines · Leo Yan
Since commit
91009a3a9913("perf build: Install libperf locally when building"), theLIBPERF_CFLAGSflag is never populated to libperf.As the flag is not used anymore, remove it.
Signed-off-by Leo Yan <[email protected]>
Thanks for the cleanup!
Ian
Quoted 20 lines
--- tools/perf/Makefile.config | 2 -- 1 file changed, 2 deletions(-)tools/perf/Makefile.config +0
-3@@ -389,8 +389,6 @@ CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS) CXXFLAGS += $(INC_FLAGS) -LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS) - ifeq ($(feature-pthread-attr-setaffinity-np), 1) CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP endif --2.34.1
A message that is not in the archive (sent off-list or not yet received): CA+JHD90hqsAQn8FcwdBnzU8aPOmey76MrUkGitu9E4i2sC2bWw@mail.gmail.com
Re: [PATCH 1/2] perf build: Remove unused LIBPERF_CLFAGS
Quoted 7 lines · Arnaldo Carvalho de Melo
Quoted 2 lines · Leo Yan
Since commit
91009a3a9913("perf build: Install libperf locally when building"), theLIBPERF_CFLAGSflag is neverI'll fix the summary, should be CFLAGS,
Sure. Thanks for fixing up!
Thanks,
Leo
PATCH 2/2 perf hist: Refine signed integer checking
In reply to Leo YanTo avoid any issues caused by overflow in a signed integer, and since the limit to USHRT_MAX is not necessary, this patch simply decrements the signed integer and checks that it is greater than 0.
--- tools/perf/ui/stdio/hist.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
tools/perf/ui/stdio/hist.c +1 -5
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <linux/string.h>
@@ -25,10 +24,7 @@ static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)int i;int ret =fprintf (fp," " ); -if (left_margin >USHRT_MAX ) - left_margin =USHRT_MAX ; - -for (i =0 ; i < left_margin; i++) +for (i = left_margin; i >0 ; i--) ret +=fprintf (fp," " );return ret;
Signature · 1 line
2.34.1