[PATCH 1/2] perf/probe: verify instruction/offset in perf before adding a uprobe

Prashanth Nageshappa
2012-04-12T09:30:20Z

To verify instruction/offset in perf, before adding a uprobe we
need to use arc/x86/lib/insn.c from perf code. Since perf Makefile
enables -Wswitch-default flag it causes build warnings/failures. This
patch is to address the build warnings in insn.c.

Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
---

arch/x86/lib/insn.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index 25feb1a..b9e42f1 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -397,6 +397,8 @@ static void __get_moffset(struct insn *insn)
insn->moffset2.value = get_next(int, insn);
insn->moffset2.nbytes = 4;
break;
+ default:
+ break;
}
insn->moffset1.got = insn->moffset2.got = 1;

@@ -417,6 +419,8 @@ static void __get_immv32(struct insn *insn)
insn->immediate.value = get_next(int, insn);
insn->immediate.nbytes = 4;
break;
+ default:
+ break;
}

err_out:
@@ -441,6 +445,8 @@ static void __get_immv(struct insn *insn)
insn->immediate2.value = get_next(int, insn);
insn->immediate2.nbytes = 4;
break;
+ default:
+ break;
}
insn->immediate1.got = insn->immediate2.got = 1;

@@ -463,6 +469,8 @@ static void __get_immptr(struct insn *insn)
case 8:
/* ptr16:64 is not exist (no segment) */
return;
+ default:
+ break;