Skip first frame when saving stacktraces, it's always witness_checkorder().
authormpi <mpi@openbsd.org>
Tue, 23 Mar 2021 10:22:20 +0000 (10:22 +0000)
committermpi <mpi@openbsd.org>
Tue, 23 Mar 2021 10:22:20 +0000 (10:22 +0000)
ok visa@

sys/kern/subr_witness.c

index e23db1c..ad50f29 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: subr_witness.c,v 1.46 2021/03/10 10:21:47 jsg Exp $   */
+/*     $OpenBSD: subr_witness.c,v 1.47 2021/03/23 10:22:20 mpi Exp $   */
 
 /*-
  * Copyright (c) 2008 Isilon Systems, Inc.
@@ -764,7 +764,7 @@ witness_checkorder(struct lock_object *lock, int flags,
 
        if (witness_cold || witness_watch < 1 || panicstr != NULL || db_active)
                return;
-       
+
        if ((lock->lo_flags & LO_INITIALIZED) == 0) {
                if (witness_uninitialized_report > 0) {
                        witness_uninitialized_report--;
@@ -2472,7 +2472,7 @@ witness_lock_order_add(struct witness *parent, struct witness *child)
        data->wlod_key = key;
        w_lohash.wloh_array[hash] = data;
        w_lohash.wloh_count++;
-       stacktrace_save(&data->wlod_stack);
+       stacktrace_save_at(&data->wlod_stack, 1);
        return (1);
 }