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

From: Prashanth Nageshappa
Date: Thu Apr 12 2012 - 05:30:16 EST


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@xxxxxxxxxxxxxxxxxx>
---

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;
}
insn->immediate2.value = get_next(unsigned short, insn);
insn->immediate2.nbytes = 2;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/