* [PATCH][V2] db: add debug_lock option to show diagnostic info
@ 2015-07-07 8:17 Zhixiong Chi
2015-07-07 8:19 ` Zhixiong Chi
2015-07-10 22:29 ` Burton, Ross
0 siblings, 2 replies; 4+ messages in thread
From: Zhixiong Chi @ 2015-07-07 8:17 UTC (permalink / raw)
To: liezhi.yang, openembedded-core
Add debug_lock option to show lock diagnostic information instead of
outputing directly.
We can enable it with using "./configure ... --enable-debug_lock".
Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
---
.../db/db/db-add-debug-lock-option.patch | 151 +++++++++++++++++++++
meta/recipes-support/db/db_6.0.30.bb | 1 +
2 files changed, 152 insertions(+)
create mode 100644 meta/recipes-support/db/db/db-add-debug-lock-option.patch
diff --git a/meta/recipes-support/db/db/db-add-debug-lock-option.patch b/meta/recipes-support/db/db/db-add-debug-lock-option.patch
new file mode 100644
index 0000000..72bdb84
--- /dev/null
+++ b/meta/recipes-support/db/db/db-add-debug-lock-option.patch
@@ -0,0 +1,151 @@
+Summary: db: add debug_lock option to show diagnostic info
+
+add debug_lock into configure to show diagnostic info
+
+Upstream-Status: Submitted
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Index: db-6.0.30/dist/config.hin
+===================================================================
+--- db-6.0.30.orig/dist/config.hin 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/dist/config.hin 2015-07-07 15:31:44.097735878 +0800
+@@ -21,6 +21,9 @@
+ /* Define to 1 if you want a version that logs write operations. */
+ #undef DEBUG_WOP
+
++/* Define to 1 if you want a version that logs write/read lock operations. */
++#undef DEBUG_LOCK
++
+ /* Define to 1 if you want a version with run-time diagnostic checking. */
+ #undef DIAGNOSTIC
+
+Index: db-6.0.30/dist/configure
+===================================================================
+--- db-6.0.30.orig/dist/configure 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/dist/configure 2015-07-07 15:34:45.841735425 +0800
+@@ -862,6 +862,7 @@
+ enable_debug
+ enable_debug_rop
+ enable_debug_wop
++enable_debug_lock
+ enable_diagnostic
+ enable_dump185
+ enable_java
+@@ -1556,6 +1557,7 @@
+ --enable-debug Build a debugging version.
+ --enable-debug_rop Build a version that logs read operations.
+ --enable-debug_wop Build a version that logs write operations.
++ --enable-debug_lock Build a version that logs write/read lock operations.
+ --enable-diagnostic Build a version with run-time diagnostics.
+ --enable-dump185 Build db_dump185(1) to dump 1.85 databases.
+ --enable-java Build Java API.
+@@ -3323,6 +3325,18 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_debug_wop" >&5
+ $as_echo "$db_cv_debug_wop" >&6; }
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-debug_lock option specified" >&5
++$as_echo_n "checking if --enable-debug_lock option specified... " >&6; }
++# Check whether --enable-debug_lock was given.
++if test "${enable_debug_lock+set}" = set; then :
++ enableval=$enable_debug_lock; db_cv_debug_lock="$enable_debug_lock"
++else
++ db_cv_debug_lock="no"
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_debug_lock" >&5
++$as_echo "$db_cv_debug_lock" >&6; }
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-diagnostic option specified" >&5
+ $as_echo_n "checking if --enable-diagnostic option specified... " >&6; }
+ # Check whether --enable-diagnostic was given.
+@@ -3835,6 +3849,11 @@
+
+
+ fi
++if test "$db_cv_debug_lock" = "yes"; then
++ $as_echo "#define DEBUG_LOCK 1" >>confdefs.h
++
++
++fi
+ if test "$db_cv_umrw" = "yes"; then
+ $as_echo "#define UMRW 1" >>confdefs.h
+
+Index: db-6.0.30/dist/configure.ac
+===================================================================
+--- db-6.0.30.orig/dist/configure.ac 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/dist/configure.ac 2015-07-07 15:35:12.465735359 +0800
+@@ -134,6 +134,11 @@
+ AH_TEMPLATE(DEBUG_WOP,
+ [Define to 1 if you want a version that logs write operations.])
+ fi
++if test "$db_cv_debug_lock" = "yes"; then
++ AC_DEFINE(DEBUG_LOCK)
++ AH_TEMPLATE(DEBUG_LOCK,
++ [Define to 1 if you want a version that logs write/read lock operations.])
++fi
+ if test "$db_cv_umrw" = "yes"; then
+ AC_DEFINE(UMRW)
+ AH_TEMPLATE(UMRW,
+Index: db-6.0.30/src/common/db_err.c
+===================================================================
+--- db-6.0.30.orig/src/common/db_err.c 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/src/common/db_err.c 2015-07-07 15:36:45.329735127 +0800
+@@ -648,6 +648,32 @@
+ }
+
+ /*
++ * __db_lock_msg --
++ * Standard DB lock stat message routine.
++ *
++ * PUBLIC: void __db_lock_msg __P((const ENV *, const char *, ...))
++ * PUBLIC: __attribute__ ((__format__ (__printf__, 2, 3)));
++ */
++void
++#ifdef STDC_HEADERS
++__db_lock_msg(const ENV *env, const char *fmt, ...)
++#else
++__db_lock_msg(env, fmt, va_alist)
++ const ENV *env;
++ const char *fmt;
++ va_dcl
++#endif
++{
++ DB_ENV *dbenv;
++
++ dbenv = env == NULL ? NULL : env->dbenv;
++#if defined(DEBUG_LOCK)
++ DB_REAL_MSG(dbenv, fmt);
++#endif
++}
++
++
++/*
+ * __db_repmsg --
+ * Replication system message routine.
+ *
+Index: db-6.0.30/src/lock/lock_failchk.c
+===================================================================
+--- db-6.0.30.orig/src/lock/lock_failchk.c 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/src/lock/lock_failchk.c 2015-07-07 15:37:03.169735082 +0800
+@@ -80,7 +80,7 @@
+ * Discard the locker and its read locks.
+ */
+ if (!SH_LIST_EMPTY(&lip->heldby)) {
+- __db_msg(env, DB_STR_A("2053",
++ __db_lock_msg(env, DB_STR_A("2053",
+ "Freeing read locks for locker %#lx: %s",
+ "%#lx %s"), (u_long)lip->id,
+ dbenv->thread_id_string(
+Index: db-6.0.30/src/mutex/mut_failchk.c
+===================================================================
+--- db-6.0.30.orig/src/mutex/mut_failchk.c 2015-07-07 15:25:16.737736844 +0800
++++ db-6.0.30/src/mutex/mut_failchk.c 2015-07-07 15:37:30.897735013 +0800
+@@ -60,7 +60,7 @@
+ dbenv, mutexp->pid, unused, DB_MUTEX_PROCESS_ONLY))
+ continue;
+
+- __db_msg(env, DB_STR_A("2017",
++ __db_lock_msg(env, DB_STR_A("2017",
+ "Freeing mutex %lu for process: %s", "%lu %s"), (u_long)i,
+ dbenv->thread_id_string(dbenv, mutexp->pid, unused, buf));
+
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
index 9eae5c7..6e2600c 100644
--- a/meta/recipes-support/db/db_6.0.30.bb
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -19,6 +19,7 @@ SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
file://fix-parallel-build.patch \
file://Makefile-let-libso_target-depend-on-bt_rec.patch \
+ file://db-add-debug-lock-option.patch;patchdir=.. \
"
SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b"
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][V2] db: add debug_lock option to show diagnostic info
2015-07-07 8:17 [PATCH][V2] db: add debug_lock option to show diagnostic info Zhixiong Chi
@ 2015-07-07 8:19 ` Zhixiong Chi
2015-07-10 22:29 ` Burton, Ross
1 sibling, 0 replies; 4+ messages in thread
From: Zhixiong Chi @ 2015-07-07 8:19 UTC (permalink / raw)
To: liezhi.yang, openembedded-core
Changes:
1. add upstream-status and sob
2.modify the error in .bb file
On 2015年07月07日 16:17, Zhixiong Chi wrote:
> Add debug_lock option to show lock diagnostic information instead of
> outputing directly.
> We can enable it with using "./configure ... --enable-debug_lock".
>
> Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
> ---
> .../db/db/db-add-debug-lock-option.patch | 151 +++++++++++++++++++++
> meta/recipes-support/db/db_6.0.30.bb | 1 +
> 2 files changed, 152 insertions(+)
> create mode 100644 meta/recipes-support/db/db/db-add-debug-lock-option.patch
>
> diff --git a/meta/recipes-support/db/db/db-add-debug-lock-option.patch b/meta/recipes-support/db/db/db-add-debug-lock-option.patch
> new file mode 100644
> index 0000000..72bdb84
> --- /dev/null
> +++ b/meta/recipes-support/db/db/db-add-debug-lock-option.patch
> @@ -0,0 +1,151 @@
> +Summary: db: add debug_lock option to show diagnostic info
> +
> +add debug_lock into configure to show diagnostic info
> +
> +Upstream-Status: Submitted
> +
> +Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
> +Index: db-6.0.30/dist/config.hin
> +===================================================================
> +--- db-6.0.30.orig/dist/config.hin 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/dist/config.hin 2015-07-07 15:31:44.097735878 +0800
> +@@ -21,6 +21,9 @@
> + /* Define to 1 if you want a version that logs write operations. */
> + #undef DEBUG_WOP
> +
> ++/* Define to 1 if you want a version that logs write/read lock operations. */
> ++#undef DEBUG_LOCK
> ++
> + /* Define to 1 if you want a version with run-time diagnostic checking. */
> + #undef DIAGNOSTIC
> +
> +Index: db-6.0.30/dist/configure
> +===================================================================
> +--- db-6.0.30.orig/dist/configure 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/dist/configure 2015-07-07 15:34:45.841735425 +0800
> +@@ -862,6 +862,7 @@
> + enable_debug
> + enable_debug_rop
> + enable_debug_wop
> ++enable_debug_lock
> + enable_diagnostic
> + enable_dump185
> + enable_java
> +@@ -1556,6 +1557,7 @@
> + --enable-debug Build a debugging version.
> + --enable-debug_rop Build a version that logs read operations.
> + --enable-debug_wop Build a version that logs write operations.
> ++ --enable-debug_lock Build a version that logs write/read lock operations.
> + --enable-diagnostic Build a version with run-time diagnostics.
> + --enable-dump185 Build db_dump185(1) to dump 1.85 databases.
> + --enable-java Build Java API.
> +@@ -3323,6 +3325,18 @@
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_debug_wop" >&5
> + $as_echo "$db_cv_debug_wop" >&6; }
> +
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-debug_lock option specified" >&5
> ++$as_echo_n "checking if --enable-debug_lock option specified... " >&6; }
> ++# Check whether --enable-debug_lock was given.
> ++if test "${enable_debug_lock+set}" = set; then :
> ++ enableval=$enable_debug_lock; db_cv_debug_lock="$enable_debug_lock"
> ++else
> ++ db_cv_debug_lock="no"
> ++fi
> ++
> ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_debug_lock" >&5
> ++$as_echo "$db_cv_debug_lock" >&6; }
> ++
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-diagnostic option specified" >&5
> + $as_echo_n "checking if --enable-diagnostic option specified... " >&6; }
> + # Check whether --enable-diagnostic was given.
> +@@ -3835,6 +3849,11 @@
> +
> +
> + fi
> ++if test "$db_cv_debug_lock" = "yes"; then
> ++ $as_echo "#define DEBUG_LOCK 1" >>confdefs.h
> ++
> ++
> ++fi
> + if test "$db_cv_umrw" = "yes"; then
> + $as_echo "#define UMRW 1" >>confdefs.h
> +
> +Index: db-6.0.30/dist/configure.ac
> +===================================================================
> +--- db-6.0.30.orig/dist/configure.ac 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/dist/configure.ac 2015-07-07 15:35:12.465735359 +0800
> +@@ -134,6 +134,11 @@
> + AH_TEMPLATE(DEBUG_WOP,
> + [Define to 1 if you want a version that logs write operations.])
> + fi
> ++if test "$db_cv_debug_lock" = "yes"; then
> ++ AC_DEFINE(DEBUG_LOCK)
> ++ AH_TEMPLATE(DEBUG_LOCK,
> ++ [Define to 1 if you want a version that logs write/read lock operations.])
> ++fi
> + if test "$db_cv_umrw" = "yes"; then
> + AC_DEFINE(UMRW)
> + AH_TEMPLATE(UMRW,
> +Index: db-6.0.30/src/common/db_err.c
> +===================================================================
> +--- db-6.0.30.orig/src/common/db_err.c 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/src/common/db_err.c 2015-07-07 15:36:45.329735127 +0800
> +@@ -648,6 +648,32 @@
> + }
> +
> + /*
> ++ * __db_lock_msg --
> ++ * Standard DB lock stat message routine.
> ++ *
> ++ * PUBLIC: void __db_lock_msg __P((const ENV *, const char *, ...))
> ++ * PUBLIC: __attribute__ ((__format__ (__printf__, 2, 3)));
> ++ */
> ++void
> ++#ifdef STDC_HEADERS
> ++__db_lock_msg(const ENV *env, const char *fmt, ...)
> ++#else
> ++__db_lock_msg(env, fmt, va_alist)
> ++ const ENV *env;
> ++ const char *fmt;
> ++ va_dcl
> ++#endif
> ++{
> ++ DB_ENV *dbenv;
> ++
> ++ dbenv = env == NULL ? NULL : env->dbenv;
> ++#if defined(DEBUG_LOCK)
> ++ DB_REAL_MSG(dbenv, fmt);
> ++#endif
> ++}
> ++
> ++
> ++/*
> + * __db_repmsg --
> + * Replication system message routine.
> + *
> +Index: db-6.0.30/src/lock/lock_failchk.c
> +===================================================================
> +--- db-6.0.30.orig/src/lock/lock_failchk.c 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/src/lock/lock_failchk.c 2015-07-07 15:37:03.169735082 +0800
> +@@ -80,7 +80,7 @@
> + * Discard the locker and its read locks.
> + */
> + if (!SH_LIST_EMPTY(&lip->heldby)) {
> +- __db_msg(env, DB_STR_A("2053",
> ++ __db_lock_msg(env, DB_STR_A("2053",
> + "Freeing read locks for locker %#lx: %s",
> + "%#lx %s"), (u_long)lip->id,
> + dbenv->thread_id_string(
> +Index: db-6.0.30/src/mutex/mut_failchk.c
> +===================================================================
> +--- db-6.0.30.orig/src/mutex/mut_failchk.c 2015-07-07 15:25:16.737736844 +0800
> ++++ db-6.0.30/src/mutex/mut_failchk.c 2015-07-07 15:37:30.897735013 +0800
> +@@ -60,7 +60,7 @@
> + dbenv, mutexp->pid, unused, DB_MUTEX_PROCESS_ONLY))
> + continue;
> +
> +- __db_msg(env, DB_STR_A("2017",
> ++ __db_lock_msg(env, DB_STR_A("2017",
> + "Freeing mutex %lu for process: %s", "%lu %s"), (u_long)i,
> + dbenv->thread_id_string(dbenv, mutexp->pid, unused, buf));
> +
> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
> index 9eae5c7..6e2600c 100644
> --- a/meta/recipes-support/db/db_6.0.30.bb
> +++ b/meta/recipes-support/db/db_6.0.30.bb
> @@ -19,6 +19,7 @@ SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
> SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
> file://fix-parallel-build.patch \
> file://Makefile-let-libso_target-depend-on-bt_rec.patch \
> + file://db-add-debug-lock-option.patch;patchdir=.. \
> "
>
> SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b"
--
---------------------
Thanks,
Zhixiong Chi
Tel: +86-10-8477-7036
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][V2] db: add debug_lock option to show diagnostic info
2015-07-07 8:17 [PATCH][V2] db: add debug_lock option to show diagnostic info Zhixiong Chi
2015-07-07 8:19 ` Zhixiong Chi
@ 2015-07-10 22:29 ` Burton, Ross
2015-07-14 6:02 ` Zhixiong Chi
1 sibling, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2015-07-10 22:29 UTC (permalink / raw)
To: Zhixiong Chi; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
On 7 July 2015 at 09:17, Zhixiong Chi <zhixiong.chi@windriver.com> wrote:
> +Index: db-6.0.30/dist/configure
>
Don't patch generated files as they'll change drastically over time and
make maintaining the patch impossible.
Also if the patch has been submitted upstream, including a link to the
submission (bug, list thread, etc) is helpful when doing upgrades in the
future.
Ross
[-- Attachment #2: Type: text/html, Size: 876 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][V2] db: add debug_lock option to show diagnostic info
2015-07-10 22:29 ` Burton, Ross
@ 2015-07-14 6:02 ` Zhixiong Chi
0 siblings, 0 replies; 4+ messages in thread
From: Zhixiong Chi @ 2015-07-14 6:02 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Oh, I'm sorry for making a mistake, and it should be upstream-status:
pending.
On 2015年07月11日 06:29, Burton, Ross wrote:
>
> On 7 July 2015 at 09:17, Zhixiong Chi <zhixiong.chi@windriver.com
> <mailto:zhixiong.chi@windriver.com>> wrote:
>
> +Index: db-6.0.30/dist/configure
>
>
> Don't patch generated files as they'll change drastically over time
> and make maintaining the patch impossible.
>
> Also if the patch has been submitted upstream, including a link to the
> submission (bug, list thread, etc) is helpful when doing upgrades in
> the future.
>
> Ross
--
---------------------
Thanks,
Zhixiong Chi
Tel: +86-10-8477-7036
[-- Attachment #2: Type: text/html, Size: 1907 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-14 6:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-07 8:17 [PATCH][V2] db: add debug_lock option to show diagnostic info Zhixiong Chi
2015-07-07 8:19 ` Zhixiong Chi
2015-07-10 22:29 ` Burton, Ross
2015-07-14 6:02 ` Zhixiong Chi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.