Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130AbbK0HE0 (ORCPT ); Fri, 27 Nov 2015 02:04:26 -0500 Received: from goliath.siemens.de ([192.35.17.28]:59223 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbbK0HEX (ORCPT ); Fri, 27 Nov 2015 02:04:23 -0500 Subject: Re: [PATCH V2] scripts: fix the sys path for gdb scripts To: yalin wang , akpm@linux-foundation.org, mmarek@suse.cz, linux-kernel@vger.kernel.org References: <1448606469-25744-1-git-send-email-yalin.wang2010@gmail.com> From: Jan Kiszka Message-ID: <56580070.2050309@siemens.com> Date: Fri, 27 Nov 2015 08:04:16 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <1448606469-25744-1-git-send-email-yalin.wang2010@gmail.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3032 Lines: 90 On 2015-11-27 07:41, yalin wang wrote: > we insert __file__'s real path into sys.path, > so that no matter we import the vmlinux-gdb.py from $OUT floder or > from source code folder, we can always find the linux/ lib folder, > and we don't need create link to linux/*.py files, > remove the related make file. NACK again - I tell you why below. > > Signed-off-by: yalin wang > --- > scripts/Makefile | 1 - > scripts/gdb/Makefile | 1 - > scripts/gdb/linux/Makefile | 11 ----------- > scripts/gdb/vmlinux-gdb.py | 2 +- > 4 files changed, 1 insertion(+), 14 deletions(-) > delete mode 100644 scripts/gdb/Makefile > delete mode 100644 scripts/gdb/linux/Makefile > > diff --git a/scripts/Makefile b/scripts/Makefile > index 2016a64..72902b5 100644 > --- a/scripts/Makefile > +++ b/scripts/Makefile > @@ -36,7 +36,6 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms > subdir-y += mod > subdir-$(CONFIG_SECURITY_SELINUX) += selinux > subdir-$(CONFIG_DTC) += dtc > -subdir-$(CONFIG_GDB_SCRIPTS) += gdb > > # Let clean descend into subdirs > subdir- += basic kconfig package > diff --git a/scripts/gdb/Makefile b/scripts/gdb/Makefile > deleted file mode 100644 > index 62f5f65..0000000 > --- a/scripts/gdb/Makefile > +++ /dev/null > @@ -1 +0,0 @@ > -subdir-y := linux > diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile > deleted file mode 100644 > index 6cf1ecf..0000000 > --- a/scripts/gdb/linux/Makefile > +++ /dev/null > @@ -1,11 +0,0 @@ > -always := gdb-scripts > - > -SRCTREE := $(shell cd $(srctree) && /bin/pwd) > - > -$(obj)/gdb-scripts: > -ifneq ($(KBUILD_SRC),) > - $(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj) > -endif > - @: > - > -clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) This step I don't understand at all. Why do you want to destroy the possibility to automatically load the scripts? Did you read Documentation/gdb-kernel-debugging.txt in this regard? > diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py > index ce82bf5..a9029f4 100644 > --- a/scripts/gdb/vmlinux-gdb.py > +++ b/scripts/gdb/vmlinux-gdb.py > @@ -13,7 +13,7 @@ > > import os > > -sys.path.insert(0, os.path.dirname(__file__) + "/scripts/gdb") > +sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) This works only so far as that (if you don't destroy the link) the main script will still find its modules. However, *.pyc files are then generated in the source tree, no longer in the output dirs. The code is designed to prevent this. You still don't explain to us why the existing code doesn't work for you and how you prefer to use it instead. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/