From patchwork Wed Mar 30 12:00:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 64695 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2551288lbc; Wed, 30 Mar 2016 05:03:30 -0700 (PDT) X-Received: by 10.66.157.69 with SMTP id wk5mr12223768pab.40.1459339410538; Wed, 30 Mar 2016 05:03:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si6121539pap.88.2016.03.30.05.03.30; Wed, 30 Mar 2016 05:03:30 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753522AbcC3MD2 (ORCPT + 29 others); Wed, 30 Mar 2016 08:03:28 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36376 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857AbcC3MBN (ORCPT ); Wed, 30 Mar 2016 08:01:13 -0400 Received: by mail-wm0-f53.google.com with SMTP id 127so94429725wmu.1 for ; Wed, 30 Mar 2016 05:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KROS6uwImvjooow8x83hIBCGZVCttj7W+5mXtA44FUM=; b=D/cq3Fny7sRcILl9LjrVyaKQcLcNaGY88/H2DdCffw0XvvpbCiLbkAfgwkWltYC3AY 3nZNLZ6uzdTMaDiwNapYH8Cz7yMCrqb7zxY5CS0dQrga6Fce7L01i+rEEUla6+qWzkKN kmHjjaqrf9F01f0ppw24J6jfSJ9FEgQH2ulTc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KROS6uwImvjooow8x83hIBCGZVCttj7W+5mXtA44FUM=; b=Rjwix0etdCnp00U+NYvLiO6qaNoicB79GCNPpy4cgjLDtXhdrI5rytgfM/LZlXYwQI u3G72MwohWxVbJwsf6xF3YCnnQTrjSbQj0shO6/3TxPsgB1MJtCVU0VKuZl6arWKk42R GFTh2weO3mWMVNBVpKUxGpUjGuAx7aZ5nKt/rLBM749fj4j+LFadsdu39eTjddge2hby 0K92lJNW7J/beu/69QqonYGolxBbnIXCrpfIL4XvYiJR8HybJJpFuIuj7ydhY8SRC3xz UgVC/tEhw8ImwtwHuUKWEtuZvh4gTLMz9eCxUXQVhhr0a1sQIaUqVtm6SLjlI2qV0CU6 v/Kg== X-Gm-Message-State: AD7BkJJpcxnm9CFouAwvNdESB9Xc/Q0EQEXAen5tBUf1UfuP5zWkWeDH0xNxJO6Ig/a1yFy8 X-Received: by 10.28.177.134 with SMTP id a128mr10134271wmf.55.1459339272019; Wed, 30 Mar 2016 05:01:12 -0700 (PDT) Received: from localhost.localdomain (cpc87017-aztw30-2-0-cust65.18-1.cable.virginm.net. [92.232.232.66]) by smtp.gmail.com with ESMTPSA id e190sm1175530wma.15.2016.03.30.05.01.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 05:01:11 -0700 (PDT) From: Kieran Bingham To: jan.kiszka@siemens.com, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, peter.griffin@linaro.org, maxime.coquelin@st.com, Kieran Bingham Subject: [PATCHv4 06/12] scripts/gdb: Provide a dentry_name VFS path helper Date: Wed, 30 Mar 2016 13:00:45 +0100 Message-Id: <1459339251-29611-7-git-send-email-kieran.bingham@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459339251-29611-1-git-send-email-kieran.bingham@linaro.org> References: <1459339251-29611-1-git-send-email-kieran.bingham@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Walk the VFS entries, pre-pending the iname strings to generate a full VFS path name from a dentry. Signed-off-by: Kieran Bingham --- Changes since v2: - dentry_name separated out from proc module for use elsewhere --- scripts/gdb/linux/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.5.0 diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py index dbe2ad78048c..de03a6b505bb 100644 --- a/scripts/gdb/linux/utils.py +++ b/scripts/gdb/linux/utils.py @@ -161,3 +161,11 @@ def gdb_eval_or_none(expresssion): return gdb.parse_and_eval(expresssion) except: return None + + +def dentry_name(d): + parent = d['d_parent'] + if parent == d or parent == 0: + return "" + p = dentry_name(d['d_parent']) + "/" + return p + d['d_iname'].string()