Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2662048yba; Fri, 17 May 2019 23:46:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9BtqtusLu13M6lYOprokfbj89lcKdEGEebU0bdiWvBrwEQCNO8vyKsvth0VPukDsDhhN5 X-Received: by 2002:a63:dd4a:: with SMTP id g10mr7855311pgj.419.1558161974966; Fri, 17 May 2019 23:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558161974; cv=none; d=google.com; s=arc-20160816; b=cEntXtAjuAb9Ilefl5XPIfsK86sLuvVlq+/djowNx2d4BUe+sqEf6EZ+b5JSC7791u HZBb+NWYqIGO2iWFlkqtAZtSVEACdBSFyLm8ssUrIIqtTT9UkF4Ajzur19cU01by+dXq eolFpmKP/z319zVlHoJX8oG61amy+XEwz84bdobKOt/n97EAiSkR0Jn/QIgKQNn1Jude 2T9bw8FH0u6DCN4QoGyvwCm2Nwf+/ZesTAr0k25bx7Xdi2ecuoURGTAJ8wW91+TcH4Fk SIRrG67uYBnB6XQPSjzVjMgOy03RcsvVYl+/lxXbOFcxi6prPjnwuJwwZ5VKjRRR8hSP Tqhw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=aS57w+JjSNQkH2rknXCc7Q22hExiMUTERsu/lABkOdw=; b=zmqLfKeXLj/h6gh4pcBDaXYriulh4oxtuFedbtIYuWhTfCrYYMAGl94hMgZLn10lEw nwQUMxqj8vRQqLLBmcrRis2ihhse1TVF3ixXdi9nJVg357Ln4P9Bf8oOmRYpW9g956KL LzVk3opVNgkvWuwkAvyaYBbWEScbeGbseSKxH6UQ4NhAllzeNk5WJItPxVlntqiH1Zo8 HETXpKZQU1ELevnbKzSqIoF0BBwfnoIdCSdeSNeIsxKDDZBlVBVidmPghlLg9Z3fPr4l i2bTU3CzdbXnJhObAHP+V9FqzbaBSryNdioz9Ftq8RVsSHNHvhCerM8s41Don8nY0gMI HXCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bujZ9xU5; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si10664174pln.144.2019.05.17.23.45.59; Fri, 17 May 2019 23:46:14 -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=@chromium.org header.s=google header.b=bujZ9xU5; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbfERF7w (ORCPT + 99 others); Sat, 18 May 2019 01:59:52 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33816 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbfERF7v (ORCPT ); Sat, 18 May 2019 01:59:51 -0400 Received: by mail-pl1-f193.google.com with SMTP id w7so4323369plz.1 for ; Fri, 17 May 2019 22:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aS57w+JjSNQkH2rknXCc7Q22hExiMUTERsu/lABkOdw=; b=bujZ9xU5Tx6d78rQ1gOjR1lDe0mK19wzpmNpSVgHo3HwkMdDaChHxoavIJFLDByJg+ MVLIrbIhCTBiQTzL6Pj4utmWdppNmXnyOmX/MOcc4gip/NJ9hTILgM8rdcDbfxCy4jhZ ppYqHwBe+SGYLjFC8s8LZ5gy7zO/X3E6KMENM= 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:mime-version :content-transfer-encoding; bh=aS57w+JjSNQkH2rknXCc7Q22hExiMUTERsu/lABkOdw=; b=fwLnkUIGqPfvZ8rUTkGgK0unjkzLYjVbgSIm3uvqZ2NurU3CAauJZCq1ZjFw93NRZM ozQEbYlzEGtvc2lQvpMq5c+Yw7gzSMIiPyxMkugTjnAihdyDN6dF3j4x4mXi04ZCICtm Azjc6AY040lUxwDNSRw7TjE+V0uFXiTuVHRnZfl504/1Mo43LHK+DROPtMmz4KwBP7S1 S98LPaa14zzs3BosNZQEwu40bH6D8jJdE9oqxoiQY6c8DeNQE/4oM2UuPKdOgjyWYBJe ovNkMqPW3ylU7YNOsy0pShTFEkoiY/BtDY+xNXtZPCEVq2JTlNKy/RMGCvNcShv6Rcvb xJrA== X-Gm-Message-State: APjAAAUY1wUxPgRaHHLeqDG/MlC18yt6C6fZafpY5ALXhwdxN7k9GiZr 2Xf1eEgGaeVcm8FQF0aYiPI5Gw== X-Received: by 2002:a17:902:2e83:: with SMTP id r3mr46277325plb.139.1558159191105; Fri, 17 May 2019 22:59:51 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id j12sm11599940pff.148.2019.05.17.22.59.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 22:59:50 -0700 (PDT) From: Nicolas Boichat To: Andrew Morton Cc: Konstantin Khlebnikov , Nicolas Boichat , Marc Zyngier , Stephen Boyd , linux-kernel@vger.kernel.org Subject: [PATCH] scripts/decode_stacktrace: Match basepath using shell prefix operator, not regex Date: Sat, 18 May 2019 13:59:46 +0800 Message-Id: <20190518055946.181563-1-drinkcat@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog 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 The basepath may contain special characters, which would confuse the regex matcher. ${var#prefix} does the right thing. Fixes: 67a28de47faa8358 ("scripts/decode_stacktrace: only strip base path when a prefix of the path") Signed-off-by: Nicolas Boichat Reviewed-by: Stephen Boyd --- I'm not sure how people normally use this script, but this seems to break even with a simple full path as parameter (e.g. /home/.../kernel/). scripts/decode_stacktrace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index bcdd45df3f5127a..e042acedcc0332c 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -85,7 +85,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.21.0.1020.gf2820cf01a-goog