From c0dac6989f733db67f9c4d62b584944efd0680c5 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 23 Apr 2009 14:43:00 -0400 Subject: git_version: emit `git-describe` rather than just sha code, for use in stap -V --- git_version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_version.sh b/git_version.sh index d39d96c9..d7945d71 100755 --- a/git_version.sh +++ b/git_version.sh @@ -180,7 +180,7 @@ fi # Detect git tools (should work with old and new git versions) git_found=yes -for git_tool in git-symbolic-ref git-rev-parse git-diff-files git-diff-index git +for git_tool in git-symbolic-ref git-rev-parse git-diff-files git-diff-index git git-describe do if [ x`which $git_tool 2>/dev/null` = "x" ]; then git_found="'$git_tool' not found" @@ -207,7 +207,7 @@ if [ "x$git_repo_dir" != "x" ] && [ "x${abs_repo_dir}" = "x${abs_srcdir}/.git" ] git_repo=yes if [ "x$git_found" = "xyes" ]; then # git-1.4 and probably earlier understand "git-rev-parse HEAD" - git_shaid=`git-rev-parse HEAD | $SED -n 's/^\(.\{8\}\).*/\1/p'` + git_shaid=`git-describe` if [ "x$git_shaid" = "x" ]; then git_errors="${git_errors+${git_errors}; }error running 'git-rev-parse HEAD'" fi -- cgit From 52bc8b53c4bf03d51edf02d088aa04af809b9005 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 23 Apr 2009 15:04:05 -0400 Subject: Make sure that the pool_size and hash_size are passed into xmlto. --- doc/SystemTap_Tapset_Reference/Makefile.am | 4 +--- doc/SystemTap_Tapset_Reference/Makefile.in | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 087ca887..4dc48822 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -34,9 +34,7 @@ stamp-htmldocs: tapsets.xml # bump up the allocated space so "xmlto pdf" works tapsets.pdf: tapsets.xml - export pool_size=2000000 - export hash_size=120000 - xmlto pdf tapsets.xml + env pool_size=2000000 hash_size=120000 xmlto pdf tapsets.xml stamp-mandocs: tapsets.xml xmlto man -o man3 tapsets.xml diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index fa753bf1..be810a9a 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -431,9 +431,7 @@ uninstall-am: # bump up the allocated space so "xmlto pdf" works @BUILD_REFDOCS_TRUE@tapsets.pdf: tapsets.xml -@BUILD_REFDOCS_TRUE@ export pool_size=2000000 -@BUILD_REFDOCS_TRUE@ export hash_size=120000 -@BUILD_REFDOCS_TRUE@ xmlto pdf tapsets.xml +@BUILD_REFDOCS_TRUE@ env pool_size=2000000 hash_size=120000 xmlto pdf tapsets.xml @BUILD_REFDOCS_TRUE@stamp-mandocs: tapsets.xml @BUILD_REFDOCS_TRUE@ xmlto man -o man3 tapsets.xml -- cgit From fd8646cc285b96601bf5602d7c669d09b0344c13 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 23 Apr 2009 15:26:32 -0400 Subject: Revert "Make sure that the pool_size and hash_size are passed into xmlto." This reverts commit 52bc8b53c4bf03d51edf02d088aa04af809b9005. --- doc/SystemTap_Tapset_Reference/Makefile.am | 4 +++- doc/SystemTap_Tapset_Reference/Makefile.in | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 4dc48822..087ca887 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -34,7 +34,9 @@ stamp-htmldocs: tapsets.xml # bump up the allocated space so "xmlto pdf" works tapsets.pdf: tapsets.xml - env pool_size=2000000 hash_size=120000 xmlto pdf tapsets.xml + export pool_size=2000000 + export hash_size=120000 + xmlto pdf tapsets.xml stamp-mandocs: tapsets.xml xmlto man -o man3 tapsets.xml diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index be810a9a..fa753bf1 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -431,7 +431,9 @@ uninstall-am: # bump up the allocated space so "xmlto pdf" works @BUILD_REFDOCS_TRUE@tapsets.pdf: tapsets.xml -@BUILD_REFDOCS_TRUE@ env pool_size=2000000 hash_size=120000 xmlto pdf tapsets.xml +@BUILD_REFDOCS_TRUE@ export pool_size=2000000 +@BUILD_REFDOCS_TRUE@ export hash_size=120000 +@BUILD_REFDOCS_TRUE@ xmlto pdf tapsets.xml @BUILD_REFDOCS_TRUE@stamp-mandocs: tapsets.xml @BUILD_REFDOCS_TRUE@ xmlto man -o man3 tapsets.xml -- cgit From 551218c441e28128d458c4fbd4923335800ea878 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 23 Apr 2009 15:37:22 -0400 Subject: Make sure values get passed to xmlto. --- doc/SystemTap_Tapset_Reference/Makefile.am | 4 +--- doc/SystemTap_Tapset_Reference/Makefile.in | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 087ca887..7903b12b 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -34,9 +34,7 @@ stamp-htmldocs: tapsets.xml # bump up the allocated space so "xmlto pdf" works tapsets.pdf: tapsets.xml - export pool_size=2000000 - export hash_size=120000 - xmlto pdf tapsets.xml + env pool_size=2000000 hash_extra=2000000 xmlto pdf tapsets.xml stamp-mandocs: tapsets.xml xmlto man -o man3 tapsets.xml diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index fa753bf1..66b163f8 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -431,9 +431,7 @@ uninstall-am: # bump up the allocated space so "xmlto pdf" works @BUILD_REFDOCS_TRUE@tapsets.pdf: tapsets.xml -@BUILD_REFDOCS_TRUE@ export pool_size=2000000 -@BUILD_REFDOCS_TRUE@ export hash_size=120000 -@BUILD_REFDOCS_TRUE@ xmlto pdf tapsets.xml +@BUILD_REFDOCS_TRUE@ env pool_size=2000000 hash_extra=2000000 xmlto pdf tapsets.xml @BUILD_REFDOCS_TRUE@stamp-mandocs: tapsets.xml @BUILD_REFDOCS_TRUE@ xmlto man -o man3 tapsets.xml -- cgit From 225d8d4b086b0bf29ac8c69634957d13f6b34e16 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 23 Apr 2009 12:43:28 -0700 Subject: Version bumps for 0.9.6 release --- NEWS | 2 +- configure | 20 ++++++++++---------- configure.ac | 2 +- systemtap.spec | 5 ++++- testsuite/configure | 20 ++++++++++---------- testsuite/configure.ac | 2 +- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 88076db3..58322cf5 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -* What's new +* What's new in version 0.9.6 - @cast can now determine its type information using an explicit header specification. For example: diff --git a/configure b/configure index 9576d7e6..271180ec 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for systemtap 0.9.5. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.6. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.5' -PACKAGE_STRING='systemtap 0.9.5' +PACKAGE_VERSION='0.9.6' +PACKAGE_STRING='systemtap 0.9.6' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' # Factoring default headers for most tests. @@ -1349,7 +1349,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.5 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.5:";; + short | recursive ) echo "Configuration of systemtap 0.9.6:";; esac cat <<\_ACEOF @@ -1540,7 +1540,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.5 +systemtap configure 0.9.6 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1554,7 +1554,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.5, which was +It was created by systemtap $as_me 0.9.6, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2272,7 +2272,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.5' + VERSION='0.9.6' cat >>confdefs.h <<_ACEOF @@ -8795,7 +8795,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.5, which was +This file was extended by systemtap $as_me 0.9.6, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8858,7 +8858,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.5 +systemtap config.status 0.9.6 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 125626f8..e39cadfb 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.5, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.6, systemtap@sources.redhat.com, systemtap) dnl ^^^^^ see also NEWS, systemtap.spec, testsuite/configure.ac AC_PREREQ(2.59) diff --git a/systemtap.spec b/systemtap.spec index a01ccb11..9e1a8689 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -6,7 +6,7 @@ %{!?pie_supported: %define pie_supported 1} Name: systemtap -Version: 0.9.5 +Version: 0.9.6 Release: 1%{?dist} # for version, see also configure.ac Summary: Instrumentation System @@ -323,6 +323,9 @@ exit 0 %changelog +* Thu Apr 23 2009 Josh Stone - 0.9.6-1 +- Upstream release. + * Fri Mar 27 2009 Josh Stone - 0.9.5-1 - Upstream release. diff --git a/testsuite/configure b/testsuite/configure index 18be8832..08c6d575 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.63 for systemtap 0.9.5. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.6. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.5' -PACKAGE_STRING='systemtap 0.9.5' +PACKAGE_VERSION='0.9.6' +PACKAGE_STRING='systemtap 0.9.6' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='LTLIBOBJS @@ -1227,7 +1227,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.5 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1293,7 +1293,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.5:";; + short | recursive ) echo "Configuration of systemtap 0.9.6:";; esac cat <<\_ACEOF @@ -1372,7 +1372,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.5 +systemtap configure 0.9.6 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1386,7 +1386,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.5, which was +It was created by systemtap $as_me 0.9.6, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2104,7 +2104,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.5' + VERSION='0.9.6' cat >>confdefs.h <<_ACEOF @@ -2749,7 +2749,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.5, which was +This file was extended by systemtap $as_me 0.9.6, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2799,7 +2799,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.5 +systemtap config.status 0.9.6 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/testsuite/configure.ac b/testsuite/configure.ac index 03ce3f61..4398df21 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.5, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.6, systemtap@sources.redhat.com, systemtap) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR(..) -- cgit From 5171b04f699dd8a2d08c0f1d6307094f2e3c273b Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 23 Apr 2009 16:30:29 -0400 Subject: git_version: use --long mode to always add the git hash too --- git_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_version.sh b/git_version.sh index d7945d71..92f2bd31 100755 --- a/git_version.sh +++ b/git_version.sh @@ -207,7 +207,7 @@ if [ "x$git_repo_dir" != "x" ] && [ "x${abs_repo_dir}" = "x${abs_srcdir}/.git" ] git_repo=yes if [ "x$git_found" = "xyes" ]; then # git-1.4 and probably earlier understand "git-rev-parse HEAD" - git_shaid=`git-describe` + git_shaid=`git-describe --long` if [ "x$git_shaid" = "x" ]; then git_errors="${git_errors+${git_errors}; }error running 'git-rev-parse HEAD'" fi -- cgit From 1ce4311fbb8e3191449f919b784cea355a0cfe00 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Thu, 23 Apr 2009 16:43:44 -0400 Subject: Avoid a uprobe break setting problem by avoiding 'nop 0' on x86. * sdt.h (STAP_NOP): New. (STAP_PROBE): Use it. --- includes/sys/sdt.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index c2242303..f89b736a 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -58,11 +58,17 @@ #define STAP_UNINLINE_LABEL(label) \ __extension__ static volatile long labelval __attribute__ ((unused)) = (long) &&label +#if defined(__x86_64__) || defined(__i386__) +#define STAP_NOP "\tnop " +#else +#define STAP_NOP "\tnop 0 " +#endif + #define STAP_PROBE_(probe) \ do { \ STAP_PROBE_DATA(probe); \ __asm__ volatile ("2:\n" \ - "\tnop 0"); \ + STAP_NOP); \ } while (0) #define STAP_PROBE1_(probe,label,parm1) \ @@ -73,7 +79,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 */" :: "g"(arg1)); \ + STAP_NOP "/* %0 */" :: "g"(arg1)); \ } while (0) #define STAP_PROBE2_(probe,label,parm1,parm2) \ @@ -85,7 +91,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 */" :: "g"(arg1), "g"(arg2)); \ + STAP_NOP "/* %0 %1 */" :: "g"(arg1), "g"(arg2)); \ } while (0) #define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \ @@ -98,7 +104,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 */" :: "g"(arg1), "g"(arg2), "g"(arg3)); \ + STAP_NOP "/* %0 %1 %2 */" :: "g"(arg1), "g"(arg2), "g"(arg3)); \ } while (0) #define STAP_PROBE4_(probe,label,parm1,parm2,parm3,parm4) \ @@ -112,7 +118,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4)); \ + STAP_NOP "/* %0 %1 %2 %3 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4)); \ } while (0) #define STAP_PROBE5_(probe,label,parm1,parm2,parm3,parm4,parm5) \ @@ -127,7 +133,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5)); \ } while (0) #define STAP_PROBE6_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6) \ @@ -143,7 +149,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 %5 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 %5 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6)); \ } while (0) #define STAP_PROBE7_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ @@ -160,7 +166,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 %5 %6 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 %5 %6 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7)); \ } while (0) #define STAP_PROBE8_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ @@ -178,7 +184,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 %5 %6 %7 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 %5 %6 %7 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8)); \ } while (0) #define STAP_PROBE9_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ @@ -197,7 +203,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 %5 %6 %7 %8 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 %5 %6 %7 %8 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9)); \ } while (0) #define STAP_PROBE10_(probe,label,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ @@ -217,7 +223,7 @@ do { \ STAP_PROBE_DATA(probe); \ label: \ __asm__ volatile ("2:\n" \ - "\tnop 0 /* %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9), "g"(arg10)); \ + STAP_NOP "/* %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 */" :: "g"(arg1), "g"(arg2), "g"(arg3), "g"(arg4), "g"(arg5), "g"(arg6), "g"(arg7), "g"(arg8), "g"(arg9), "g"(arg10)); \ } while (0) #define STAP_PROBE(provider,probe) \ -- cgit From 0cd571c33e70fee4777622a49f50e9122335432d Mon Sep 17 00:00:00 2001 From: Jim Keniston Date: Thu, 23 Apr 2009 14:19:58 -0700 Subject: i386 uprobes1: enable the 0x0f 0x1_ row of opcodes to make sdt.exp pass --- runtime/uprobes/uprobes_i386.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/uprobes/uprobes_i386.c b/runtime/uprobes/uprobes_i386.c index 7743f400..35d112fa 100644 --- a/runtime/uprobes/uprobes_i386.c +++ b/runtime/uprobes/uprobes_i386.c @@ -59,7 +59,7 @@ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* ------------------------------- */ W(0x00, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 00 */ - W(0x10, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* 10 */ + W(0x10, 1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1), /* 10 */ W(0x20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 20 */ W(0x30, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* 30 */ W(0x40, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 40 */ -- cgit From 9b055ab2163bfa62c70949f4935b1432b6a6921b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 23 Apr 2009 15:11:37 -0700 Subject: Version bumps for 0.9.7 release --- NEWS | 2 +- configure | 20 ++++++++++---------- configure.ac | 2 +- systemtap.spec | 4 ++-- testsuite/configure | 20 ++++++++++---------- testsuite/configure.ac | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 58322cf5..d474dec6 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -* What's new in version 0.9.6 +* What's new in version 0.9.7 - @cast can now determine its type information using an explicit header specification. For example: diff --git a/configure b/configure index 271180ec..e714e806 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for systemtap 0.9.6. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.7. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.6' -PACKAGE_STRING='systemtap 0.9.6' +PACKAGE_VERSION='0.9.7' +PACKAGE_STRING='systemtap 0.9.7' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' # Factoring default headers for most tests. @@ -1349,7 +1349,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.6 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.6:";; + short | recursive ) echo "Configuration of systemtap 0.9.7:";; esac cat <<\_ACEOF @@ -1540,7 +1540,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.6 +systemtap configure 0.9.7 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1554,7 +1554,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.6, which was +It was created by systemtap $as_me 0.9.7, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2272,7 +2272,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.6' + VERSION='0.9.7' cat >>confdefs.h <<_ACEOF @@ -8795,7 +8795,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.6, which was +This file was extended by systemtap $as_me 0.9.7, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8858,7 +8858,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.6 +systemtap config.status 0.9.7 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index e39cadfb..f79e9135 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.6, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.7, systemtap@sources.redhat.com, systemtap) dnl ^^^^^ see also NEWS, systemtap.spec, testsuite/configure.ac AC_PREREQ(2.59) diff --git a/systemtap.spec b/systemtap.spec index 9e1a8689..2f50c07f 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -6,7 +6,7 @@ %{!?pie_supported: %define pie_supported 1} Name: systemtap -Version: 0.9.6 +Version: 0.9.7 Release: 1%{?dist} # for version, see also configure.ac Summary: Instrumentation System @@ -323,7 +323,7 @@ exit 0 %changelog -* Thu Apr 23 2009 Josh Stone - 0.9.6-1 +* Thu Apr 23 2009 Josh Stone - 0.9.7-1 - Upstream release. * Fri Mar 27 2009 Josh Stone - 0.9.5-1 diff --git a/testsuite/configure b/testsuite/configure index 08c6d575..ecee48d8 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.63 for systemtap 0.9.6. +# Generated by GNU Autoconf 2.63 for systemtap 0.9.7. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='systemtap' PACKAGE_TARNAME='systemtap' -PACKAGE_VERSION='0.9.6' -PACKAGE_STRING='systemtap 0.9.6' +PACKAGE_VERSION='0.9.7' +PACKAGE_STRING='systemtap 0.9.7' PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='LTLIBOBJS @@ -1227,7 +1227,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.6 to adapt to many kinds of systems. +\`configure' configures systemtap 0.9.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1293,7 +1293,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of systemtap 0.9.6:";; + short | recursive ) echo "Configuration of systemtap 0.9.7:";; esac cat <<\_ACEOF @@ -1372,7 +1372,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -systemtap configure 0.9.6 +systemtap configure 0.9.7 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1386,7 +1386,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.6, which was +It was created by systemtap $as_me 0.9.7, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2104,7 +2104,7 @@ fi # Define the identity of the package. PACKAGE='systemtap' - VERSION='0.9.6' + VERSION='0.9.7' cat >>confdefs.h <<_ACEOF @@ -2749,7 +2749,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.6, which was +This file was extended by systemtap $as_me 0.9.7, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2799,7 +2799,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -systemtap config.status 0.9.6 +systemtap config.status 0.9.7 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/testsuite/configure.ac b/testsuite/configure.ac index 4398df21..1a82fe36 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.6, systemtap@sources.redhat.com, systemtap) +AC_INIT([systemtap], 0.9.7, systemtap@sources.redhat.com, systemtap) AC_PREREQ(2.59) AC_CONFIG_AUX_DIR(..) -- cgit From 4d0a333004c652a75304c8276e4a45083ca9c122 Mon Sep 17 00:00:00 2001 From: Kent Sebastian Date: Fri, 24 Apr 2009 11:26:51 -0400 Subject: PR10082: refactor duplicated code --- main.cxx | 80 ++++++++++++++++++++++++---------------------------------------- 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/main.cxx b/main.cxx index 1111b316..ab568c23 100644 --- a/main.cxx +++ b/main.cxx @@ -324,6 +324,34 @@ setup_signals (sighandler_t handler) sigaction (SIGTERM, &sa, NULL); } +void +setup_kernel_release (systemtap_session &s, const char* kstr) { + if (kstr[0] == '/') // fully specified path + { + s.kernel_build_tree = kstr; + string version_file_name = s.kernel_build_tree + "/include/config/kernel.release"; + // The file include/config/kernel.release within the + // build tree is used to pull out the version information + ifstream version_file (version_file_name.c_str()); + if (version_file.fail ()) + { + cerr << "Missing " << version_file_name << endl; + exit(1); + } + else + { + char c; + s.kernel_release = ""; + while (version_file.get(c) && c != '\n') + s.kernel_release.push_back(c); + } + } + else + { + s.kernel_release = string (kstr); + s.kernel_build_tree = "/lib/modules/" + s.kernel_release + "/build"; + } +} int main (int argc, char * const argv []) @@ -426,31 +454,7 @@ main (int argc, char * const argv []) const char* s_kr = getenv ("SYSTEMTAP_RELEASE"); if (s_kr != NULL) { - if (s_kr[0] == '/') // fully specified path - { - s.kernel_build_tree = s_kr; - string version_file_name = s.kernel_build_tree + "/include/config/kernel.release"; - // The file include/config/kernel.release within the - // build tree is used to pull out the version information - ifstream version_file (version_file_name.c_str()); - if (version_file.fail ()) - { - cerr << "Missing " << version_file_name << endl; - exit(1); - } - else - { - char c; - s.kernel_release = ""; - while (version_file.get(c) && c != '\n') - s.kernel_release.push_back(c); - } - } - else - { - s.kernel_release = string (s_kr); - s.kernel_build_tree = "/lib/modules/" + s.kernel_release + "/build"; - } + setup_kernel_release(s, s_kr); } @@ -588,31 +592,7 @@ main (int argc, char * const argv []) break; case 'r': - if (optarg[0] == '/') // fully specified path - { - s.kernel_build_tree = optarg; - string version_file_name = s.kernel_build_tree + "/include/config/kernel.release"; - // The file include/config/kernel.release within the - // build tree is used to pull out the version information - ifstream version_file (version_file_name.c_str()); - if (version_file.fail ()) - { - cerr << "Missing " << version_file_name << endl; - usage (s, 1); - } - else - { - char c; - s.kernel_release = ""; - while (version_file.get(c) && c != '\n') - s.kernel_release.push_back(c); - } - } - else - { - s.kernel_release = string (optarg); - s.kernel_build_tree = "/lib/modules/" + s.kernel_release + "/build"; - } + setup_kernel_release(s, optarg); break; case 'k': -- cgit From c3e80cab9599ffdca254fa697198ba8fccfbfd73 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 24 Apr 2009 11:41:16 -0400 Subject: new NEWS section --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index d474dec6..6cfd7158 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +* What's new + + * What's new in version 0.9.7 - @cast can now determine its type information using an explicit header -- cgit From 38e258727786a796835fb669f7413f52e207fd07 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 24 Apr 2009 11:43:11 -0400 Subject: git_version: fall back to git-describe w/o --long, and even git-rev-parse HEAD for old gits --- git_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_version.sh b/git_version.sh index 92f2bd31..c9d3dff7 100755 --- a/git_version.sh +++ b/git_version.sh @@ -207,7 +207,7 @@ if [ "x$git_repo_dir" != "x" ] && [ "x${abs_repo_dir}" = "x${abs_srcdir}/.git" ] git_repo=yes if [ "x$git_found" = "xyes" ]; then # git-1.4 and probably earlier understand "git-rev-parse HEAD" - git_shaid=`git-describe --long` + git_shaid=`git-describe --long 2>/dev/null || git-describe 2>/dev/null || git-rev-parse HEAD` if [ "x$git_shaid" = "x" ]; then git_errors="${git_errors+${git_errors}; }error running 'git-rev-parse HEAD'" fi -- cgit From 3cb2045e46dcac5d2c33fd22622508891c66bee0 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 24 Apr 2009 12:48:29 -0500 Subject: Cache and retrieve syscall arguments when needed. * runtime/task_finder.c (__stp_utrace_task_finder_target_syscall_entry): New function that caches syscall arguments for mmap(), munmap(), and mprotect() for use in __stp_utrace_task_finder_target_syscall_exit(). (__stp_utrace_task_finder_target_syscall_exit): Uses cached syscall argument info when making callbacks. (stap_start_task_finder): Initializes map subsytem for storing syscall argument data. * runtime/task_finder_map.c: New file containing functions to save and retrieve syscall arguments. --- runtime/task_finder.c | 137 ++++++++++++++++++++++++--------- runtime/task_finder_map.c | 191 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+), 35 deletions(-) create mode 100644 runtime/task_finder_map.c diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 93b89cb9..f5e059ca 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -19,6 +19,7 @@ struct stap_task_finder_target { }; #include "syscall.h" #include "utrace_compatibility.h" +#include "task_finder_map.c" static LIST_HEAD(__stp_task_finder_list); @@ -127,6 +128,19 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action, unsigned long event); #endif +#ifdef UTRACE_ORIG_VERSION +static u32 +__stp_utrace_task_finder_target_syscall_entry(struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs); +#else +static u32 +__stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, + struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs); +#endif + #ifdef UTRACE_ORIG_VERSION static u32 __stp_utrace_task_finder_target_syscall_exit(struct utrace_attached_engine *engine, @@ -166,6 +180,8 @@ stap_register_task_finder_target(struct stap_task_finder_target *new_tgt) memset(&new_tgt->ops, 0, sizeof(new_tgt->ops)); new_tgt->ops.report_death = &__stp_utrace_task_finder_target_death; new_tgt->ops.report_quiesce = &__stp_utrace_task_finder_target_quiesce; + new_tgt->ops.report_syscall_entry = \ + &__stp_utrace_task_finder_target_syscall_entry; new_tgt->ops.report_syscall_exit = \ &__stp_utrace_task_finder_target_syscall_exit; @@ -394,6 +410,7 @@ __stp_get_mm_path(struct mm_struct *mm, char *buf, int buflen) #define __STP_TASK_BASE_EVENTS (UTRACE_EVENT(DEATH)) #define __STP_TASK_VM_BASE_EVENTS (__STP_TASK_BASE_EVENTS \ + | UTRACE_EVENT(SYSCALL_ENTRY)\ | UTRACE_EVENT(SYSCALL_EXIT)) /* @@ -1053,24 +1070,21 @@ __stp_find_file_based_vma(struct mm_struct *mm, unsigned long addr) #ifdef UTRACE_ORIG_VERSION static u32 -__stp_utrace_task_finder_target_syscall_exit(struct utrace_attached_engine *engine, - struct task_struct *tsk, - struct pt_regs *regs) +__stp_utrace_task_finder_target_syscall_entry(struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs) #else static u32 -__stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, - struct utrace_attached_engine *engine, - struct task_struct *tsk, - struct pt_regs *regs) +__stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, + struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs) #endif { struct stap_task_finder_target *tgt = engine->data; long syscall_no; - unsigned long rv; - unsigned long args[3]; + unsigned long args[3] = { 0L }; int rc; - struct mm_struct *mm; - struct vm_area_struct *vma; if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { debug_task_finder_detach(); @@ -1100,37 +1114,92 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, && tgt->munmap_events == 0)) return UTRACE_RESUME; + __stp_tf_handler_start(); + if (syscall_no == MUNMAP_SYSCALL_NO(tsk)) { + // We need 2 arguments + syscall_get_arguments(tsk, regs, 0, 2, args); + } + else if (syscall_no == MMAP_SYSCALL_NO(tsk) + || syscall_no == MMAP2_SYSCALL_NO(tsk)) { + // For mmap, we really just need the return value, so + // there is no need to save arguments + } + else { // mprotect() + // We need 3 arguments + syscall_get_arguments(tsk, regs, 0, 3, args); + } + + // Remember the syscall information + rc = __stp_tf_add_map(tsk, syscall_no, args[0], args[1], args[2]); + if (rc != 0) + _stp_error("__stp_tf_add_map returned error %d on pid %d", + rc, tsk->pid); + __stp_tf_handler_end(); + return UTRACE_RESUME; +} + +#ifdef UTRACE_ORIG_VERSION +static u32 +__stp_utrace_task_finder_target_syscall_exit(struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs) +#else +static u32 +__stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, + struct utrace_attached_engine *engine, + struct task_struct *tsk, + struct pt_regs *regs) +#endif +{ + struct stap_task_finder_target *tgt = engine->data; + unsigned long rv; + struct __stp_tf_map_entry *entry; + + if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { + debug_task_finder_detach(); + return UTRACE_DETACH; + } + + if (tgt == NULL) + return UTRACE_RESUME; + + // See if we can find saved syscall info. If we can, it must + // be one of the syscalls we are interested in (and we must + // have callbacks to call for it). + entry = __stp_tf_get_map_entry(tsk); + if (entry == NULL) + return UTRACE_RESUME; + // Get return value + __stp_tf_handler_start(); rv = syscall_get_return_value(tsk, regs); - // We need the first syscall argument to see what address we - // were operating on. - syscall_get_arguments(tsk, regs, 0, 1, args); - #ifdef DEBUG_TASK_FINDER_VMA _stp_dbug(__FUNCTION__, __LINE__, "tsk %d found %s(0x%lx), returned 0x%lx\n", tsk->pid, - ((syscall_no == MMAP_SYSCALL_NO(tsk)) ? "mmap" - : ((syscall_no == MMAP2_SYSCALL_NO(tsk)) ? "mmap2" - : ((syscall_no == MPROTECT_SYSCALL_NO(tsk)) ? "mprotect" - : ((syscall_no == MUNMAP_SYSCALL_NO(tsk)) ? "munmap" + ((entry->syscall_no == MMAP_SYSCALL_NO(tsk)) ? "mmap" + : ((entry->syscall_no == MMAP2_SYSCALL_NO(tsk)) ? "mmap2" + : ((entry->syscall_no == MPROTECT_SYSCALL_NO(tsk)) + ? "mprotect" + : ((entry->syscall_no == MUNMAP_SYSCALL_NO(tsk)) + ? "munmap" : "UNKNOWN")))), - args[0], rv); + entry->arg0, rv); #endif - __stp_tf_handler_start(); - if (syscall_no == MUNMAP_SYSCALL_NO(tsk)) { - // We need the 2nd syscall argument for the length. - syscall_get_arguments(tsk, regs, 1, 1, &args[1]); + if (entry->syscall_no == MUNMAP_SYSCALL_NO(tsk)) { // Call the callbacks - __stp_call_munmap_callbacks(tgt, tsk, args[0], args[1]); + __stp_call_munmap_callbacks(tgt, tsk, entry->arg0, entry->arg1); } - else if (syscall_no == MMAP_SYSCALL_NO(tsk) - || syscall_no == MMAP2_SYSCALL_NO(tsk)) { + else if (entry->syscall_no == MMAP_SYSCALL_NO(tsk) + || entry->syscall_no == MMAP2_SYSCALL_NO(tsk)) { + struct mm_struct *mm; mm = get_task_mm(tsk); if (mm) { + struct vm_area_struct *vma; + down_read(&mm->mmap_sem); vma = __stp_find_file_based_vma(mm, rv); @@ -1144,18 +1213,14 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, mmput(mm); } } - else { - // We need the 2nd syscall argument for the length and - // the 3rd argument for the protection. - syscall_get_arguments(tsk, regs, 1, 2, &args[1]); - + else { // mprotect // Call the callbacks - __stp_call_mprotect_callbacks(tgt, tsk, args[0], args[1], - args[2]); + __stp_call_mprotect_callbacks(tgt, tsk, entry->arg0, + entry->arg1, entry->arg2); } -syscall_exit_done: __stp_tf_handler_end(); + __stp_tf_remove_map_entry(entry); return UTRACE_RESUME; } @@ -1179,6 +1244,8 @@ stap_start_task_finder(void) return ENOMEM; } + __stp_tf_map_initialize(); + atomic_set(&__stp_task_finder_state, __STP_TF_RUNNING); rcu_read_lock(); diff --git a/runtime/task_finder_map.c b/runtime/task_finder_map.c new file mode 100644 index 00000000..b770dd0e --- /dev/null +++ b/runtime/task_finder_map.c @@ -0,0 +1,191 @@ +#include +#include +#include + +// When handling mmap()/munmap()/mprotect() syscall tracing to notice +// memory map changes, we need to cache syscall entry parameter values +// for processing at syscall exit. + +// __stp_tf_map_lock protects the hash table. +// Documentation/spinlocks.txt suggest we can be a bit more clever +// if we guarantee that in interrupt context we only read, not write +// the datastructures. We should never change the hash table or the +// contents in interrupt context (which should only ever call +// stap_find_map_map_info for getting stored info). So we might +// want to look into that if this seems a bottleneck. +static DEFINE_RWLOCK(__stp_tf_map_lock); + +#define __STP_TF_HASH_BITS 4 +#define __STP_TF_TABLE_SIZE (1 << __STP_TF_HASH_BITS) + +#ifndef TASK_FINDER_MAP_ENTRY_ITEMS +#define TASK_FINDER_MAP_ENTRY_ITEMS 100 +#endif + +struct __stp_tf_map_entry { +/* private: */ + struct hlist_node hlist; + int usage; + +/* public: */ + pid_t pid; + long syscall_no; + unsigned long arg0; + unsigned long arg1; + unsigned long arg2; +}; + +static struct __stp_tf_map_entry +__stp_tf_map_free_list_items[TASK_FINDER_MAP_ENTRY_ITEMS]; + +static struct hlist_head __stp_tf_map_free_list[1]; + +static struct hlist_head __stp_tf_map_table[__STP_TF_TABLE_SIZE]; + +// __stp_tf_map_initialize(): Initialize the free list. Grabs the +// lock. +static void +__stp_tf_map_initialize(void) +{ + int i; + struct hlist_head *head = &__stp_tf_map_free_list[0]; + + unsigned long flags; + write_lock_irqsave(&__stp_tf_map_lock, flags); + for (i = 0; i < TASK_FINDER_MAP_ENTRY_ITEMS; i++) { + hlist_add_head(&__stp_tf_map_free_list_items[i].hlist, head); + } + write_unlock_irqrestore(&__stp_tf_map_lock, flags); +} + + +// __stp_tf_map_get_free_entry(): Returns an entry from the free list +// or NULL. The __stp_tf_map_lock must be write locked before calling this +// function. +static struct __stp_tf_map_entry * +__stp_tf_map_get_free_entry(void) +{ + struct hlist_head *head = &__stp_tf_map_free_list[0]; + struct hlist_node *node; + struct __stp_tf_map_entry *entry = NULL; + + if (hlist_empty(head)) + return NULL; + hlist_for_each_entry(entry, node, head, hlist) { + break; + } + if (entry != NULL) + hlist_del(&entry->hlist); + return entry; +} + + +// __stp_tf_map_put_free_entry(): Puts an entry back on the free +// list. The __stp_tf_map_lock must be write locked before calling this +// function. +static void +__stp_tf_map_put_free_entry(struct __stp_tf_map_entry *entry) +{ + struct hlist_head *head = &__stp_tf_map_free_list[0]; + hlist_add_head(&entry->hlist, head); +} + + +// __stp_tf_map_hash(): Compute the map hash. +static inline u32 +__stp_tf_map_hash(struct task_struct *tsk) +{ + return (jhash_1word(tsk->pid, 0) & (__STP_TF_TABLE_SIZE - 1)); +} + + +// Get map_entry if the map is present in the map hash table. +// Returns NULL if not present. Takes a read lock on __stp_tf_map_lock. +static struct __stp_tf_map_entry * +__stp_tf_get_map_entry(struct task_struct *tsk) +{ + struct hlist_head *head; + struct hlist_node *node; + struct __stp_tf_map_entry *entry; + + unsigned long flags; + read_lock_irqsave(&__stp_tf_map_lock, flags); + head = &__stp_tf_map_table[__stp_tf_map_hash(tsk)]; + hlist_for_each_entry(entry, node, head, hlist) { + if (tsk->pid == entry->pid) { + read_unlock_irqrestore(&__stp_tf_map_lock, flags); + return entry; + } + } + read_unlock_irqrestore(&__stp_tf_map_lock, flags); + return NULL; +} + + +// Add the map info to the map hash table. Takes a write lock on +// __stp_tf_map_lock. +static int +__stp_tf_add_map(struct task_struct *tsk, long syscall_no, unsigned long arg0, + unsigned long arg1, unsigned long arg2) +{ + struct hlist_head *head; + struct hlist_node *node; + struct __stp_tf_map_entry *entry; + unsigned long flags; + + write_lock_irqsave(&__stp_tf_map_lock, flags); + head = &__stp_tf_map_table[__stp_tf_map_hash(tsk)]; + hlist_for_each_entry(entry, node, head, hlist) { + // If we find an existing entry, just increment the + // usage count. + if (tsk->pid == entry->pid) { + entry->usage++; + write_unlock_irqrestore(&__stp_tf_map_lock, flags); + return 0; + } + } + + // Get an element from the free list. + entry = __stp_tf_map_get_free_entry(); + if (!entry) { + write_unlock_irqrestore(&__stp_tf_map_lock, flags); + return -ENOMEM; + } + entry->usage = 1; + entry->pid = tsk->pid; + entry->syscall_no = syscall_no; + entry->arg0 = arg0; + entry->arg1 = arg1; + entry->arg2 = arg2; + hlist_add_head(&entry->hlist, head); + write_unlock_irqrestore(&__stp_tf_map_lock, flags); + return 0; +} + + +// Remove the map entry from the map hash table. Takes a write lock on +// __stp_tf_map_lock. +static int +__stp_tf_remove_map_entry(struct __stp_tf_map_entry *entry) +{ + struct hlist_head *head; + struct hlist_node *node; + int found = 0; + + if (entry != NULL) { + unsigned long flags; + write_lock_irqsave(&__stp_tf_map_lock, flags); + + // Decrement the usage count. + entry->usage--; + + // If the entry is unused, put it back on the free + // list. + if (entry->usage == 0) { + hlist_del(&entry->hlist); + __stp_tf_map_put_free_entry(entry); + } + write_unlock_irqrestore(&__stp_tf_map_lock, flags); + } + return 0; +} -- cgit From af6b0601a7b65842fd639d1d712d77fa69b18065 Mon Sep 17 00:00:00 2001 From: Jim Keniston Date: Fri, 24 Apr 2009 13:46:46 -0700 Subject: PR5273: uprobes_i386.c instruction table Resynch uprobes1 2-byte-opcode table with uprobes2 x86. Mostly changes a bunch of mmx instructions from rejected to accepted. --- runtime/uprobes/uprobes_i386.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/runtime/uprobes/uprobes_i386.c b/runtime/uprobes/uprobes_i386.c index 35d112fa..008f32de 100644 --- a/runtime/uprobes/uprobes_i386.c +++ b/runtime/uprobes/uprobes_i386.c @@ -58,22 +58,22 @@ static const unsigned long good_2byte_insns[256 / 32] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* ------------------------------- */ - W(0x00, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 00 */ + W(0x00, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1)| /* 00 */ W(0x10, 1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1), /* 10 */ - W(0x20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 20 */ - W(0x30, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* 30 */ - W(0x40, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 40 */ - W(0x50, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* 50 */ - W(0x60, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* 60 */ - W(0x70, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* 70 */ + W(0x20, 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1)| /* 20 */ + W(0x30, 0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0), /* 30 */ + W(0x40, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 40 */ + W(0x50, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* 50 */ + W(0x60, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 60 */ + W(0x70, 1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1), /* 70 */ W(0x80, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 80 */ W(0x90, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* 90 */ W(0xa0, 1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1)| /* a0 */ W(0xb0, 1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1), /* b0 */ - W(0xc0, 1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1)| /* c0 */ - W(0xd0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* d0 */ - W(0xe0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* e0 */ - W(0xf0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) /* f0 */ + W(0xc0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* c0 */ + W(0xd0, 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* d0 */ + W(0xe0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* e0 */ + W(0xf0, 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0) /* f0 */ /* ------------------------------- */ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ }; -- cgit From 8f497c23fd73345bd73b085a853f9c8be548715c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Apr 2009 14:28:26 -0700 Subject: Tweak error message in kprobe.function registration --- tapsets.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tapsets.cxx b/tapsets.cxx index 4ab61942..d16ae487 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8588,7 +8588,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline(1) << "sdp->registered_p = 0;"; s.op->newline() << "if (rc == -EINVAL)"; s.op->newline() << "{"; - s.op->newline() << " _stp_error (\"Error registering kprobe,possibly an incorrect name %s OR addr = %p, rc = %d \", sdp->symbol_string, sdp->address, rc);"; + s.op->newline() << " _stp_error (\"Error registering kprobe, possibly an incorrect name %s OR addr = %p, rc = %d \", sdp->symbol_string, sdp->address, rc);"; s.op->newline() << " atomic_set (&session_state, STAP_SESSION_ERROR);"; s.op->newline() << " goto out;"; s.op->newline() << "}"; -- cgit From 5badd4d0d1fc3f7dce2dc26a3ad5a69275ff07d2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Apr 2009 18:07:12 -0700 Subject: Don't terminate when a dwarfless kprobe fails All of our other kprobe types will let the script continue after a registration failure, as per PR6749. The dwarfless kprobes should be no exception. Also, the way they were exiting was causing an unclean shutdown, so I added tests to badkprobe.exp to make sure that cleanup is always allowed to run. --- tapsets.cxx | 9 +-------- testsuite/systemtap.base/badkprobe.exp | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index d16ae487..511289df 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8586,14 +8586,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline(-1) << "}"; s.op->newline() << "if (rc) {"; // PR6749: tolerate a failed register_*probe. s.op->newline(1) << "sdp->registered_p = 0;"; - s.op->newline() << "if (rc == -EINVAL)"; - s.op->newline() << "{"; - s.op->newline() << " _stp_error (\"Error registering kprobe, possibly an incorrect name %s OR addr = %p, rc = %d \", sdp->symbol_string, sdp->address, rc);"; - s.op->newline() << " atomic_set (&session_state, STAP_SESSION_ERROR);"; - s.op->newline() << " goto out;"; - s.op->newline() << "}"; - s.op->newline() << "else"; - s.op->newline() << "_stp_warn (\"probe %s for %s registration error (rc %d)\", probe_point, sdp->pp, rc);"; + s.op->newline() << "_stp_warn (\"probe %s registration error (rc %d)\", probe_point, rc);"; s.op->newline() << "rc = 0;"; // continue with other probes // XXX: shall we increment numskipped? s.op->newline(-1) << "}"; diff --git a/testsuite/systemtap.base/badkprobe.exp b/testsuite/systemtap.base/badkprobe.exp index efc06695..c0815fbe 100644 --- a/testsuite/systemtap.base/badkprobe.exp +++ b/testsuite/systemtap.base/badkprobe.exp @@ -1,14 +1,28 @@ -set script "probe kernel.statement(-1).absolute {} probe timer.s(1) { exit() }" set test "bad kprobe registration" +set script { + probe $1 {} + probe timer.s(1) { exit() } + probe end { println("cleanup ok") } +} if {! [installtest_p]} { untested $test; return } -spawn stap -g -w -e "$script" -expect { - -timeout 60 - -re "^WARNING: probe .*registration error.*" { pass $test } - eof { fail "$test (eof)" } - timeout { fail "$test (timeout)" } +set bad_kprobes { + kernel.statement(-1).absolute + kprobe.statement(-1).absolute + kprobe.function("no_such_function") + kprobe.function("no_such_function").return +} + +foreach bk $bad_kprobes { + set test "bad kprobe registration: $bk" + spawn stap -g -w -e "$script" "$bk" + expect { + -timeout 60 + -re "^WARNING: probe .*registration error.*\r\ncleanup ok" { pass $test } + eof { fail "$test (eof)" } + timeout { fail "$test (timeout)" } + } + catch {close} + catch {wait} } -catch {close} -catch {wait} -- cgit From 46856d8d04167a05b62f8d3a480b2be7509fcf86 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Apr 2009 18:37:35 -0700 Subject: Fill out the pp() for dwarfless kprobes --- tapsets.cxx | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 511289df..9a8524b1 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8350,11 +8350,33 @@ kprobe_derived_probe::kprobe_derived_probe (probe *base, #define USHRT_MAX 32767 #endif - // Expansion of $target variables in the probe body produces an error during translate phase + // Expansion of $target variables in the probe body produces an error during + // translate phase, since we're not using debuginfo + vector comps; + comps.push_back (new probe_point::component(TOK_KPROBE)); - if (has_return) - comps.push_back (new probe_point::component(TOK_RETURN)); + if (has_statement) + { + comps.push_back (new probe_point::component(TOK_STATEMENT, new literal_number(addr))); + comps.push_back (new probe_point::component(TOK_ABSOLUTE)); + } + else + { + size_t pos = name.find(':'); + if (pos != string::npos) + { + string module = name.substr(0, pos); + string function = name.substr(pos + 1); + comps.push_back (new probe_point::component(TOK_MODULE, new literal_string(module))); + comps.push_back (new probe_point::component(TOK_FUNCTION, new literal_string(function))); + } + else + comps.push_back (new probe_point::component(TOK_FUNCTION, new literal_string(name))); + + if (has_return) + comps.push_back (new probe_point::component(TOK_RETURN)); + } this->sole_location()->components = comps; } -- cgit From c8d9d15e8d696f556fd27ae43db12552bcc63512 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Apr 2009 19:30:59 -0700 Subject: Simplify dwarfless kprobe stmt vs. name logic --- tapsets.cxx | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 9a8524b1..51c7d360 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8440,7 +8440,6 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "static struct stap_dwarfless_probe {"; s.op->newline(1) << "const unsigned return_p:1;"; s.op->newline() << "const unsigned maxactive_p:1;"; - s.op->newline() << "const unsigned statement_p:1;"; s.op->newline() << "unsigned registered_p:1;"; s.op->newline() << "const unsigned short maxactive_val;"; @@ -8486,17 +8485,11 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) assert (p->maxactive_val >= 0 && p->maxactive_val <= USHRT_MAX); s.op->line() << " .maxactive_val=" << p->maxactive_val << ","; } + if (p->has_statement) - { - s.op->line() << " .statement_p=1,"; - s.op->line() << " .address=(unsigned long)0x" << hex << p->addr << dec << "ULL,"; - s.op->line() << " .symbol_string=\"" << "\","; - } + s.op->line() << " .address=(unsigned long)0x" << hex << p->addr << dec << "ULL,"; else - { - s.op->line() << " .address=(unsigned long)0x" << hex << 0 << dec << "ULL,"; - s.op->line() << " .symbol_string=\"" << p->symbol_name << "\","; - } + s.op->line() << " .symbol_string=\"" << p->symbol_name << "\","; s.op->line() << " .pp=" << lex_cast_qstring (*p->sole_location()) << ","; s.op->line() << " .ph=&" << p->name; @@ -8552,21 +8545,15 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) void kprobe_derived_probe_group::emit_module_init (systemtap_session& s) { -#define CHECK_STMT(var) \ - s.op->newline() << "if (sdp->statement_p) {"; \ - s.op->newline() << var << ".symbol_name = NULL;"; \ - s.op->newline() << "} else {"; \ - s.op->newline() << var << ".symbol_name = sdp->symbol_string;"; \ - s.op->newline() << "}"; - s.op->newline() << "for (i=0; i<" << probes_by_module.size() << "; i++) {"; - s.op->newline() << "struct stap_dwarfless_probe *sdp = & stap_dwarfless_probes[i];"; + s.op->newline(1) << "struct stap_dwarfless_probe *sdp = & stap_dwarfless_probes[i];"; s.op->newline() << "struct stap_dwarfless_kprobe *kp = & stap_dwarfless_kprobes[i];"; - s.op->newline() << "unsigned long relocated_addr = sdp->address;"; + s.op->newline() << "void *addr = (void *) sdp->address;"; + s.op->newline() << "const char *symbol_name = addr ? NULL : sdp->symbol_string;"; s.op->newline() << "probe_point = sdp->pp;"; // for error messages s.op->newline() << "if (sdp->return_p) {"; - s.op->newline(1) << "kp->u.krp.kp.addr = (void *) relocated_addr;"; - CHECK_STMT("kp->u.krp.kp"); + s.op->newline(1) << "kp->u.krp.kp.addr = addr;"; + s.op->newline() << "kp->u.krp.kp.symbol_name = symbol_name;"; s.op->newline() << "if (sdp->maxactive_p) {"; s.op->newline(1) << "kp->u.krp.maxactive = sdp->maxactive_val;"; s.op->newline(-1) << "} else {"; @@ -8575,9 +8562,9 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "kp->u.krp.handler = &enter_kretprobe_probe;"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 s.op->newline() << "#ifdef __ia64__"; - s.op->newline() << "kp->dummy.pre_handler = NULL;"; s.op->newline() << "kp->dummy.addr = kp->u.krp.kp.addr;"; - CHECK_STMT("kp->dummy"); + s.op->newline() << "kp->dummy.symbol_name = kp->u.krp.kp.symbol_name;"; + s.op->newline() << "kp->dummy.pre_handler = NULL;"; s.op->newline() << "rc = register_kprobe (& kp->dummy);"; s.op->newline() << "if (rc == 0) {"; s.op->newline(1) << "rc = register_kretprobe (& kp->u.krp);"; @@ -8589,13 +8576,13 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "#endif"; s.op->newline(-1) << "} else {"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 - s.op->newline(1) << "kp->u.kp.addr = (void *) relocated_addr;"; - CHECK_STMT("kp->u.kp"); - s.op->newline(1) << "kp->u.kp.pre_handler = &enter_kprobe_probe;"; + s.op->newline(1) << "kp->u.kp.addr = addr;"; + s.op->newline() << "kp->u.kp.symbol_name = symbol_name;"; + s.op->newline() << "kp->u.kp.pre_handler = &enter_kprobe_probe;"; s.op->newline() << "#ifdef __ia64__"; - s.op->newline() << "kp->dummy.addr = kp->u.kp.addr;"; s.op->newline() << "kp->dummy.pre_handler = NULL;"; - CHECK_STMT("kp->dummy"); + s.op->newline() << "kp->dummy.addr = kp->u.kp.addr;"; + s.op->newline() << "kp->dummy.symbol_name = kp->u.kp.symbol_name;"; s.op->newline() << "rc = register_kprobe (& kp->dummy);"; s.op->newline() << "if (rc == 0) {"; s.op->newline(1) << "rc = register_kprobe (& kp->u.kp);"; @@ -8615,7 +8602,6 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "else sdp->registered_p = 1;"; s.op->newline(-1) << "}"; // for loop -#undef CHECK_STMT } void -- cgit From b6371390a999711146084ed6377a64e4c9480d83 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Apr 2009 20:06:58 -0700 Subject: Enable kprobe.function.return.maxactive The code to emit maxactive was almost there; it just needed to enable the maxactive probe component and pass the value down. --- tapsets.cxx | 92 ++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 51c7d360..1d194720 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2635,7 +2635,9 @@ struct kprobe_derived_probe: public derived_probe const string& name, int64_t stmt_addr, bool has_return, - bool has_statement + bool has_statement, + bool has_maxactive, + long maxactive_val ); string symbol_name; Dwarf_Addr addr; @@ -8334,14 +8336,17 @@ static string TOK_KPROBE("kprobe"); kprobe_derived_probe::kprobe_derived_probe (probe *base, probe_point *location, - const string& name, + const string& name, int64_t stmt_addr, - bool if_return, - bool if_statement -): + bool has_return, + bool has_statement, + bool has_maxactive, + long maxactive_val + ): derived_probe (base, location), symbol_name (name), addr (stmt_addr), - has_return (if_return), has_statement (if_statement) + has_return (has_return), has_statement (has_statement), + has_maxactive (has_maxactive), maxactive_val (maxactive_val) { this->tok = base->tok; this->access_var = false; @@ -8373,11 +8378,13 @@ kprobe_derived_probe::kprobe_derived_probe (probe *base, } else comps.push_back (new probe_point::component(TOK_FUNCTION, new literal_string(name))); - - if (has_return) - comps.push_back (new probe_point::component(TOK_RETURN)); } + if (has_return) + comps.push_back (new probe_point::component(TOK_RETURN)); + if (has_maxactive) + comps.push_back (new probe_point::component(TOK_MAXACTIVE, new literal_number(maxactive_val))); + this->sole_location()->components = comps; } @@ -8693,36 +8700,46 @@ kprobe_builder::build(systemtap_session & sess, vector & finished_results) { string function_string_val, module_string_val; - int64_t statement_num_val = 0; - bool has_function_str, has_module_str, has_statement_num, has_absolute, has_return; + int64_t statement_num_val = 0, maxactive_val = 0; + bool has_function_str, has_module_str, has_statement_num; + bool has_absolute, has_return, has_maxactive; - has_function_str = this->get_param(parameters, TOK_FUNCTION, function_string_val); - has_module_str = this->get_param(parameters, TOK_MODULE, module_string_val); - has_return = this->has_null_param (parameters, TOK_RETURN); - has_statement_num = this->get_param(parameters, TOK_STATEMENT, statement_num_val); - has_absolute = this->has_null_param (parameters, TOK_ABSOLUTE); + has_function_str = get_param(parameters, TOK_FUNCTION, function_string_val); + has_module_str = get_param(parameters, TOK_MODULE, module_string_val); + has_return = has_null_param (parameters, TOK_RETURN); + has_maxactive = get_param(parameters, TOK_MAXACTIVE, maxactive_val); + has_statement_num = get_param(parameters, TOK_STATEMENT, statement_num_val); + has_absolute = has_null_param (parameters, TOK_ABSOLUTE); - if ( has_function_str ) - { - if ( has_module_str ) - function_string_val = module_string_val + ":" + function_string_val; - finished_results.push_back ( new kprobe_derived_probe ( base, - location, function_string_val, - 0, has_return, - has_statement_num) ); - } + if (has_function_str) + { + if (has_module_str) + function_string_val = module_string_val + ":" + function_string_val; + + finished_results.push_back (new kprobe_derived_probe (base, + location, function_string_val, + 0, has_return, + has_statement_num, + has_maxactive, + maxactive_val)); + } else - { - // assert guru mode for absolute probes - if ( has_statement_num && has_absolute && !base->privileged ) - throw semantic_error ("absolute statement probe in unprivileged script", base->tok); - - finished_results.push_back(new kprobe_derived_probe ( base, - location,"", - statement_num_val, has_return, - has_statement_num)); - } + { + // assert guru mode for absolute probes + if ( has_statement_num && has_absolute && !base->privileged ) + throw semantic_error ("absolute statement probe in unprivileged script", base->tok); + + finished_results.push_back (new kprobe_derived_probe (base, + location, "", + statement_num_val, + has_return, + has_statement_num, + has_maxactive, + maxactive_val)); + } } + + // ------------------------------------------------------------------------ // timer derived probes // ------------------------------------------------------------------------ @@ -11856,8 +11873,13 @@ register_standard_tapsets(systemtap_session & s) ->bind_str(TOK_FUNCTION)->bind(new kprobe_builder()); s.pattern_root->bind(TOK_KPROBE)->bind_str(TOK_FUNCTION)->bind(TOK_RETURN) ->bind(new kprobe_builder()); + s.pattern_root->bind(TOK_KPROBE)->bind_str(TOK_FUNCTION)->bind(TOK_RETURN) + ->bind_num(TOK_MAXACTIVE)->bind(new kprobe_builder()); s.pattern_root->bind(TOK_KPROBE)->bind_str(TOK_MODULE) ->bind_str(TOK_FUNCTION)->bind(TOK_RETURN)->bind(new kprobe_builder()); + s.pattern_root->bind(TOK_KPROBE)->bind_str(TOK_MODULE) + ->bind_str(TOK_FUNCTION)->bind(TOK_RETURN) + ->bind_num(TOK_MAXACTIVE)->bind(new kprobe_builder()); s.pattern_root->bind(TOK_KPROBE)->bind_num(TOK_STATEMENT) ->bind(TOK_ABSOLUTE)->bind(new kprobe_builder()); } -- cgit From 9b89b6525b9e2cce69231b6613862b3cc93939c7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sat, 25 Apr 2009 17:18:24 +0200 Subject: Correct fd variable name in fadvise64 probe points. * tapset/syscalls.stp: Rename fs variable to fd. --- tapset/syscalls.stp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp index 256174d3..a215dc12 100644 --- a/tapset/syscalls.stp +++ b/tapset/syscalls.stp @@ -733,7 +733,7 @@ probe syscall.faccessat.return = kernel.function("SyS_faccessat").return !, probe syscall.fadvise64 = kernel.function("SyS_fadvise64") !, kernel.function("sys_fadvise64") ? { name = "fadvise64" - fs = $fd + fd = $fd offset = $offset len = $len advice = $advice @@ -751,7 +751,7 @@ probe syscall.fadvise64.return = kernel.function("SyS_fadvise64").return !, probe syscall.fadvise64_64 = kernel.function("SyS_fadvise64_64") !, kernel.function("sys_fadvise64_64") ? { name = "fadvise64_64" - fs = $fd + fd = $fd offset = $offset len = $len advice = $advice @@ -771,7 +771,7 @@ probe syscall.fadvise64_64.return = kernel.function("SyS_fadvise64_64").return ! probe syscall.fadvise64 = kernel.function("SyS_fadvise64") !, kernel.function("sys_fadvise64") { name = "fadvise64" - fs = 0 + fd = 0 offset = 0 len = 0 advice = 0 @@ -789,7 +789,7 @@ probe syscall.fadvise64.return = kernel.function("SyS_fadvise64").return !, probe syscall.fadvise64_64 = kernel.function("SyS_fadvise64_64") !, kernel.function("sys_fadvise64_64") { name = "fadvise64_64" - fs = 0 + fd = 0 offset = 0 len = 0 advice = 0 -- cgit From 4319867c25e4562e2d49a719c4bba3173668aa37 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 25 Apr 2009 10:18:13 -0700 Subject: Add two new AUTHORS --- AUTHORS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index a6e54c7b..4a9182f9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -35,12 +35,14 @@ Mike Mason Nobuhiro Tachino Phil Muldoon Prerna Saxena +Przemyslaw Pawelczyk Rajan Arora Roland McGrath Shaohua Li Srikar Dronamraju Srinivasa DS Stan Cox +Sunzen Wang Thang Nguyen Theodore Ts'o Tim Moore -- cgit From 82b6fb210c651e7c5a742e187d7ff664bd22705d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 26 Apr 2009 15:08:35 +0200 Subject: Add grapher executable and doc generated files and dirs to .gitignore files. --- doc/SystemTap_Tapset_Reference/.gitignore | 3 +++ grapher/.gitignore | 1 + 2 files changed, 4 insertions(+) create mode 100644 grapher/.gitignore diff --git a/doc/SystemTap_Tapset_Reference/.gitignore b/doc/SystemTap_Tapset_Reference/.gitignore index af43f913..3b7d1c17 100644 --- a/doc/SystemTap_Tapset_Reference/.gitignore +++ b/doc/SystemTap_Tapset_Reference/.gitignore @@ -1 +1,4 @@ /docproc +stamp-* +tapsets/ +tapsets.xml diff --git a/grapher/.gitignore b/grapher/.gitignore new file mode 100644 index 00000000..2ce2a624 --- /dev/null +++ b/grapher/.gitignore @@ -0,0 +1 @@ +grapher -- cgit From 88747011872d35bdb5dac1a01569e88b385d0519 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 25 Apr 2009 21:47:54 -0400 Subject: fix kprobe.* probes so they don't break -p4 if script also has kernel.* probes * tapsets.cxx (kprobe_derived_probe): Use enter_k[ret]probe>>2<<_probe. * testsuite/buildok/thirtyone.stp: Test this. --- tapsets.cxx | 12 ++++++------ testsuite/buildok/thirtyone.stp | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100755 testsuite/buildok/thirtyone.stp diff --git a/tapsets.cxx b/tapsets.cxx index 1d194720..4aeff584 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8424,9 +8424,9 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline(); // Forward declare the master entry functions - s.op->newline() << "static int enter_kprobe_probe (struct kprobe *inst,"; + s.op->newline() << "static int enter_kprobe2_probe (struct kprobe *inst,"; s.op->line() << " struct pt_regs *regs);"; - s.op->newline() << "static int enter_kretprobe_probe (struct kretprobe_instance *inst,"; + s.op->newline() << "static int enter_kretprobe2_probe (struct kretprobe_instance *inst,"; s.op->line() << " struct pt_regs *regs);"; // Emit an array of kprobe/kretprobe pointers @@ -8507,7 +8507,7 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) // Emit the kprobes callback function s.op->newline(); - s.op->newline() << "static int enter_kprobe_probe (struct kprobe *inst,"; + s.op->newline() << "static int enter_kprobe2_probe (struct kprobe *inst,"; s.op->line() << " struct pt_regs *regs) {"; // NB: as of PR5673, the kprobe|kretprobe union struct is in BSS s.op->newline(1) << "int kprobe_idx = ((uintptr_t)inst-(uintptr_t)stap_dwarfless_kprobes)/sizeof(struct stap_dwarfless_kprobe);"; @@ -8526,7 +8526,7 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s) // Same for kretprobes s.op->newline(); - s.op->newline() << "static int enter_kretprobe_probe (struct kretprobe_instance *inst,"; + s.op->newline() << "static int enter_kretprobe2_probe (struct kretprobe_instance *inst,"; s.op->line() << " struct pt_regs *regs) {"; s.op->newline(1) << "struct kretprobe *krp = inst->rp;"; @@ -8566,7 +8566,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline(-1) << "} else {"; s.op->newline(1) << "kp->u.krp.maxactive = max(10, 4*NR_CPUS);"; s.op->newline(-1) << "}"; - s.op->newline() << "kp->u.krp.handler = &enter_kretprobe_probe;"; + s.op->newline() << "kp->u.krp.handler = &enter_kretprobe2_probe;"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 s.op->newline() << "#ifdef __ia64__"; s.op->newline() << "kp->dummy.addr = kp->u.krp.kp.addr;"; @@ -8585,7 +8585,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) // to ensure safeness of bspcache, always use aggr_kprobe on ia64 s.op->newline(1) << "kp->u.kp.addr = addr;"; s.op->newline() << "kp->u.kp.symbol_name = symbol_name;"; - s.op->newline() << "kp->u.kp.pre_handler = &enter_kprobe_probe;"; + s.op->newline() << "kp->u.kp.pre_handler = &enter_kprobe2_probe;"; s.op->newline() << "#ifdef __ia64__"; s.op->newline() << "kp->dummy.pre_handler = NULL;"; s.op->newline() << "kp->dummy.addr = kp->u.kp.addr;"; diff --git a/testsuite/buildok/thirtyone.stp b/testsuite/buildok/thirtyone.stp new file mode 100755 index 00000000..8a97d84f --- /dev/null +++ b/testsuite/buildok/thirtyone.stp @@ -0,0 +1,4 @@ +#! stap -p4 + +probe kprobe.function("sys_open") {} +probe kernel.function("sys_close") {} -- cgit From 9f38e65363878d1e1bc8f51a0ad2cc4fd0316e13 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 26 Apr 2009 17:17:04 +0200 Subject: Handle kprobe struct field symbol_name as either char * or const char *. Older (2.6.18) based kernels defined struct kprobes symbol_name as char *, but newer (2.6.27) based kernels defined the same field as const char *. * tapsets.cxx (kprobe_derived_probe_group::emit_module_init): Always cast to char * when assigning to kprobes.symbol_name field. --- tapsets.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 4aeff584..bc8df243 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -8560,7 +8560,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "probe_point = sdp->pp;"; // for error messages s.op->newline() << "if (sdp->return_p) {"; s.op->newline(1) << "kp->u.krp.kp.addr = addr;"; - s.op->newline() << "kp->u.krp.kp.symbol_name = symbol_name;"; + s.op->newline() << "kp->u.krp.kp.symbol_name = (char *) symbol_name;"; s.op->newline() << "if (sdp->maxactive_p) {"; s.op->newline(1) << "kp->u.krp.maxactive = sdp->maxactive_val;"; s.op->newline(-1) << "} else {"; @@ -8584,7 +8584,7 @@ kprobe_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline(-1) << "} else {"; // to ensure safeness of bspcache, always use aggr_kprobe on ia64 s.op->newline(1) << "kp->u.kp.addr = addr;"; - s.op->newline() << "kp->u.kp.symbol_name = symbol_name;"; + s.op->newline() << "kp->u.kp.symbol_name = (char *) symbol_name;"; s.op->newline() << "kp->u.kp.pre_handler = &enter_kprobe2_probe;"; s.op->newline() << "#ifdef __ia64__"; s.op->newline() << "kp->dummy.pre_handler = NULL;"; -- cgit From 40fc3e43cea224623400ac07b6f03c700d209dec Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 27 Apr 2009 04:34:42 -0400 Subject: Add function of returning the char in given position of string * tapset/string.stp: New function stringat. * testsuite/systemtap.printf/char1.exp: Update test case. * testsuite/systemtap.printf/char1.stp: Ditto. --- tapset/string.stp | 12 ++++++++++++ testsuite/systemtap.printf/char1.exp | 2 +- testsuite/systemtap.printf/char1.stp | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tapset/string.stp b/tapset/string.stp index 2f43aecc..35ee9fa2 100644 --- a/tapset/string.stp +++ b/tapset/string.stp @@ -25,6 +25,18 @@ function substr:string(str:string,start:long, length:long) %{ /* pure */ strlcpy(THIS->__retvalue, THIS->str + THIS->start, length); %} +/** @addtogroup library +* @code function stringat:string(str:string, pos:long) @endcode +* @param str string +* @param pos the given position. 0 = start of the string +* @return Returns the char in given position of string. +*/ +function stringat:long(str:string, pos:long) %{ /* pure */ + if (THIS->pos >= 0 && THIS->pos < strlen(THIS->str)) + THIS->__retvalue = THIS->str[THIS->pos]; + else + THIS->__retvalue = 0; +%} /** @addtogroup library * @code isinstr:long(s1:string,s2:string) @endcode diff --git a/testsuite/systemtap.printf/char1.exp b/testsuite/systemtap.printf/char1.exp index 35aa479f..f9343c0e 100644 --- a/testsuite/systemtap.printf/char1.exp +++ b/testsuite/systemtap.printf/char1.exp @@ -1,3 +1,3 @@ set test "char1" -set ::result_string {stap} +set ::result_string {stapok} stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.printf/char1.stp b/testsuite/systemtap.printf/char1.stp index 207d1bc5..564c416b 100644 --- a/testsuite/systemtap.printf/char1.stp +++ b/testsuite/systemtap.printf/char1.stp @@ -3,6 +3,7 @@ probe begin printf("%c", 115) printf("%c", 116) printf("%c%c", 97, 112) + printf("%c%c", stringat("ok", 0), stringat("ok", 1)) print("\n") exit() } -- cgit From c4f51a54acff992cf19902ffd56e8338158c5811 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 27 Apr 2009 05:38:18 -0400 Subject: PR10099: Extend %M directive to support hexdumping large buffers This patch will make %M directive dump the variable width buffer in hex format instead of returning uint64_t number as before. * runtime/vsprintf.c: Modify %M directive. * stap.1.in: Update description. * testsuite/systemtap.printf/memory1.stp: Add test case. --- runtime/vsprintf.c | 31 +++++++++++++++++++------------ stap.1.in | 2 +- testsuite/systemtap.printf/memory1.stp | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c index 38ab0e2d..23810e75 100644 --- a/runtime/vsprintf.c +++ b/runtime/vsprintf.c @@ -361,18 +361,16 @@ static int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) else len = 1; + if (*fmt_copy == 'M') + len = len * 2; /* hex dump print size */ + if (!(flags & STP_LEFT)) { while (len < field_width--) { num_bytes++; } } - if (*fmt_copy == 'M') { - num_bytes += number_size((unsigned long) *(uint64_t *) s, - 16, field_width, len, flags); - } - else { - num_bytes += len; - } + + num_bytes += len; while (len < field_width--) { num_bytes++; @@ -636,16 +634,25 @@ static int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) len = 1; if (!(flags & STP_LEFT)) { - while (len < field_width--) { + int actlen = len; + if (*fmt == 'M') + actlen = len * 2; + while (actlen < field_width--) { if (str <= end) *str = ' '; ++str; } } - if (*fmt == 'M') { - str = number(str, str + len - 1 < end ? str + len - 1 : end, - (unsigned long) *(uint64_t *) s, - 16, field_width, len, flags); + if (*fmt == 'M') { /* stolen from kernel: trace_seq_putmem_hex() */ + const char _stp_hex_asc[] = "0123456789abcdef"; + int j; + for (i = 0, j = 0; i < len; i++) { + *str = _stp_hex_asc[((*s) & 0xf0) >> 4]; + str++; + *str = _stp_hex_asc[((*s) & 0x0f)]; + str++; s++; + } + len = len * 2; /* the actual length */ } else { for (i = 0; i < len; ++i) { diff --git a/stap.1.in b/stap.1.in index aed473d7..a8609d6f 100644 --- a/stap.1.in +++ b/stap.1.in @@ -674,7 +674,7 @@ Signed decimal. Safely reads kernel memory at the given address, outputs its content. The precision specifier determines the number of bytes to read. Default is 1 byte. .TP %M -Same as %m, but outputs in hexadecimal. The precision specifier determines the number of hexadecimal digits to output. Default is 1 digit. +Same as %m, but outputs in hexadecimal. The minimal size of output is double the precision specifier. .TP %o Unsigned octal. diff --git a/testsuite/systemtap.printf/memory1.stp b/testsuite/systemtap.printf/memory1.stp index f9cbf60b..15aa565b 100644 --- a/testsuite/systemtap.printf/memory1.stp +++ b/testsuite/systemtap.printf/memory1.stp @@ -113,6 +113,20 @@ probe syscall.open { success = 0; } + expected_16_actual = sprintf (" %02x%02x%02x%02x%02x%02x", + stringat(filename, 0), + stringat(filename, 1), + stringat(filename, 2), + stringat(filename, 3), + stringat(filename, 4), + stringat(filename, 5)); + testName = "%M dynamic width larger than dynamic precision"; + result = sprintf ("%*.*M", 14, 6, $filename); + if (result != expected_16_actual) { + printf ("Test %s failed\n", testName); + success = 0; + } + if (success) print ("Test passed\n"); -- cgit From 097e4a5b397b9e826453e01caa1f8169886128c5 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 27 Apr 2009 06:12:36 -0400 Subject: PR10081: improve error message for verifying build-id Output debuginfo file name and build-id if verification failed. * runtime/sym.c: Print more info if not matched. --- runtime/sym.c | 51 +++++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/runtime/sym.c b/runtime/sym.c index 013edd0c..63dad1af 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -271,34 +271,29 @@ static int _stp_module_check(void) dwfl_module_build_id was not intended to return the end address. */ notes_addr -= m->build_id_len; - if (notes_addr > base_addr) { - for (j = 0; j < m->build_id_len; j++) - { - unsigned char theory, practice; - theory = m->build_id_bits [j]; - practice = ((unsigned char*) notes_addr) [j]; - /* XXX: consider using kread() instead of above. */ - if (theory != practice) - { - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - _stp_error ("%s: inconsistent %s build-id byte #%d " - "(0x%x [actual] vs. 0x%x [debuginfo])\n", - THIS_MODULE->name, m->name, j, - practice, theory); - return 1; - #else - /* This branch is a surrogate for - kernels affected by Fedora bug - #465873. */ - printk(KERN_WARNING - "%s: inconsistent %s build-id byte #%d " - "(0x%x [actual] vs. 0x%x [debuginfo])\n", - THIS_MODULE->name, m->name, j, - practice, theory); - break; /* Note just the first mismatch. */ - #endif - } - } + if (notes_addr <= base_addr) /* shouldn't happen */ + continue; + if (memcmp(m->build_id_bits, (unsigned char*) notes_addr, m->build_id_len)) { + const char *basename; + + basename = strrchr(m->path, '/'); + if (basename) + basename++; + else + basename = m->path; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) + _stp_error ("Build-id mismatch: \"%s\" %.*M" + " vs. \"%s\" %.*M\n", + m->name, m->build_id_len, notes_addr, + basename, m->build_id_len, m->build_id_bits); + return 1; +#else + /* This branch is a surrogate for kernels + * affected by Fedora bug #465873. */ + printk(KERN_WARNING + "Build-id mismatch: \"%s\" vs. \"%s\"\n", + m->name, basename); +#endif } } /* end checking */ } /* end loop */ -- cgit