perf: Fix up build failure due to bpf changes
Subsystems (2)
PATCH v2 1/1 perf: Fix up build failure due to bpf changes
Fix
util/btf.c: In function '__btf_type__find_member_by_name':util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
19 | for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
| ^
builtin-trace.c: In function 'syscall_arg__strtoul_btf_enum':
builtin-trace.c:967:27: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
967 | for (int i = 0; i < btf_vlen(bt); ++i, ++be) {
| ^
by making the variable the same type as the function.
---
v2: Fix a second error.
tools/perf/builtin-trace.c | 2 +- tools/perf/util/btf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +1 -1
@@ -964,7 +964,7 @@ static bool syscall_arg__strtoul_btf_enum(char *bf, size_t size, struct syscall_struct btf *btf = arg->trace->btf;struct btf_enum *be =btf_enum (bt); -for (int i =0 ; i <btf_vlen (bt); ++i, ++be) { +for (u32 i =0 ; i <btf_vlen (bt); ++i, ++be) {const char *name =btf__name_by_offset (btf, be->name_off);int max_len =max (size,strlen (name));
tools/perf/util/btf.c +1 -1
@@ -14,7 +14,7 @@ const struct btf_member *__btf_type__find_member_by_name(struct btf *btf, {const struct btf_type *t =btf__type_by_id (btf, type_id);const struct btf_member *m; -int i; +u32 i;for (i =0 , m =btf_members (t); i <btf_vlen (t); i++, m++) {const char *current_member_name =btf__name_by_offset (btf, m->name_off);
Signature · 1 line
2.47.3
Quoted 7 lines · Mark Brown
Fix
util/btf.c: In function '__btf_type__find_member_by_name':util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
19 | for (i = 0, m =btf_members(t); i <btf_vlen(t); i++, m++) {
| ^
Quoted 6 lines
builtin-trace.c: In function 'syscall_arg__strtoul_btf_enum':
builtin-trace.c:967:27: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
967 | for (int i = 0; i <btf_vlen(bt); ++i, ++be) {
| ^by making the variable the same type as the function.
Thanks, applied to perf-tools-next, for v7.2.
- Arnaldo
Quoted 38 lines
Signed-off-by Mark Brown <[email protected]>---
v2: Fix a second error.tools/perf/builtin-trace.c | 2 +- tools/perf/util/btf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tools/perf/builtin-trace.c +1
-1@@ -964,7 +964,7 @@ static bool syscall_arg__strtoul_btf_enum(char *bf, size_t size, struct syscall_struct btf *btf = arg->trace->btf;struct btf_enum *be =btf_enum (bt); -for (int i =0 ; i <btf_vlen (bt); ++i, ++be) { +for (u32 i =0 ; i <btf_vlen (bt); ++i, ++be) {const char *name =btf__name_by_offset (btf, be->name_off);int max_len =max (size,strlen (name));tools/perf/util/btf.c +1
-1@@ -14,7 +14,7 @@ const struct btf_member *__btf_type__find_member_by_name(struct btf *btf, {const struct btf_type *t =btf__type_by_id (btf, type_id);const struct btf_member *m; -int i; +u32 i;for (i =0 , m =btf_members (t); i <btf_vlen (t); i++, m++) {const char *current_member_name =btf__name_by_offset (btf, m->name_off);Signature · 1 line
2.47.3