From 038c38c6119e29189be83c3a214c635c0d02ee58 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 6 Oct 2009 20:01:13 -0700 Subject: Remove the global derived_probe->semaphore map Instead just make the semaphore address a member of derived_probe. * session.h (systemtap_session): Remove the map sdt_semaphore_addr. * elaborate.h (derived_probe): Add sdt_semaphore_addr directly. * tapsets.cxx (sdt_query::record_semaphore): Write the addr directly. (uprobe_derived_probe_group::emit_module_decls): Read it directly. * tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Ditto --- tapsets.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 6267f314..09ead991 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3699,7 +3699,7 @@ sdt_query::record_semaphore (vector & results, unsigned start) if (dwfl_module_relocations (dw.module) > 0) dwfl_module_relocate_address (dw.module, &addr); for (unsigned i = start; i < results.size(); ++i) - sess.sdt_semaphore_addr.insert(make_pair(results[i], addr)); + results[i]->sdt_semaphore_addr = addr; } } @@ -4447,10 +4447,9 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->line() << " .pp=" << lex_cast_qstring (*p->sole_location()) << ","; s.op->line() << " .ph=&" << p->name << ","; - map::iterator its = s.sdt_semaphore_addr.find(p); - if (its != s.sdt_semaphore_addr.end()) + if (p->sdt_semaphore_addr != 0) s.op->line() << " .sdt_sem_address=(unsigned long)0x" - << hex << its->second << dec << "ULL,"; + << hex << p->sdt_semaphore_addr << dec << "ULL,"; if (p->has_return) s.op->line() << " .return_p=1,"; -- cgit From e34d5d1388d3c7817313685e3f7424ffc158474f Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 8 Oct 2009 17:36:36 -0400 Subject: PR10746: improve error message on utrace-less kernels * tapset-itrace.exp (itrace_derived_probe ctor): Fail if !CONFIG_UTRACE. * tapset-utrace.exp (utrace_derived_probe ctor): Fail if !CONFIG_UTRACE. * tapsets.cxx (dwarf_builder::build): Fail process.* if !CONFIG_UTRACE. * testsuite/semko/utrace.stp: New test. --- tapsets.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 09ead991..9aa4964f 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3882,6 +3882,9 @@ dwarf_builder::build(systemtap_session & sess, { module_name = find_executable (module_name); // canonicalize it + if (sess.kernel_config["CONFIG_UTRACE"] != string("y")) + throw semantic_error ("process probes not available without kernel CONFIG_UTRACE"); + // user-space target; we use one dwflpp instance per module name // (= program or shared library) dw = get_user_dw(sess, module_name); -- cgit