File: perf-tools-fix-unwind-build-on-i386.patch

package info (click to toggle)
linux 6.17.2-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,734,084 kB
  • sloc: ansic: 26,674,600; asm: 271,176; sh: 147,222; python: 75,910; makefile: 57,291; perl: 36,942; xml: 19,562; cpp: 5,894; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 28; ruby: 25
file content (35 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (32)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 22 Jul 2017 17:37:33 +0100
Subject: perf tools: Fix unwind build on i386
Forwarded: no

EINVAL may not be defined when building unwind-libunwind.c with
REMOTE_UNWIND_LIBUNWIND, resulting in a compiler error in
LIBUNWIND__ARCH_REG_ID().  Its only caller, access_reg(), only checks
for a negative return value and doesn't care what it is.  So change
-EINVAL to -1.

Fixes: 52ffe0ff02fc ("Support x86(32-bit) cross platform callchain unwind.")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---

--- a/tools/perf/arch/x86/util/unwind-libunwind.c
+++ b/tools/perf/arch/x86/util/unwind-libunwind.c
@@ -66,7 +66,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum)
 		break;
 	default:
 		pr_err("unwind: invalid reg id %d\n", regnum);
-		return -EINVAL;
+		return -1;
 	}
 
 	return id;
@@ -106,7 +106,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum)
 		break;
 	default:
 		pr_err("unwind: invalid reg id %d\n", regnum);
-		return -EINVAL;
+		return -1;
 	}
 
 	return id;