Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbcC3MD2 (ORCPT ); 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 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 836 Lines: 30 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(+) 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() -- 2.5.0