Skip to contentSkip to conversation

perf print_insn: Include sys/types.h for ssize_t

PATCH Applied Florian Fainelli 4 participants 4 messages Oct 26 – Oct 27 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf print_insn: Include sys/types.h for ssize_t

print_insn.h declares fprintf_insn_asm() with an ssize_t return type but does not include the header defining that type. This causes builds where stdio.h does not provide ssize_t to fail when compiling util/print_insn.c:

util/print_insn.h:21:1: error: unknown type name 'ssize_t'

Include sys/types.h so the header provides its own dependency for ssize_t.

Fixes 218c200f677d ("perf script: Consolidate capstone print functions")
---
 tools/perf/util/print_insn.h | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/print_insn.h +1 -0
index cefa5c5f246e..3de9438af9cd 100644
@@ -4,6 +4,7 @@
 
 #include <stddef.h>
 #include <stdio.h>
+#include <sys/types.h>
 
 #include <linux/types.h>
 
Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 10 lines

print_insn.h declares fprintf_insn_asm() with an ssize_t return type but does not include the header defining that type. This causes builds where stdio.h does not provide ssize_t to fail when compiling util/print_insn.c:

util/print_insn.h:21:1: error: unknown type name 'ssize_t'

Include sys/types.h so the header provides its own dependency for ssize_t.

Fixes 218c200f677d ("perf script: Consolidate capstone print functions")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Florian Fainelli
Quoted 19 lines · Florian Fainelli

print_insn.h declares fprintf_insn_asm() with an ssize_t return type but does not include the header defining that type. This causes builds where stdio.h does not provide ssize_t to fail when compiling util/print_insn.c:

util/print_insn.h:21:1: error: unknown type name 'ssize_t'

Include sys/types.h so the header provides its own dependency for ssize_t.

Fixes 218c200f677d ("perf script: Consolidate capstone print functions")
---
  tools/perf/util/print_insn.h | 1 +
  1 file changed, 1 insertion(+)
tools/perf/util/print_insn.h +0 -0
index cefa5c5f246e..3de9438af9cd 100644

tools/perf/util/print_insn.h line 10

Quoted 7 lines
tools/perf/util/print_insn.h +1 -0
@@ -4,6 +4,7 @@
 
  #include <stddef.h>
  #include <stdio.h>
+#include <sys/types.h>
 
  #include <linux/types.h>
 
maintainer Applied
#3 lore raw
Quoted 9 lines · James Clark

tools/perf/util/print_insn.h line 7

Quoted 6 lines · Florian Fainelli

+++ b/tools/perf/util/print_insn.h

tools/perf/util/print_insn.h +1 -0
@@ -4,6 +4,7 @@
  #include <stddef.h>
  #include <stdio.h>
+#include <sys/types.h>
  #include <linux/types.h>

Thanks, applied for v7.4.

- Arnaldo