From patchwork Thu Mar 3 11:41:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 63464 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2894911lbc; Thu, 3 Mar 2016 03:43:37 -0800 (PST) X-Received: by 10.66.235.9 with SMTP id ui9mr2911150pac.135.1457005416923; Thu, 03 Mar 2016 03:43:36 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si32595585pfj.62.2016.03.03.03.43.36; Thu, 03 Mar 2016 03:43:36 -0800 (PST) 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; 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757362AbcCCLla (ORCPT + 30 others); Thu, 3 Mar 2016 06:41:30 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35137 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754739AbcCCLlX (ORCPT ); Thu, 3 Mar 2016 06:41:23 -0500 Received: by mail-wm0-f46.google.com with SMTP id l68so127168160wml.0 for ; Thu, 03 Mar 2016 03:41:23 -0800 (PST) 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=eKPnKxQTlCZABsqR4fc/xIGptNxTUL0UpPv4P3AagLal1Qf8dmIt9NDtB94Hs8Cahs W8RKOxch8ihH1xslae1FmCGQOdSShY6pIryPFcT0M8TPs5mXcmrZUFtTB5lnYb1Tv/E0 epZ59dwQ0Eyde8sextuiTo5eMi/RuAZCuxk5s= 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=SVmixwj7jmc8Up67Oa+THNsGUWV2nQQfFt7KApAfCvMC8L+8nWNYpgj7Q2sArI2xHw jXBTrE7A9DLmFuR4xTOCW0KeDstkFGjsoznfqiaXirZglWn/+3RUW2W+kXwOuHxI+Qwp 0qG3zTTPG5X3P4dnMzxiW7kMZL38sGbV9VRbPdJ99orGald04JZL4Q4j2M65yeYAr1sn mRlo0Nz+LEBd5lQrnGVFWUqeJwWlfiev4XK7le0DWviUx0qrxvdBwct3Ys6tjzdfAfjz Yun29INfMdHL7N4G/uaZjZynrFxSg47oMA6UTtpFDHA3JdtJ2nPtrXc5PUl/UBlxrbVt O0tg== X-Gm-Message-State: AD7BkJLY2xqb/BUtajulO0soZSrkEc5ncggq2YkK6/Fb9WRu8Assuf3DWWcF+AshXIC93nAy X-Received: by 10.194.185.180 with SMTP id fd20mr2600451wjc.98.1457005282618; Thu, 03 Mar 2016 03:41:22 -0800 (PST) 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 e19sm8570696wmd.1.2016.03.03.03.41.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Mar 2016 03:41:22 -0800 (PST) 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: [PATCHv3 06/13] scripts/gdb: Provide a dentry_name VFS path helper Date: Thu, 3 Mar 2016 11:41:00 +0000 Message-Id: <1457005267-843-7-git-send-email-kieran.bingham@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457005267-843-1-git-send-email-kieran.bingham@linaro.org> References: <1457005267-843-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()