Skip to contentSkip to conversation

perf lock contention: Fix a build error on 32-bit

PATCH Applied Namhyung Kim 2 participants 2 messages Sep 26, 2022 – Sep 28, 2022 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf lock contention: Fix a build error on 32-bit

It was reported that it failed to build the BPF lock contention skeleton on 32 bit arch due to the size of long. The lost count is used only for reporting errors due to lack of stackmap space through bad_hist which type is 'int'. Let's use int type then.

---
 tools/perf/util/bpf_skel/lock_contention.bpf.c | 2 +-
 tools/perf/util/lock-contention.h              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/bpf_skel/lock_contention.bpf.c +1 -1
index e107d71f0f1a..1bb8628e7c9f 100644
@@ -75,7 +75,7 @@ int has_task;
 int stack_skip;
 
 /* error stat */
-unsigned long lost;
+int lost;
 
 static inline int can_record(void)
 {
tools/perf/util/lock-contention.h +1 -1
index 67db311fc9df..b8cb8830b7bc 100644
@@ -114,7 +114,7 @@ struct lock_contention {
 	struct machine *machine;
 	struct hlist_head *result;
 	unsigned long map_nr_entries;
-	unsigned long lost;
+	int lost;
 	int max_stack;
 	int stack_skip;
 };
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
maintainer Applied
#1 lore raw

Em Mon, Sep 26, 2022 at 02:56:38PM -0700, Namhyung Kim escreveu:

Quoted 4 lines

It was reported that it failed to build the BPF lock contention skeleton on 32 bit arch due to the size of long. The lost count is used only for reporting errors due to lack of stackmap space through bad_hist which type is 'int'. Let's use int type then.

Thanks, applied.

- Arnaldo

Quoted 35 lines
---
 tools/perf/util/bpf_skel/lock_contention.bpf.c | 2 +-
 tools/perf/util/lock-contention.h              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/bpf_skel/lock_contention.bpf.c +1 -1
index e107d71f0f1a..1bb8628e7c9f 100644
@@ -75,7 +75,7 @@ int has_task;
 int stack_skip;
 
 /* error stat */
-unsigned long lost;
+int lost;
 
 static inline int can_record(void)
 {
tools/perf/util/lock-contention.h +1 -1
index 67db311fc9df..b8cb8830b7bc 100644
@@ -114,7 +114,7 @@ struct lock_contention {
 	struct machine *machine;
 	struct hlist_head *result;
 	unsigned long map_nr_entries;
-	unsigned long lost;
+	int lost;
 	int max_stack;
 	int stack_skip;
 };
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
Signature · 1 line
- Arnaldo