From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754159AbcKULaH (ORCPT ); Mon, 21 Nov 2016 06:30:07 -0500 Received: from mga04.intel.com ([192.55.52.120]:43771 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752452AbcKULaG (ORCPT ); Mon, 21 Nov 2016 06:30:06 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,675,1473145200"; d="scan'208";a="789029288" From: "Kirill A. Shutemov" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Sasha Levin , Konstantin Khlebnikov Subject: [PATCH] scripts/decode_stacktrace.sh: canonicalize basepath and modpath Date: Mon, 21 Nov 2016 14:29:56 +0300 Message-Id: <20161121112956.44948-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.10.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I use decode_stacktrace.sh as $ ./scripts/decode_stacktrace.sh vmlinux . . It means basepath is equal to "." and decode_stacktrace stips dot from the filepath instead of actual basepath. Not very helpful. Let's fix this. Canonicalize modepath too while I'm there. Signed-off-by: Kirill A. Shutemov Cc: Sasha Levin Cc: Konstantin Khlebnikov --- scripts/decode_stacktrace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index c332684e1b5a..27e3cb7a14e8 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -9,8 +9,8 @@ if [[ $# < 2 ]]; then fi vmlinux=$1 -basepath=$2 -modpath=$3 +basepath=$(readlink -ev "$2") +modpath=$(readlink -ev "$3") declare -A cache declare -A modcache @@ -77,7 +77,7 @@ parse_symbol() { fi # Strip out the base of the path - code=${code//$basepath/""} + code=${code//$basepath\//""} # In the case of inlines, move everything to same line code=${code//$'\n'/' '} -- 2.10.2