Acked-by: Andy Zhou <[email protected]>
How about fold in the following changes as well?
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index 83dfd62..9b6a9a5 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -62,7 +62,7 @@ static bool multithreaded;
\
error = pthread_##TYPE##_##FUN(&l->lock); \
if (OVS_UNLIKELY(error)) { \
- ovs_abort(error, "pthread_%s_%s failed", #TYPE, #FUN); \
+ ovs_abort(error, "%s: pthread_%s_%s failed", where, #TYPE, #FUN); \
} \
l->where = where; \
}
On Tue, May 6, 2014 at 3:15 PM, Ben Pfaff <[email protected]> wrote:
> This makes the message issued refer to the file and line that called
> ovs_mutex_lock(), instead of to the file and line *inside*
> ovs_mutex_lock().
>
> Signed-off-by: Ben Pfaff <[email protected]>
> ---
> lib/ovs-thread.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
> index fbdd7fc..83dfd62 100644
> --- a/lib/ovs-thread.c
> +++ b/lib/ovs-thread.c
> @@ -55,7 +55,10 @@ static bool multithreaded;
> int error; \
> \
> /* Verify that 'l' was initialized. */ \
> - ovs_assert(l->where); \
> + if (OVS_UNLIKELY(!l->where)) { \
> + ovs_abort(0, "%s: %s() passed uninitialized ovs_"#TYPE, \
> + where, __func__); \
> + } \
> \
> error = pthread_##TYPE##_##FUN(&l->lock); \
> if (OVS_UNLIKELY(error)) { \
> @@ -77,7 +80,10 @@ LOCK_FUNCTION(rwlock, wrlock);
> int error; \
> \
> /* Verify that 'l' was initialized. */ \
> - ovs_assert(l->where); \
> + if (OVS_UNLIKELY(!l->where)) { \
> + ovs_abort(0, "%s: %s() passed uninitialized ovs_"#TYPE, \
> + where, __func__); \
> + } \
> \
> error = pthread_##TYPE##_##FUN(&l->lock); \
> if (OVS_UNLIKELY(error) && error != EBUSY) { \
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> [email protected]
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev