Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp432084img; Thu, 21 Mar 2019 01:01:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEQF4ukdRzDi0aPoLzRCMRcJwCaxA9d1uOYeBXpGowDiemmWylx+KPRc0ue6q4sl/5mVPp X-Received: by 2002:a65:6148:: with SMTP id o8mr2155446pgv.442.1553155309152; Thu, 21 Mar 2019 01:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553155309; cv=none; d=google.com; s=arc-20160816; b=OCpFv+YmTB7zl6JgUIXZm4dWtxEoob/FTXT8zQGz4dp5dWB9eO3BywBD/x6KBwRkwV XArjf7pBs1k6QmysXbXG8vjo3QoiG+aBuRa/6qtSoabOhWou9d/TGGnq9OpEM3W86Bq3 ZfD7kADUOw4BXvYJHHUJhGkQiD83A0rm4P3o6yoyE1Pyxk5RCBBprshutVNUPG7DTRHI 9ewQhDC83puUPru18Lk0WfFgEPofyTDdIdUw4XADiCkq92PjOXkeWHyr5EQP9OW70Ca1 C7F4kphqCWm/9c+liwOUNb/uUsSfGvlIViNDbTd0G+i0uC0K7/Lbh1cIYGpNHW7q82oQ 42UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LUrYg5gPfr5+YxKSU7WKTSl4E1D61tEu6638WRvIWF8=; b=IJKjFVKVqb0lZHfaWBVyI+omvN4PjDI5JPl8KKM7iC/fesIQuVnKQ9Y3bpYVtDG9Uj AYgYXr58yuayVvwnlQNKOXjYQrQ/DaQzoC4rrYIkSG4J/ScE1o89lL7XoNNWb9jg2Q+U xthaAMBst7LHV4mOqo0/d4p1dsaXeczWR065DmWMri4EHN27WcyzLYqbjX8wbCFWzI96 p/2mrGTp93lIsjDn2ONNNM3A4noAOm6lgFVKcy/tox7PyIBhp87cCliZtHi9pt+F6o04 fNZzrx3NdAyyNc99WwQHeVQ+C2rWx7L7qcZKR0bZIWVx4Xq+nS/rLUtYXwMCZRr0RWIO Mo5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i77uOOny; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si3386669pgq.423.2019.03.21.01.01.33; Thu, 21 Mar 2019 01:01:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i77uOOny; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727977AbfCUH5v (ORCPT + 99 others); Thu, 21 Mar 2019 03:57:51 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36674 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbfCUH5t (ORCPT ); Thu, 21 Mar 2019 03:57:49 -0400 Received: by mail-pf1-f196.google.com with SMTP id p10so3796989pff.3 for ; Thu, 21 Mar 2019 00:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LUrYg5gPfr5+YxKSU7WKTSl4E1D61tEu6638WRvIWF8=; b=i77uOOnyP+f7aBg07jhf5PvpcDyoT0OZyYqGV5d8al+HiI9IYK5R+OoyUfCPXXqNot Wa5kyTWPMLTNoaXhzVyz5lrcHAzSAurKK2m78S0tm+YsJiwtqgGoBD8jkpuuegTDn1UA eYHOHgdamNQ9d3U90MJp4cgAZQxRLlhWKsWOqMUWnp2BmQJaZdkeTMPsXL3tvsFrQ81W ANb/OeqY0TqcnwCpcjEM/LjD0rXXvYCKkMxM/1+7rUU0PsKa5qFxwGFiKPUkhapx3w00 k91Jd4ZaD7akczE47g8pPaJeDiAL0t7+L1MKBvpbiid8p8AS3QOGwINOK2/bTe/nprr+ MMgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LUrYg5gPfr5+YxKSU7WKTSl4E1D61tEu6638WRvIWF8=; b=b9ZodvzxE4CU6mOy7e7/S9v4/J8ERr99EK19RlfsZPH2+4f5cqEGvkS+2xfEe1EAZy r/7qdec49Lcbl51clJ3eH048aYUd8LGzMip+6Lv6McAI8Af6+05tuJsmndXeDrIX3BW9 ZsQiCYcUa0IlxBsDTstoBv/emYRB5nDP/mWRCEH/0FVyWEmzNdoSFukq6RfLzT+0ulL9 yOS2kPgD4zsj0Qfws/gs6JxRq6rWiMuKHEV+mTzEKdm+PQLLdAWQgePgvnswyjxghEt1 UQe6O0ZIlAKpXLkpZB62V554Pgv3qGgMkKfFM7y+5BvMdMgqGX18LHTMVPUs4K1fsZRM bqVA== X-Gm-Message-State: APjAAAWA6k4IHW8NocjcP5PjVbXWpHhUDqzQs7jG5lWL/al1iSyq7pcF Td5I8tsTdwid85mwZq4WHNU= X-Received: by 2002:a62:45d2:: with SMTP id n79mr2011665pfi.213.1553155068396; Thu, 21 Mar 2019 00:57:48 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id e184sm6467148pfc.143.2019.03.21.00.57.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 00:57:47 -0700 (PDT) From: Yuyang Du To: peterz@infradead.org, will.deacon@arm.com, mingo@kernel.org Cc: bvanassche@acm.org, ming.lei@redhat.com, linux-kernel@vger.kernel.org, joe@perches.com, Yuyang Du Subject: [PATCH v3 05/18] locking/lockdep: Print the right depth for chain key colission Date: Thu, 21 Mar 2019 15:57:12 +0800 Message-Id: <20190321075725.14054-6-duyuyang@gmail.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20190321075725.14054-1-duyuyang@gmail.com> References: <20190321075725.14054-1-duyuyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since chains are separated by irq context, so when printing a chain the depth should be consistent with it. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index eeea722..05c31d6 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2428,10 +2428,11 @@ static u64 print_chain_key_iteration(int class_idx, u64 chain_key) struct held_lock *hlock; u64 chain_key = 0; int depth = curr->lockdep_depth; - int i; + int i = get_first_held_lock(curr, hlock_next); - printk("depth: %u\n", depth + 1); - for (i = get_first_held_lock(curr, hlock_next); i < depth; i++) { + printk("depth: %u (irq_context %u)\n", depth - i + 1, + hlock_next->irq_context); + for (; i < depth; i++) { hlock = curr->held_locks + i; chain_key = print_chain_key_iteration(hlock->class_idx, chain_key); -- 1.8.3.1