Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2001265ybt; Mon, 15 Jun 2020 15:27:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvXVeJikTOopZrRmkVNMogHoi2fneHtpYowbjGhJG9BIrVn1JJPoqoDFPgnIqGIohX7000 X-Received: by 2002:a17:906:90d4:: with SMTP id v20mr27105407ejw.471.1592260051272; Mon, 15 Jun 2020 15:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592260051; cv=none; d=google.com; s=arc-20160816; b=OKtzpl+tAMQ2fIXwHg+U6J/RTHT777a1gk/8/lv7DQxrNMg35niTovM6x4rK9tX9sg 52L6xKVUxKcQskztH57wEjl8m428fmOIYbU2EKRkGYVSSEoG6rvjyKhWrfdx0XPoa6+B b7Iim9qhO3IQ4JrBLBZ/hBPywjV4swMoyzUFCCA9FshnptGSzBNfnxbjDWgWNExQ8teA cjI0CgQWXPM1mN/VwiTFLUsYjtuDOFsEXpjxfYNNOFGuA2MTxecxAa7hYjbyDlapCkUf KIHn5WtDlPcp2V6h1RFo9E79LXdCj2ZdksLQpoli9F6GoHsrX5hl0qwjM4BOcBwBbylk RP+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tuIIrak01g0hi6jlAmzJptgtTYRj+2Xe7G+WSfhiPv4=; b=ZLStecULu7ysFFhRDdTD7oiDNicKhlDuwLRoBJoI8s8MkMgpgpp4Uo8Wby0W7uwjoA CERIrX3AIVs2U/c5BxvNou3F6+Lc9spxeHmWG56PeCq2qHf4WB9DTzNpmDiD0DLNuzT9 jatNpyphrML16E9ZC08S7O7c4wSiUCKz9oIIkrYKkqtiiq3FDYcmzTAeyVu4zs6wtU5D +qkqm8r/2aAI6iqgkI5STONIV353zDFniwbdPuygFwa3h7tfFFMDjMPChqabPrp7zWjN IouYhktSC1VVMsgClVPGi1P3JQHetqy65fTa/698NdjXNgZdp4KDOPaV5YarF9L1yP2Y o46g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fm332kqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si9701724ejm.613.2020.06.15.15.27.09; Mon, 15 Jun 2020 15:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fm332kqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbgFOWYh (ORCPT + 99 others); Mon, 15 Jun 2020 18:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:46844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgFOWYh (ORCPT ); Mon, 15 Jun 2020 18:24:37 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A741F2078E; Mon, 15 Jun 2020 22:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592259876; bh=KWh5J5k82sVWOKhsLlTlA3MMs+VaPo6HtzKgdAqj3gc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fm332kqAcKPY58cxjfrBAa0U+cPm1d37yxXU4xy0yAiEAk6+Tis7TsOdmuDqIT9c6 uP+Pw7JYBUSWMTIub2afbMrpW/JOyYcfCrur3haOyMIgfJsuulgJTeyPaLT0kQRi7I /8h5DCS+z9wkeb3SdmRelLjCOjrmWPnyPBwi3BpQ= From: Sasha Levin To: torvalds@linux-foundation.org Cc: skhan@linuxfoundation.org, koct9i@gmail.com, jroedel@suse.de, luto@kernel.org, peterz@infradead.org, tiwai@suse.com, linux-kernel@vger.kernel.org, x86@kernel.org, Sasha Levin Subject: [PATCH] scripts/decode_stacktrace: warn when modpath is needed but is unset Date: Mon, 15 Jun 2020 18:24:27 -0400 Message-Id: <20200615222427.60126-1-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a user tries to parse a symbol located inside a module he must have modpath set. Otherwise, decode_stacktrace won't be able to parse the symbol correctly. Right now the failure is silent and easily missed by the user. What's worse is that by the time the user realizes what happened (or someone on LKML asks him to add the modpath and re-run), he might have already got rid of the vmlinux/modules. Signed-off-by: Sasha Levin --- scripts/decode_stacktrace.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 13e5fbafdf2f..2c9ee4beb545 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -27,7 +27,10 @@ parse_symbol() { elif [[ "${modcache[$module]+isset}" == "isset" ]]; then local objfile=${modcache[$module]} else - [[ $modpath == "" ]] && return + if [[ $modpath == "" ]]; then + echo "WARNING! Modules path isn't set, but is needed to parse this symbol" >&2 + return + fi local objfile=$(find "$modpath" -name "${module//_/[-_]}.ko*" -print -quit) [[ $objfile == "" ]] && return modcache[$module]=$objfile -- 2.25.1