summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorMaynard Johnson <maynardj@us.ibm.com>2009-04-01 15:26:25 -0500
committerJosh Stone <jistone@redhat.com>2009-04-01 16:41:45 -0700
commit3598cf014bdeab592a365f570664ae970714985d (patch)
tree227eee21598c1644a43a985463cb35c93091db54 /tapsets.cxx
parentf3921e808cc95592308727d011d7718f053008e2 (diff)
downloadsystemtap-steved-3598cf014bdeab592a365f570664ae970714985d.tar.gz
systemtap-steved-3598cf014bdeab592a365f570664ae970714985d.tar.xz
systemtap-steved-3598cf014bdeab592a365f570664ae970714985d.zip
Fix for insn probe: Call arch_has_*_step() prior to calling utrace_control
The attached patch is version 2 for the problem I reported earlier today. Frank, is this more what you had in mind? With this patch, there's no need for the user to look at the system log. Error messages are sent to stderr: ERROR: insn probe init: arch does not support block step mode ERROR: probe process("/test").function("doit1@/test.c:22").return registration error (rc -1) -Maynard
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 352930ee..1b55684b 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -6570,6 +6570,22 @@ itrace_derived_probe_group::emit_module_init (systemtap_session& s)
s.op->newline() << "for (i=0; i<" << num_probes << "; i++) {";
s.op->indent(1);
s.op->newline() << "struct stap_itrace_probe *p = &stap_itrace_probes[i];";
+
+ // 'arch_has_single_step' needs to be defined for either single step mode
+ // or branch mode.
+ s.op->newline() << "if (!arch_has_single_step()) {";
+ s.op->indent(1);
+ s.op->newline() << "_stp_error (\"insn probe init: arch does not support step mode\");";
+ s.op->newline() << "rc = -EPERM;";
+ s.op->newline() << "break;";
+ s.op->newline(-1) << "}";
+ s.op->newline() << "if (!p->single_step && !arch_has_block_step()) {";
+ s.op->indent(1);
+ s.op->newline() << "_stp_error (\"insn probe init: arch does not support block step mode\");";
+ s.op->newline() << "rc = -EPERM;";
+ s.op->newline() << "break;";
+ s.op->newline(-1) << "}";
+
s.op->newline() << "rc = stap_register_task_finder_target(&p->tgt);";
s.op->newline(-1) << "}";
}