Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp240788img; Mon, 18 Mar 2019 02:00:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLRaI3iQcmj245/pvd0MKHJ8Bq4GWZfxLSvYECFY9bacP461vIyIzDYdZGGlWLc52OuDbx X-Received: by 2002:aa7:8c48:: with SMTP id e8mr18082360pfd.166.1552899634934; Mon, 18 Mar 2019 02:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552899634; cv=none; d=google.com; s=arc-20160816; b=YLDPEiAA9FtnH+o9lyOi0XID9V55u4ciAnTN1ny0U1zLZKT9IaXk6orkv+6nMyVpwt fOUOijQZvD4wgtt4EE1YH+E+d7sipWEhEEOFhpFUq94nHNER5ViBUNT7lvE7RIDvALKX tWYGCwX8D5ciDDU9Qld3k3AsLIdGYR0+d03M4vm2dwB3GnMOJdYvFplwyVu2b0fYm8nM yCMlz/IWqCnrm9XIKFaG6s1KY3sPPDxCwFU1NDGTw9UtZG/bik9PufpCqyb9vY4CZ89G ibGf3iPv+YJsCyK2zv0ehPnLFpH8LNJoKY88xmks43ZyQK7xuES1+YSg+2MWv0hnHEnC 9EAA== 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=YJ4hR04oCeglYCDV44cDVhsUlXY+OAoo1KN3TEl10V4=; b=DGJ6QjO0cQtGriQSoD84iaS9q31OK2v12B28guW9fxD927To/YyyGwziP+6noT8t/o y81VQzwB92CtBDCJ0LZ0vC1t2916KVJiDafZ2YwbofHKwJIx/NbpXF6gJSlE4/zjerVP soQReobBGrtME64COjA92+4gwJjOtv/kIOV/nDgKqhzd50bYyhmQHLuhSLkZmhCANt5H 1ob6PxFJIFslV8jO7TPTQAnp6S0OSBN4VdWHa2J+yVYh5z5Ogt8C4tirxQcxp2PWDRA+ X3+gImo+x3Q/QXsf0HBzrov/Hh4Uh0aw9M+mi3r92LYbWWOUMFw2O/7mSevL/wiVYAh3 HoTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pwj9ZcR0; 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 s68si8635563pgb.199.2019.03.18.02.00.19; Mon, 18 Mar 2019 02:00:34 -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=pwj9ZcR0; 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 S1726982AbfCRI7L (ORCPT + 99 others); Mon, 18 Mar 2019 04:59:11 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42847 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbfCRI6B (ORCPT ); Mon, 18 Mar 2019 04:58:01 -0400 Received: by mail-pg1-f194.google.com with SMTP id b2so10894638pgl.9 for ; Mon, 18 Mar 2019 01:58:00 -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=YJ4hR04oCeglYCDV44cDVhsUlXY+OAoo1KN3TEl10V4=; b=pwj9ZcR0DUq2lQEMmgEiodhleKRoB1tGE2GNpVVptqZmnyqp2Ya/lT27fbSm7MPj3A WtuaDgVba3SFX+PU3uz8Jm1ZrDxRrFKCrUO375+f0//fziWR88Lq9eZIDQosmhZjQpb0 ku6UcROK10eDmfAkdT7uZWe2d1WJOM1osNsMBs4BoPUrmrNBTOHDIAEHtUxwCCrq9BGN zX481eCgvanKcYEdSoN1MrXhfxNkSiGLYspBgCyEIvhQ9qP0zOz0LiYrAjkHjUrfRzEx klgztcYcxmyPGHsrG42ugMoC+Rm7ogIW0FzU1eIAQUCGDBE8VTtGRsJFE02mV902LVv1 FLjA== 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=YJ4hR04oCeglYCDV44cDVhsUlXY+OAoo1KN3TEl10V4=; b=WtVP65Y5s7VWqPxwQac35gUZNDVsgGaMquuY40XAvFwb82H6hzZedpAWWUdArjYbCK 87stchklryCFSzm7iIuCqU35COYLZcvBeSDoqKHtKQWR7QU4h9PLIRgcHYhJEVbOL+tm 2a6fU+HcwtSNARGSIDwsO5rWRm+YAcD5xXi3P8Idb5LZ/vRbNyksqB4Sjts3wJ7Q/RIx xPE3dioDCmQ3gFBLioqrv3b4YM+o6v1NFGzg0AZLTwxbT4G1xmVTJsqJ67PN+r3yFi3i N5tnjmDDR0UYV/jSmNYS7AR+GW7WMF95pjFUB6231U1nXCLknAL3sDAKQ2f1kbCb1xHU tUhQ== X-Gm-Message-State: APjAAAU88Dpgyu6InAXNSKoYtsRlY29TGaWPbAV3DXOCvpwLTfG0IxGB FgavjZcyQ4rE1yBCTpzqFzE= X-Received: by 2002:a17:902:26f:: with SMTP id 102mr6222145plc.175.1552899480458; Mon, 18 Mar 2019 01:58:00 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id k8sm11147024pgq.37.2019.03.18.01.57.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 01:57:59 -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, Yuyang Du Subject: [PATCH v2 06/19] locking/lockdep: Print the right depth for chain key colission Date: Mon, 18 Mar 2019 16:57:20 +0800 Message-Id: <20190318085733.3143-7-duyuyang@gmail.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20190318085733.3143-1-duyuyang@gmail.com> References: <20190318085733.3143-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 320ab62..3df0a5e 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2425,10 +2425,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