perf bench: Fix two numa NDEBUG warnings
Ian Rogers
reviewerPATCH 1/2 perf bench: Fix two numa NDEBUG warnings
BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields:
bench/numa.c: In function ‘bind_to_cpu’:bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
314 | }
| ^
bench/numa.c: In function ‘bind_to_node’:
bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type]
367 | }
| ^Add return statements to cover this case.
--- tools/perf/bench/numa.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/bench/numa.c +2 -0
@@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static cpu_set_t *bind_to_node (int target_node)
@@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static void bind_to_cpumask (cpu_set_t *mask)
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
Ian Rogers
reviewerPATCH 2/2 perf vendor events intel: Add cpuid for sapphirerapids
Fixes compile time warnings:
pmu-events/pmu-events.c:27238:31: error: ‘pme_sapphirerapids’ defined but not used [-Werror=unused-const-variable=]
27238 | static const struct pmu_event pme_sapphirerapids[] = {
| ^~~~~~~~~~~~~~~~~~--- tools/perf/pmu-events/arch/x86/mapfile.csv | 1 + 1 file changed, 1 insertion(+)
tools/perf/pmu-events/arch/x86/mapfile.csv +1 -0
@@ -41,6 +41,7 @@ GenuineIntel-6-A7,v1,icelake,core GenuineIntel-6-6A,v1,icelakex,core GenuineIntel-6-6C,v1,icelakex,core GenuineIntel-6-86,v1,tremontx,core +GenuineIntel-6-8F,v1,sapphirerapids,core GenuineIntel-6-96,v1,elkhartlake,core GenuineIntel-6-97,v1,alderlake,core GenuineIntel-6-9A,v1,alderlake,core
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
Re: [PATCH 2/2] perf vendor events intel: Add cpuid for sapphirerapids
Quoted 16 lines · Ian Rogers
Fixes compile time warnings:
pmu-events/pmu-events.c:27238:31: error: ‘pme_sapphirerapids’ defined but not used [-Werror=unused-const-variable=]27238 | static const struct pmu_event pme_sapphirerapids[] = { | ^~~~~~~~~~~~~~~~~~Signed-off-by Ian Rogers <[email protected]>--- tools/perf/pmu-events/arch/x86/mapfile.csv | 1 + 1 file changed, 1 insertion(+)tools/perf/pmu-events/arch/x86/mapfile.csv +0
-0
tools/perf/pmu-events/arch/x86/mapfile.csv GenuineIntel-6-A7,v1,icelake,core · line 44
Quoted 4 lines
tools/perf/pmu-events/arch/x86/mapfile.csv +1
-0@@ -41,6 +41,7 @@ GenuineIntel-6-A7,v1,icelake,core GenuineIntel-6-6A,v1,icelakex,core GenuineIntel-6-6C,v1,icelakex,core GenuineIntel-6-86,v1,tremontx,core +GenuineIntel-6-8F,v1,sapphirerapids,core
In https://lore.kernel.org/all/[email protected]/, it has already added the cpuid for sapphirerapids
Quoted 3 lines
tools/perf/pmu-events/arch/x86/mapfile.csv +0
-0GenuineIntel-6-96,v1,elkhartlake,core GenuineIntel-6-97,v1,alderlake,core GenuineIntel-6-9A,v1,alderlake,core
Signature · 1 line
Zhengjun Xing
Quoted 10 lines · Ian Rogers
BUG_ONis a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields:
bench/numa.c: In function ‘bind_to_cpu’:bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
314 | }
Quoted 7 lines
| ^ bench/numa.c: In function ‘bind_to_node’: bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type] 367 | } | ^Add return statements to cover this case.
Looks fine to me
Thanks
Athira
Quoted 29 lines
Signed-off-by Ian Rogers <[email protected]>---
tools/perf/bench/numa.c| 2 ++1 file changed, 2 insertions(+)tools/perf/bench/numa.c +2
-0@@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static cpu_set_t *bind_to_node (int target_node)@@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static void bind_to_cpumask (cpu_set_t *mask)Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
Ian Rogers
reviewerQuoted 17 lines · Athira Rajeev
Quoted 17 lines · Ian Rogers
BUG_ONis a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields:
bench/numa.c: In function ‘bind_to_cpu’:bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
314 | }| ^ bench/numa.c: In function ‘bind_to_node’: bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type] 367 | } | ^
Quoted 8 lines
Quoted 1 line
Add return statements to cover this case.
Looks fine to me
Reviewed-by Athira Rajeev <[email protected]>Thanks
Athira
Thanks Athira :-) Arnaldo, could we get this in the 5th batch for 5.18 to keep NDEBUG building? It looks like there is a missing build test for NDEBUG too.
Thanks,
Ian
Quoted 30 lines
Quoted 29 lines
Signed-off-by Ian Rogers <[email protected]>---
tools/perf/bench/numa.c| 2 ++1 file changed, 2 insertions(+)tools/perf/bench/numa.c +2
-1@@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static cpu_set_t *bind_to_node (int target_node)@@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)/* BUG_ON due to failure in allocation of orig_mask/mask */ BUG_ON (-1 ); +return NULL ; }static void bind_to_cpumask (cpu_set_t *mask) --2.36.0.464.gb9c8b46e94-goog
Em Fri, Apr 29, 2022 at 06:58:22PM -0700, Ian Rogers escreveu:
Quoted 23 lines
Quoted 21 lines · Athira Rajeev
Quoted 11 lines · Ian Rogers
BUG_ONis a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields:
bench/numa.c: In function ‘bind_to_cpu’:bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
314 | }Quoted 7 lines
| ^ bench/numa.c: In function ‘bind_to_node’: bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type] 367 | } | ^Add return statements to cover this case.
Looks fine to me
Quoted 8 lines
Quoted 4 lines
Reviewed-by Athira Rajeev <[email protected]>Thanks
AthiraThanks Athira :-) Arnaldo, could we get this in the 5th batch for 5.18 to keep NDEBUG building? It looks like there is a missing build test for NDEBUG too.
Applied to perf/urgent.
Thanks,
- Arnaldo