summaryrefslogtreecommitdiff
path: root/arch/arm/probes/decode.c
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2015-01-05 19:29:21 +0800
committerJon Medhurst <tixy@linaro.org>2015-01-13 16:10:06 +0000
commit6624cf651f1a14363d0385f36dc255d304ac7ebb (patch)
tree38cb38d33f5faa96e36814caa3fa63bfe322c193 /arch/arm/probes/decode.c
parent83803d97dae1eaf6850a45ef8ee179cc66e147dc (diff)
ARM: kprobes: collects stack consumption for store instructions
This patch uses the previously introduced checker functionality on store instructions to record their stack consumption information to arch_probes_insn. Signed-off-by: Wang Nan <wangnan0@huawei.com> Reviewed-by: Jon Medhurst <tixy@linaro.org> Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'arch/arm/probes/decode.c')
-rw-r--r--arch/arm/probes/decode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/probes/decode.c b/arch/arm/probes/decode.c
index c7d442018902..f9d7c423f2cc 100644
--- a/arch/arm/probes/decode.c
+++ b/arch/arm/probes/decode.c
@@ -425,6 +425,16 @@ probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
*/
probes_opcode_t origin_insn = insn;
+ /*
+ * stack_space is initialized to 0 here. Checker functions
+ * should update is value if they find this is a stack store
+ * instruction: positive value means bytes of stack usage,
+ * negitive value means unable to determine stack usage
+ * statically. For instruction doesn't store to stack, checker
+ * do nothing with it.
+ */
+ asi->stack_space = 0;
+
if (emulate)
insn = prepare_emulated_insn(insn, asi, thumb);