diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | configure | 24 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | hash.cxx | 5 | ||||
-rw-r--r-- | initscript/.gitignore | 1 | ||||
-rw-r--r-- | main.cxx | 1 | ||||
-rw-r--r-- | nsscommon.c | 15 | ||||
-rw-r--r-- | runtime/map.c | 21 | ||||
-rw-r--r-- | runtime/staprun/modverify.c | 5 | ||||
-rw-r--r-- | session.h | 25 | ||||
-rw-r--r-- | stapfuncs.3stap.in | 8 | ||||
-rw-r--r-- | stapprobes.3stap.in | 11 | ||||
-rw-r--r-- | systemtap.spec | 7 | ||||
-rw-r--r-- | tapsets.cxx | 69 | ||||
-rw-r--r-- | testsuite/.gitignore | 3 | ||||
-rwxr-xr-x | testsuite/buildok/seventeen.stp | 9 | ||||
-rwxr-xr-x | testsuite/configure | 20 | ||||
-rw-r--r-- | testsuite/configure.ac | 2 | ||||
-rw-r--r-- | testsuite/lib/systemtap.exp | 15 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt_types.c | 168 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt_types.stp | 371 | ||||
-rw-r--r-- | testsuite/systemtap.base/static_uprobes.exp | 47 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/tcp.stp | 2 | ||||
-rw-r--r-- | translate.cxx | 7 |
25 files changed, 733 insertions, 112 deletions
@@ -9,7 +9,8 @@ gmon.out config.h config.log config.status -*.[158] +*.[18] +*.3stap .deps loc2c-test run-stap @@ -1,4 +1,4 @@ -* What's new +* What's new in version 0.9.5 - New probes process().insn and process().insn.block that allows inspection of the process after each instruction or block of @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for systemtap 0.9. +# Generated by GNU Autoconf 2.61 for systemtap 0.9.5. # # Report bugs to <systemtap@sources.redhat.com>. # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='systemtap 0.9' +PACKAGE_VERSION='0.9.5' +PACKAGE_STRING='systemtap 0.9.5' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' # Factoring default headers for most tests. @@ -1254,7 +1254,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures systemtap 0.9 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1320,7 +1320,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9:";; + short | recursive ) echo "Configuration of systemtap 0.9.5:";; esac cat <<\_ACEOF @@ -1435,7 +1435,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9 +systemtap configure 0.9.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1449,7 +1449,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by systemtap $as_me 0.9, which was +It was created by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2141,7 +2141,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9' + VERSION='0.9.5' cat >>confdefs.h <<_ACEOF @@ -6496,8 +6496,8 @@ echo "${ECHO_T}no" >&6; } fi if test "$enable_refdocs" == "yes"; then if test "x${have_xmlto}${have_xmlto_pdf}" != "xyesyes"; then - { { echo "$as_me:$LINENO: error: cannot find proper yxmlto for building reference documentation" >&5 -echo "$as_me: error: cannot find proper yxmlto for building reference documentation" >&2;} + { { echo "$as_me:$LINENO: error: cannot find proper xmlto for building reference documentation" >&5 +echo "$as_me: error: cannot find proper xmlto for building reference documentation" >&2;} { (exit 1); exit 1; }; } fi fi @@ -8355,7 +8355,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by systemtap $as_me 0.9, which was +This file was extended by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8408,7 +8408,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -systemtap config.status 0.9 +systemtap config.status 0.9.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index c439cd54..0c6a43d1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl configure.ac --- autoconf input file for systemtap dnl Process this file with autoconf to produce a configure script. -AC_INIT([systemtap], 0.9, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.5, systemtap@sources.redhat.com, systemtap) dnl ^^^^^ see also NEWS, systemtap.spec, testsuite/configure.ac AC_PREREQ(2.59) @@ -208,7 +208,7 @@ EOF fi if test "$enable_refdocs" == "yes"; then if test "x${have_xmlto}${have_xmlto_pdf}" != "xyesyes"; then - AC_MSG_ERROR([cannot find proper yxmlto for building reference documentation]) + AC_MSG_ERROR([cannot find proper xmlto for building reference documentation]) fi fi if test "x${have_xmlto}${have_xmlto_pdf}" == "xyesyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then @@ -97,7 +97,10 @@ get_base_hash (systemtap_session& s, hash& h) // If the kernel is a git working directory, then add the git HEAD // revision to our hash as well. - h.add(git_revision(s.kernel_build_tree)); + // XXX avoiding this for now, because it's potentially expensive and has + // uncertain gain. The only corner case that this may help is if a developer + // is switching the source tree without rebuilding the kernel... + ///h.add(git_revision(s.kernel_build_tree)); // Hash runtime path (that gets added in as "-R path"). h.add(s.runtime_path); diff --git a/initscript/.gitignore b/initscript/.gitignore new file mode 100644 index 00000000..ec0530ab --- /dev/null +++ b/initscript/.gitignore @@ -0,0 +1 @@ +systemtap @@ -380,6 +380,7 @@ main (int argc, char * const argv []) s.ignore_vmlinux = false; s.ignore_dwarf = false; s.load_only = false; + s.skip_badvars = false; const char* s_p = getenv ("SYSTEMTAP_TAPSET"); if (s_p != NULL) diff --git a/nsscommon.c b/nsscommon.c index 1837969f..0a90b963 100644 --- a/nsscommon.c +++ b/nsscommon.c @@ -53,20 +53,23 @@ nssError (void) /* Otherwise handle common errors ourselves. */ switch (errorNumber) { - case SEC_ERROR_CA_CERT_INVALID: - fputs ("The issuer's certificate is invalid.\n", stderr); + case PR_CONNECT_RESET_ERROR: + fputs ("Connection reset by peer.\n", stderr); break; case SEC_ERROR_BAD_DATABASE: fputs ("The specified certificate database does not exist or is not valid.\n", stderr); break; + case SEC_ERROR_BAD_SIGNATURE: + fputs ("Certificate does not match the signature.\n", stderr); + break; + case SEC_ERROR_CA_CERT_INVALID: + fputs ("The issuer's certificate is invalid.\n", stderr); + break; case SSL_ERROR_BAD_CERT_DOMAIN: fputs ("The requested domain name does not match the server's certificate.\n", stderr); break; - case PR_CONNECT_RESET_ERROR: - fputs ("Connection reset by peer.\n", stderr); - break; default: - fputs ("Unknown NSS error.\n", stderr); + fprintf (stderr, "Unknown NSS error: %d.\n", errorNumber); break; } } diff --git a/runtime/map.c b/runtime/map.c index de25d6f3..190ba91b 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -38,27 +38,16 @@ static int int64_eq_p (int64_t key1, int64_t key2) static void str_copy(char *dest, char *src) { - int len = 0; - if (src) { - len = strlen(src); - if (len > MAP_STRING_LENGTH - 1) - len = MAP_STRING_LENGTH - 1; - memcpy (dest, src, len); - } - dest[len] = 0; + if (src) + strlcpy(dest, src, MAP_STRING_LENGTH); + else + *dest = 0; } static void str_add(void *dest, char *val) { char *dst = (char *)dest; - int len = strlen(val); - int len1 = strlen(dst); - int num = MAP_STRING_LENGTH - 1 - len1; - - if (len > num) - len = num; - memcpy (&dst[len1], val, len); - dst[len + len1] = 0; + strlcat(dst, val, MAP_STRING_LENGTH); } static int str_eq_p (char *key1, char *key2) diff --git a/runtime/staprun/modverify.c b/runtime/staprun/modverify.c index b897d266..688734c0 100644 --- a/runtime/staprun/modverify.c +++ b/runtime/staprun/modverify.c @@ -149,8 +149,11 @@ verify_it (const char *inputName, const char *signatureName, SECKEYPublicKey *pu /* Complete the verification. */ secStatus = VFY_End (vfy); - if (secStatus != SECSuccess) + if (secStatus != SECSuccess) { + fprintf (stderr, "Unable to verify signed module %s. It may have been altered since it was created.\n", inputName); + nssError (); return 0; + } return 1; } @@ -74,8 +74,9 @@ struct statistic_decl struct systemtap_session { systemtap_session (); - // NB: new POD members likely need to be explicitly cleared in the ctor. - // See elaborate.cxx. + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). // command line args std::vector<std::string> include_path; @@ -113,6 +114,10 @@ struct systemtap_session bool need_uprobes; bool load_only; // flight recorder mode + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). + // Cache data bool use_cache; std::string cache_path; @@ -129,6 +134,10 @@ struct systemtap_session // Skip bad $ vars bool skip_badvars; + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). + // temporary directory for module builds etc. // hazardous - it is "rm -rf"'d at exit std::string tmpdir; @@ -173,8 +182,10 @@ struct systemtap_session hrtimer_derived_probe_group* hrtimer_derived_probes; perfmon_derived_probe_group* perfmon_derived_probes; procfs_derived_probe_group* procfs_derived_probes; + // NB: It is very important for all of the above (and below) fields - // to be cleared in the systemtap_session ctor (elaborate.cxx). + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). // unparser data translator_output* op; @@ -190,6 +201,10 @@ struct systemtap_session std::set<std::string> unwindsym_modules; struct module_cache* module_cache; + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). + std::set<std::string> seen_errors; std::set<std::string> seen_warnings; unsigned num_errors () { return seen_errors.size(); } @@ -201,7 +216,9 @@ struct systemtap_session void print_error_source (std::ostream&, std::string&, const token* tok); void print_warning (const std::string& w, const token* tok = 0); - // reNB: new POD members likely need to be explicitly cleared in the ctor. + // NB: It is very important for all of the above (and below) fields + // to be cleared in the systemtap_session ctor (elaborate.cxx) + // and/or main.cxx(main). }; diff --git a/stapfuncs.3stap.in b/stapfuncs.3stap.in index 1f2955da..ccc87b1d 100644 --- a/stapfuncs.3stap.in +++ b/stapfuncs.3stap.in @@ -346,6 +346,14 @@ Return the number of open file handles for the given task. task_max_file_handles:long(task:long) Return the maximum number of file handles for the given task. +.TP +pid2task:long(pid:long) +Return the task of the given process id. + +.TP +pid2execname:string(pid:long) +Return the name of the given process id. + .SS CPU REGISTERS .TP registers_valid:long () diff --git a/stapprobes.3stap.in b/stapprobes.3stap.in index f175e6e0..a8988c71 100644 --- a/stapprobes.3stap.in +++ b/stapprobes.3stap.in @@ -49,12 +49,16 @@ including alias's body is skipped. The condition is stacked up through all levels of alias/wildcard expansion. So the final condition becomes the logical-and of conditions of all expanded alias/wildcard. -These are all syntactically valid probe points: +These are all +.B syntactically +valid probe points. (They are generally +.B semantically +invalid, depending on the contents of the tapsets, and the versions of +kernel/user software installed.) .SAMPLE kernel.function("foo").return -syscall(22) -user.inode("/bin/vi").statement(0x2222) +process("/bin/vi").statement(0x2222) end syscall.* kernel.function("no_such_function") ? @@ -62,6 +66,7 @@ module("awol").function("no_such_function") ! signal.*? if (switch) .ESAMPLE + Probes may be broadly classified into "synchronous" and "asynchronous". A "synchronous" event is deemed to occur when any processor executes an instruction matched by the specification. This diff --git a/systemtap.spec b/systemtap.spec index 9dbfb371..3ef7485b 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -6,8 +6,8 @@ %{!?pie_supported: %define pie_supported 1} Name: systemtap -Version: 0.9 -Release: 3%{?dist} +Version: 0.9.5 +Release: 1%{?dist} # for version, see also configure.ac Summary: Instrumentation System Group: Development/System @@ -328,6 +328,9 @@ exit 0 %changelog +* Fri Mar 27 2009 Josh Stone <jistone@redhat.com> - 0.9.5-1 +- Upstream release. + * Wed Mar 18 2009 Will Cohen <wcohen@redhat.com> - 0.9-2 - Add location of man pages. diff --git a/tapsets.cxx b/tapsets.cxx index c36a1aa0..690d7e28 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1040,7 +1040,10 @@ struct dwflpp off = dwfl_getmodules (dwfl, callback, data, off); } while (off > 0); - dwfl_assert("dwfl_getmodules", off == 0); + // Don't complain if we exited dwfl_getmodules early. + // This could be a $target variable error that will be + // reported soon anyway. + // dwfl_assert("dwfl_getmodules", off == 0); // PR6864 XXX: For dwarfless case (if .../vmlinux is missing), then the // "kernel" module is not reported in the loop above. However, we @@ -1699,15 +1702,25 @@ struct dwflpp // relocatable module probing code will need to have. Dwfl_Module *mod = dwfl_addrmodule (dwfl, address); dwfl_assert ("dwfl_addrmodule", mod); + const char *modname = dwfl_module_info (mod, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); int n = dwfl_module_relocations (mod); dwfl_assert ("dwfl_module_relocations", n >= 0); - int i = dwfl_module_relocate_address (mod, &address); + Dwarf_Addr reloc_address = address; + int i = dwfl_module_relocate_address (mod, &reloc_address); dwfl_assert ("dwfl_module_relocate_address", i >= 0); - const char *modname = dwfl_module_info (mod, NULL, NULL, NULL, - NULL, NULL, NULL, NULL); dwfl_assert ("dwfl_module_info", modname); const char *secname = dwfl_module_relocation_info (mod, i, NULL); + if (sess.verbose > 2) + { + clog << "emit dwarf addr 0x" << hex << address << dec + << " => module " << modname + << " section " << (secname ?: "null") + << " relocaddr 0x" << hex << reloc_address << dec + << endl; + } + if (n > 0 && !(n == 1 && secname == NULL)) { dwfl_assert ("dwfl_module_relocation_info", secname); @@ -1717,7 +1730,7 @@ struct dwflpp // module, for a kernel module (or other ET_REL module object). obstack_printf (pool, "({ static unsigned long addr = 0; "); obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", - modname, secname, address); + modname, secname, reloc_address); obstack_printf (pool, "addr; })"); } else if (n == 1 && module_name == TOK_KERNEL && secname[0] == '\0') @@ -1728,7 +1741,7 @@ struct dwflpp secname = "_stext"; obstack_printf (pool, "({ static unsigned long addr = 0; "); obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", - modname, secname, address); + modname, secname, address); // PR10000 NB: not reloc_address obstack_printf (pool, "addr; })"); } else @@ -2837,6 +2850,8 @@ struct dwarf_query : public base_query bool has_absolute; + bool has_mark; + enum dbinfo_reqt dbinfo_reqt; enum dbinfo_reqt assess_dbinfo_reqt(); @@ -3088,6 +3103,7 @@ dwarf_query::dwarf_query(systemtap_session & sess, has_return = has_null_param(params, TOK_RETURN); has_maxactive = get_number_param(params, TOK_MAXACTIVE, maxactive_val); has_absolute = has_null_param(params, TOK_ABSOLUTE); + has_mark = false; if (has_function_str) spec_type = parse_function_spec(function_str_val); @@ -4032,9 +4048,9 @@ query_cu (Dwarf_Die * cudie, void * arg) } // Verify that a raw address matches the beginning of a // statement. This is a somewhat lame check that the address - // is at the start of an assembly instruction. - // Avoid for now since this thwarts a probe on a statement in a macro - if (0 && q->has_statement_num) + // is at the start of an assembly instruction. Mark probes are in the + // middle of a macro and thus not strictly at a statement beginning. + if (q->has_statement_num && ! q->has_mark) { Dwarf_Addr queryaddr = q->statement_num_val; dwarf_line_t address_line(dwarf_getsrc_die(cudie, queryaddr)); @@ -4168,16 +4184,28 @@ validate_module_elf (Dwfl_Module *mod, const char *name, base_query *q) & main_filename, & debug_filename); const string& sess_machine = q->sess.architecture; - string expect_machine; + + string expect_machine; // to match sess.machine (i.e., kernel machine) + string expect_machine2; switch (elf_machine) { - case EM_386: expect_machine = "i?86"; break; // accept e.g. i586 - case EM_X86_64: expect_machine = "x86_64"; break; - // We don't support 32-bit ppc kernels, but we support 32-bit apps - // running on ppc64 kernels. - case EM_PPC: expect_machine = "ppc64"; break; - case EM_PPC64: expect_machine = "ppc64"; break; + // x86 and ppc are bi-architecture; a 64-bit kernel + // can normally run either 32-bit or 64-bit *userspace*. + case EM_386: + expect_machine = "i?86"; + if (! q->has_process) break; // 32-bit kernel/module + /* FALLSTHROUGH */ + case EM_X86_64: + expect_machine2 = "x86_64"; + break; + case EM_PPC: + expect_machine = "ppc"; + if (! q->has_process) break; // 32-bit kernel/module + /* FALLSTHROUGH */ + case EM_PPC64: + expect_machine2 = "ppc64"; + break; case EM_S390: expect_machine = "s390x"; break; case EM_IA_64: expect_machine = "ia64"; break; case EM_ARM: expect_machine = "armv*"; break; @@ -4188,10 +4216,12 @@ validate_module_elf (Dwfl_Module *mod, const char *name, base_query *q) if (! debug_filename) debug_filename = main_filename; if (! debug_filename) debug_filename = name; - if (fnmatch (expect_machine.c_str(), sess_machine.c_str(), 0) != 0) + if (fnmatch (expect_machine.c_str(), sess_machine.c_str(), 0) != 0 && + fnmatch (expect_machine2.c_str(), sess_machine.c_str(), 0) != 0) { stringstream msg; - msg << "ELF machine " << expect_machine << " (code " << elf_machine + msg << "ELF machine " << expect_machine << "|" << expect_machine2 + << " (code " << elf_machine << ") mismatch with target " << sess_machine << " in '" << debug_filename << "'"; throw semantic_error(msg.str ()); @@ -4203,7 +4233,7 @@ validate_module_elf (Dwfl_Module *mod, const char *name, base_query *q) << "-0x" << q->dw.module_end << ", bias 0x" << q->dw.module_bias << "]" << dec << " file " << debug_filename - << " ELF machine " << expect_machine + << " ELF machine " << expect_machine << "|" << expect_machine2 << " (code " << elf_machine << ")" << "\n"; } @@ -5784,6 +5814,7 @@ dwarf_builder::build(systemtap_session & sess, location->components[1]->arg->tok = sv_tok; ((literal_map_t&)parameters)[TOK_STATEMENT] = location->components[1]->arg; dwarf_query q(sess, base, location, *dw, parameters, finished_results); + q.has_mark = true; dw->query_modules(&q); } return; diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 19b30bf1..709de57f 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -2,3 +2,6 @@ site.exp systemtap.log systemtap.sum +*.so +*_exe +*.exe.[0-9] diff --git a/testsuite/buildok/seventeen.stp b/testsuite/buildok/seventeen.stp index 126db1fb..4e0b07c4 100755 --- a/testsuite/buildok/seventeen.stp +++ b/testsuite/buildok/seventeen.stp @@ -11,3 +11,12 @@ probe kernel.function("pipe_write") printf("0x%x\n", $write_fifo_fops->llseek) %) } + +# PR10000: We're looking for *some* module function that has a nearby global variable in scope +# XXX: See PR4096 +probe module("nfs").function("nfs_create_client") !, module("nfs").function("nfs_init_client") !, + kernel.function("nfs_fsync_dir") { + println(kernel_string($nfs_program->name)) +} + +probe timer.s(5) { exit() } diff --git a/testsuite/configure b/testsuite/configure index 094f99c7..828f8006 100755 --- a/testsuite/configure +++ b/testsuite/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for systemtap 0.9. +# Generated by GNU Autoconf 2.61 for systemtap 0.9.5. # # Report bugs to <systemtap@sources.redhat.com>. # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='systemtap 0.9' +PACKAGE_VERSION='0.9.5' +PACKAGE_STRING='systemtap 0.9.5' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='SHELL @@ -1149,7 +1149,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures systemtap 0.9 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1215,7 +1215,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9:";; + short | recursive ) echo "Configuration of systemtap 0.9.5:";; esac cat <<\_ACEOF @@ -1291,7 +1291,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9 +systemtap configure 0.9.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1305,7 +1305,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by systemtap $as_me 0.9, which was +It was created by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1997,7 +1997,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9' + VERSION='0.9.5' cat >>confdefs.h <<_ACEOF @@ -2617,7 +2617,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by systemtap $as_me 0.9, which was +This file was extended by systemtap $as_me 0.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2660,7 +2660,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -systemtap config.status 0.9 +systemtap config.status 0.9.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/testsuite/configure.ac b/testsuite/configure.ac index c40fdf72..03ce3f61 100644 --- a/testsuite/configure.ac +++ b/testsuite/configure.ac @@ -1,7 +1,7 @@ dnl configure.ac --- autoconf input file for systemtap testsuite dnl Process this file with autoconf to produce a configure script. -AC_INIT([systemtap], 0.9, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.5, systemtap@sources.redhat.com, systemtap) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR(..) diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index c80ad171..554e88ed 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -148,13 +148,18 @@ proc get_system_info {} { set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT] } else { regexp {version [^)]*} [exec stap -V 2>@ stdout] version - set Snapshot $version + set Snapshot $version } set Distro "Linux" - if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]} - if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]} - if [file exists /etc/suse-release] {set Distro [exec /bin/cat /etc/suse-release]} - if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]} + if [file exists /usr/bin/lsb_release] { + # this produces one line of this format: + # Distribution:\tSTRING + set Distro [lrange [exec /usr/bin/lsb_release -d] 1 end] + } else { + foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { + if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + } + } } if {! [setup_systemtap_environment]} then { diff --git a/testsuite/systemtap.base/sdt_types.c b/testsuite/systemtap.base/sdt_types.c new file mode 100644 index 00000000..2e04ec7e --- /dev/null +++ b/testsuite/systemtap.base/sdt_types.c @@ -0,0 +1,168 @@ +#include "sdt.h" /* Really <sys/sdt.h>, but pick current source version. */ +#include <stdint.h> +#include <values.h> + +int +main (int argc, char **argv) +{ + char char_var = '~'; + STAP_PROBE1(provider,char_var,char_var); + const char const_char_var = '!'; + STAP_PROBE1(provider,const_char_var,const_char_var); + volatile char volatile_char_var = '!'; + STAP_PROBE1(provider,volatile_char_var,volatile_char_var); + char *ptr_char_var = &char_var; + STAP_PROBE2(provider,ptr_char_var,ptr_char_var,&char_var); + const char *ptr_const_char_var = &char_var; + STAP_PROBE2(provider,ptr_const_char_var,ptr_const_char_var,&char_var); + char * const char_ptr_const_var = &char_var; + STAP_PROBE2(provider,char_ptr_const_var,char_ptr_const_var,&char_var); + volatile char *ptr_volatile_char_var = &char_var; + STAP_PROBE2(provider,ptr_volatile_char_var,ptr_volatile_char_var,&char_var); + char * volatile char_ptr_volatile_var = &char_var; + STAP_PROBE2(provider,char_ptr_volatile_var,char_ptr_volatile_var,&char_var); + short int short_int_var = 32767; + STAP_PROBE1(provider,short_int_var,short_int_var); + const short int const_short_int_var = -32767; + STAP_PROBE1(provider,const_short_int_var,const_short_int_var); + volatile short int volatile_short_int_var = -32767; + STAP_PROBE1(provider,volatile_short_int_var,volatile_short_int_var); + short int *ptr_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_short_int_var,ptr_short_int_var,&short_int_var); + const short int *ptr_const_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_const_short_int_var,ptr_const_short_int_var,&short_int_var); + short int * const short_int_ptr_const_var = &short_int_var; + STAP_PROBE2(provider,short_int_ptr_const_var,short_int_ptr_const_var,&short_int_var); + volatile short int *ptr_volatile_short_int_var = &short_int_var; + STAP_PROBE2(provider,ptr_volatile_short_int_var,ptr_volatile_short_int_var,&short_int_var); + short int * volatile short_int_ptr_volatile_var = &short_int_var; + STAP_PROBE2(provider,short_int_ptr_volatile_var,short_int_ptr_volatile_var,&short_int_var); + int int_var = 65536; + STAP_PROBE1(provider,int_var,int_var); + const int const_int_var = -65536; + STAP_PROBE1(provider,const_int_var,const_int_var); + volatile int volatile_int_var = -65536; + STAP_PROBE1(provider,volatile_int_var,volatile_int_var); + int *ptr_int_var = &int_var; + STAP_PROBE2(provider,ptr_int_var,ptr_int_var,&int_var); + const int *ptr_const_int_var = &int_var; + STAP_PROBE2(provider,ptr_const_int_var,ptr_const_int_var,&int_var); + int * const int_ptr_const_var = &int_var; + STAP_PROBE2(provider,int_ptr_const_var,int_ptr_const_var,&int_var); + volatile int *ptr_volatile_int_var = &int_var; + STAP_PROBE2(provider,ptr_volatile_int_var,ptr_volatile_int_var,&int_var); + int * volatile int_ptr_volatile_var = &int_var; + STAP_PROBE2(provider,int_ptr_volatile_var,int_ptr_volatile_var,&int_var); + long int long_int_var = 65536; + STAP_PROBE1(provider,long_int_var,long_int_var); + const long int const_long_int_var = -65536; + STAP_PROBE1(provider,const_long_int_var,const_long_int_var); + volatile long int volatile_long_int_var = -65536; + STAP_PROBE1(provider,volatile_long_int_var,volatile_long_int_var); + long int *ptr_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_long_int_var,ptr_long_int_var,&long_int_var); + const long int *ptr_const_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_const_long_int_var,ptr_const_long_int_var,&long_int_var); + long int * const long_int_ptr_const_var = &long_int_var; + STAP_PROBE2(provider,long_int_ptr_const_var,long_int_ptr_const_var,&long_int_var); + volatile long int *ptr_volatile_long_int_var = &long_int_var; + STAP_PROBE2(provider,ptr_volatile_long_int_var,ptr_volatile_long_int_var,&long_int_var); + long int * volatile long_int_ptr_volatile_var = &long_int_var; + STAP_PROBE2(provider,long_int_ptr_volatile_var,long_int_ptr_volatile_var,&long_int_var); + long long int long_long_int_var = 65536; + STAP_PROBE1(provider,long_long_int_var,long_long_int_var); + const long long int const_long_long_int_var = -65536; + STAP_PROBE1(provider,const_long_long_int_var,const_long_long_int_var); + volatile long long int volatile_long_long_int_var = -65536; + STAP_PROBE1(provider,volatile_long_long_int_var,volatile_long_long_int_var); + long long int *ptr_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_long_long_int_var,ptr_long_long_int_var,&long_long_int_var); + const long long int *ptr_const_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_const_long_long_int_var,ptr_const_long_long_int_var,&long_long_int_var); + long long int * const long_long_int_ptr_const_var = &long_long_int_var; + STAP_PROBE2(provider,long_long_int_ptr_const_var,long_long_int_ptr_const_var,&long_long_int_var); + volatile long long int *ptr_volatile_long_long_int_var = &long_long_int_var; + STAP_PROBE2(provider,ptr_volatile_long_long_int_var,ptr_volatile_long_long_int_var,&long_long_int_var); + long long int * volatile long_long_int_ptr_volatile_var = &long_long_int_var; + STAP_PROBE2(provider,long_long_int_ptr_volatile_var,long_long_int_ptr_volatile_var,&long_long_int_var); + + char arr_char [2] = "!~"; + STAP_PROBE1(provider,arr_char,&arr_char); + struct { + int int_var; + } arr_struct [2] = {{ + .int_var=1, + },{ + .int_var=2, + }}; + STAP_PROBE1(provider,arr_struct,&arr_struct); + struct { + unsigned int bit1_0:1; + unsigned int bit1_1:1; + char char_2; + unsigned int bit1_6:1; + unsigned int bit1_7:1; + char char_8; + unsigned int bit1_9:1; + unsigned int bit1_10:1; + } bitfields_small_var = { + .bit1_0=1, + .bit1_1=0, + .char_2='a', + .bit1_6=1, + .bit1_7=0, + .char_8='z', + .bit1_9=1, + .bit1_10=0, + }; + STAP_PROBE8(provider,bitfields_small_var, + (int)bitfields_small_var.bit1_0, + (int)bitfields_small_var.bit1_1, + bitfields_small_var.char_2, + (int)bitfields_small_var.bit1_6, + (int)bitfields_small_var.bit1_7, + bitfields_small_var.char_8, + (int)bitfields_small_var.bit1_9, + (int)bitfields_small_var.bit1_10); + struct { + unsigned char char_0; + int bit1_4:1; + unsigned int bit1_5:1; + int bit2_6:2; + unsigned int bit2_8:2; + int bit3_10:3; + unsigned int bit3_13:3; + int bit9_16:9; + unsigned int bit9_25:9; + char char_34; + } bitfields_bit_var = { + .char_0='A', + .bit1_4=-1, + .bit1_5=1, + .bit2_6=1, + .bit2_8=3, + .bit3_10=3, + .bit3_13=7, + .bit9_16=255, + .bit9_25=511, + .char_34='Z', + }; + STAP_PROBE10(provider,bitfields_bit_var,bitfields_bit_var.char_0, + (int)bitfields_bit_var.bit1_4, + (int)bitfields_bit_var.bit1_5, + (int)bitfields_bit_var.bit2_6, + (int)bitfields_bit_var.bit2_8, + (int)bitfields_bit_var.bit3_10, + (int)bitfields_bit_var.bit3_13, + (int)bitfields_bit_var.bit9_16, + (int)bitfields_bit_var.bit9_25, + bitfields_bit_var.char_34); + enum { + red = 0, + green = 1, + blue = 2 + } primary_colors_var = green; + STAP_PROBE1(provider,primary_colors_var,primary_colors_var); + return 0; +} + diff --git a/testsuite/systemtap.base/sdt_types.stp b/testsuite/systemtap.base/sdt_types.stp new file mode 100644 index 00000000..654b0d18 --- /dev/null +++ b/testsuite/systemtap.base/sdt_types.stp @@ -0,0 +1,371 @@ +probe process(@1).mark("char_var") { + if ($arg1 != 126) + printf("FAIL: char_var\n") + else + printf("PASS: char_var\n") +} + +probe process(@1).mark("const_char_var") { + if ($arg1 != 33) + printf("FAIL: const_char_var\n") + else + printf("PASS: const_char_var\n") +} + +probe process(@1).mark("volatile_char_var") { + if ($arg1 != 33) + printf("FAIL: volatile_char_var\n") + else + printf("PASS: volatile_char_var\n") +} + +probe process(@1).mark("ptr_char_var") { + if ($arg1 != $arg2) + printf("FAIL: ptr_char_var\n") + else + printf("PASS: ptr_char_var\n") +} + +probe process(@1).mark("ptr_const_char_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_char_var\n") + else + printf("PASS: ptr_const_char_var\n") +} + +probe process(@1).mark("char_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: char_ptr_const_var\n") + else + printf("PASS: char_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_char_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_char_var\n") + else + printf("PASS: ptr_volatile_char_var\n") +} + +probe process(@1).mark("char_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: char_ptr_volatile_var\n") + else + printf("PASS: char_ptr_volatile_var\n") +} + +probe process(@1).mark("short_int_var") +{ + if ($arg1 != 32767) + printf("FAIL: short_int_var\n") + else + printf("PASS: short_int_var\n") +} + +probe process(@1).mark("const_short_int_var") +{ + if ($arg1 != -32767) + printf("FAIL: const_short_int_var\n") + else + printf("PASS: const_short_int_var\n") +} + +probe process(@1).mark("volatile_short_int_var") +{ + if ($arg1 != -32767) + printf("FAIL: volatile_short_int_var\n") + else + printf("PASS: volatile_short_int_var\n") +} + +probe process(@1).mark("ptr_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_short_int_var\n") + else + printf("PASS: ptr_short_int_var\n") +} + +probe process(@1).mark("ptr_const_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_short_int_var\n") + else + printf("PASS: ptr_const_short_int_var\n") +} + +probe process(@1).mark("short_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: short_int_ptr_const_var\n") + else + printf("PASS: short_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_short_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_short_int_var\n") + else + printf("PASS: ptr_volatile_short_int_var\n") +} + +probe process(@1).mark("short_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: short_int_ptr_volatile_var\n") + else + printf("PASS: short_int_ptr_volatile_var\n") +} + +probe process(@1).mark("int_var") +{ + if ($arg1 != 65536) + printf("FAIL: int_var") + else + printf("PASS: int_var") +} + +probe process(@1).mark("const_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_int_var\n") + else + printf("PASS: const_int_var\n") +} + +probe process(@1).mark("volatile_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_int_var\n") + else + printf("PASS: volatile_int_var\n") +} + +probe process(@1).mark("ptr_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_int_var\n") + else + printf("PASS: ptr_const_int_var\n") +} + +probe process(@1).mark("ptr_const_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_int_var\n") + else + printf("PASS: ptr_const_int_var\n") +} + +probe process(@1).mark("int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: int_ptr_const_var\n") + else + printf("PASS: int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_int_var\n") + else + printf("PASS: ptr_volatile_int_var\n") +} + +probe process(@1).mark("int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: int_ptr_volatile_var\n") + else + printf("PASS: int_ptr_volatile_var\n") +} + +probe process(@1).mark("long_int_var") +{ + if ($arg1 != 65536) + printf("FAIL: long_int_var\n") + else + printf("PASS: long_int_var\n") +} + +probe process(@1).mark("const_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_long_int_var\n") + else + printf("PASS: const_long_int_var\n") +} + +probe process(@1).mark("volatile_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_long_int_var\n") + else + printf("PASS: volatile_long_int_var\n") +} + +probe process(@1).mark("ptr_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_long_int_var\n") + else + printf("PASS: ptr_long_int_var\n") +} + +probe process(@1).mark("ptr_const_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_long_int_var\n") + else + printf("PASS: ptr_const_long_int_var\n") +} + +probe process(@1).mark("long_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_int_ptr_const_var\n") + else + printf("PASS: long_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_long_int_var\n") + else + printf("PASS: ptr_volatile_long_int_var\n") +} + +probe process(@1).mark("long_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_int_ptr_volatile_var\n") + else + printf("PASS: long_int_ptr_volatile_var\n") +} + +probe process(@1).mark("long_long_int_var") +{ + if ($arg1 != 65536) + printf("FAIL: long_long_int_var\n") + else + printf("PASS: long_long_int_var\n") +} + +probe process(@1).mark("const_long_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: const_long_long_int_var\n") + else + printf("PASS: const_long_long_int_var\n") +} + +probe process(@1).mark("volatile_long_long_int_var") +{ + if ($arg1 != -65536) + printf("FAIL: volatile_long_long_int_var\n") + else + printf("PASS: volatile_long_long_int_var\n") +} + +probe process(@1).mark("ptr_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_long_long_int_var\n") + else + printf("PASS: ptr_long_long_int_var\n") +} + +probe process(@1).mark("ptr_const_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_const_long_long_int_var\n") + else + printf("PASS: ptr_const_long_long_int_var\n") +} + +probe process(@1).mark("long_long_int_ptr_const_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_long_int_ptr_const_var\n") + else + printf("PASS: long_long_int_ptr_const_var\n") +} + +probe process(@1).mark("ptr_volatile_long_long_int_var") +{ + if ($arg1 != $arg2) + printf("FAIL: ptr_volatile_long_long_int_var\n") + else + printf("PASS: ptr_volatile_long_long_int_var\n") +} + +probe process(@1).mark("long_long_int_ptr_volatile_var") +{ + if ($arg1 != $arg2) + printf("FAIL: long_long_int_ptr_volatile_var\n") + else + printf("PASS: long_long_int_ptr_volatile_var\n") +} + +probe process(@1).mark("arr_char") +{ + arr_char = user_string ($arg1); + if (arr_char != "!~") + printf("FAIL: arr_char_var\n") + else + printf("PASS: arr_char_var\n") +} + +probe process(@1).mark("arr_struct") +{ + arr_struct_int_var = user_int ($arg1) + if (arr_struct_int_var != 1) + printf("FAIL: arr_struct_var\n") + else + printf("PASS: arr_struct_var\n") +} + +probe process(@1).mark("bitfields_small_var") +{ + if ($arg1 != 1 || $arg2 != 0 || $arg3 != 97 || $arg4 != 1 + || $arg5 != 0 || $arg6 != 122 || $arg7 != 1 || $arg8 != 0) + printf("FAIL: bitfields_small_var\n") + +} + +probe process(@1).mark("bitfields_bit_var") +{ + if ($arg1 != 65 || $arg2 != -1 || $arg3 != 1 || $arg4 != 1 + || $arg5 != 3 || $arg6 != 3 || $arg7 != 7 || $arg8 != 255 + || $arg9 != 511 || $arg10 != 90) + printf("FAIL: bitfields_bit_var\n") + else + printf("PASS: bitfields_bit_var\n") +} + + +probe process(@1).mark("primary_colors_var") +{ + if ($arg1 != 1) + printf("FAIL: primary_colors_var\n") + else + printf("PASS: primary_colors_var\n") +} + + + + + + + + + + + diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index e407440e..620d5576 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -118,17 +118,6 @@ if { $res != "" } { pass "$test compiling C -g" } -set sup_flags "$sup_flags additional_flags=-x additional_flags=c++" -set res [target_compile $sup_srcpath $supcplus_exepath executable $sup_flags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "$test compiling C++ -g" - catch {exec rm -f $sup_srcpath $sup_exepath $sup_hpath $sup_stppath} - return -} else { - pass "$test compiling C++ -g" -} - if {![installtest_p]} {untested $test; return} # Try to find utrace_attach symbol in /proc/kallsyms @@ -162,29 +151,37 @@ wait if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" } -set ok 0 +set sup_flags "$sup_flags additional_flags=-O0" +set res [target_compile $srcdir/$subdir/sdt_types.c sdt_types.x executable $sup_flags] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "$test compiling -g" + return +} else { + pass "$test compiling -g" +} -# Test setting a probe without .probes using only dwarf label info -verbose -log "objcopy -R .probes $supcplus_exepath $sup_exepath" -spawn objcopy -R .probes $supcplus_exepath $sup_exepath -verbose -log "spawn stap -c $sup_exepath $sup_stppath" -spawn stap -c $sup_exepath $sup_stppath +set ok 0 +set fail "types" +verbose -log "spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x" +spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x expect { -timeout 180 - -re {In test_probe_2 probe 0x2} { incr ok; exp_continue } - -re {In test_probe_0 probe 0x3} { incr ok; exp_continue } - -re {In test_probe_3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } - -re {In test_probe_4 dtrace probe 0x4} { incr ok; exp_continue } - timeout { fail "$test C++ (timeout)" } + -re {FAIL: [a-z_]+var} { regexp " .*$" $expect_out(0,string) s; + incr ok; set fail "$fail $s"; exp_continue } + timeout { fail "$test C (timeout)" } eof { } } wait -# we now generate the probes via asm so there is no label debug info -if {$ok == 5} { pass "$test C++" } { xfail "$test C++ ($ok)" } +if { $ok != 0 } { + fail $fail +} else { + pass types +} if { $verbose == 0 } { -catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath} +catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath sdt_types.x} } diff --git a/testsuite/systemtap.examples/network/tcp.stp b/testsuite/systemtap.examples/network/tcp.stp index ebe72a1c..01db9d2d 100644 --- a/testsuite/systemtap.examples/network/tcp.stp +++ b/testsuite/systemtap.examples/network/tcp.stp @@ -1,3 +1,5 @@ +#! /usr/bin/env stap + //A simple TCP tapset example probe begin { diff --git a/translate.cxx b/translate.cxx index 0b81d9bb..47fffd1e 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4564,7 +4564,7 @@ dump_unwindsyms (Dwfl_Module *m, // base address outself. (see also below). extra_offset = sym.st_value - base; if (c->session.verbose > 2) - clog << "Found kernel _stext 0x" << hex << extra_offset << dec << endl; + clog << "Found kernel _stext extra offset 0x" << hex << extra_offset << dec << endl; } // We only need the function symbols to identify kernel-mode @@ -4572,8 +4572,9 @@ dump_unwindsyms (Dwfl_Module *m, // These fake absolute addresses occur in some older i386 // kernels to indicate they are vDSO symbols, not real // functions in the kernel. - if (GELF_ST_TYPE (sym.st_info) == STT_FUNC && - ! (sym.st_shndx == SHN_UNDEF || sym.st_shndx == SHN_ABS)) + if ((GELF_ST_TYPE (sym.st_info) == STT_FUNC || + GELF_ST_TYPE (sym.st_info) == STT_OBJECT) // PR10000: also need .data + && !(sym.st_shndx == SHN_UNDEF || sym.st_shndx == SHN_ABS)) { Dwarf_Addr sym_addr = sym.st_value; const char *secname = NULL; |