All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/tags.sh: Include tools directory in tags generation
@ 2022-06-18  0:54 Vipin Sharma
  2022-06-27 17:47 ` Vipin Sharma
  0 siblings, 1 reply; 7+ messages in thread
From: Vipin Sharma @ 2022-06-18  0:54 UTC (permalink / raw)
  To: gregkh, rkovhaev; +Cc: dmatlack, linux-kernel, Vipin Sharma

Add tools directory in generating tags and quiet the "No such file or
directory" warnings.

It reverts the changes introduced in commit 162343a876f1
("scripts/tags.sh: exclude tools directory from tags generation") while
maintainig the original intent of the patch to get rid of the warnings.
This allows the root level cscope files to include tools source code
besides kernel and a single place to browse the code for both.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
---

I have found myself many times to browse tools and other part of the
kernel code together. Excluding tools from the root level cscope makes
it difficult to efficiently move between files and find user api
definitions.

Root cause of these warning is due to generated .cmd files which use
relative paths in some files, I am not sure how to make them absolute
file paths which can satisfy realpath warnings. Also, not sure if those
warnings are helpful and should be kept. Passing "-q" to realpath seems
easier solution. Please, let me know if there is a better alternative.

Thanks

 scripts/tags.sh | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 01fab3d4f90b5..e137cf15aae9d 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -25,13 +25,6 @@ else
 	tree=${srctree}/
 fi
 
-# ignore userspace tools
-if [ -n "$COMPILED_SOURCE" ]; then
-	ignore="$ignore ( -path ./tools ) -prune -o"
-else
-	ignore="$ignore ( -path ${tree}tools ) -prune -o"
-fi
-
 # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
 if [ "${ALLSOURCE_ARCHS}" = "" ]; then
 	ALLSOURCE_ARCHS=${SRCARCH}
@@ -100,7 +93,7 @@ all_compiled_sources()
 		find $ignore -name "*.cmd" -exec \
 			grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
 		awk '!a[$0]++'
-	} | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
+	} | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
 	sort -u
 }
 
-- 
2.37.0.rc0.104.g0611611a94-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-18  0:54 [PATCH] scripts/tags.sh: Include tools directory in tags generation Vipin Sharma
@ 2022-06-27 17:47 ` Vipin Sharma
  2022-06-28  6:05   ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Vipin Sharma @ 2022-06-27 17:47 UTC (permalink / raw)
  To: gregkh, rkovhaev; +Cc: dmatlack, linux-kernel

On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
>
> Add tools directory in generating tags and quiet the "No such file or
> directory" warnings.
>
> It reverts the changes introduced in commit 162343a876f1
> ("scripts/tags.sh: exclude tools directory from tags generation") while
> maintainig the original intent of the patch to get rid of the warnings.
> This allows the root level cscope files to include tools source code
> besides kernel and a single place to browse the code for both.
>
> Signed-off-by: Vipin Sharma <vipinsh@google.com>
> ---
>
> I have found myself many times to browse tools and other part of the
> kernel code together. Excluding tools from the root level cscope makes
> it difficult to efficiently move between files and find user api
> definitions.
>
> Root cause of these warning is due to generated .cmd files which use
> relative paths in some files, I am not sure how to make them absolute
> file paths which can satisfy realpath warnings. Also, not sure if those
> warnings are helpful and should be kept. Passing "-q" to realpath seems
> easier solution. Please, let me know if there is a better alternative.
>
> Thanks
>
>  scripts/tags.sh | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index 01fab3d4f90b5..e137cf15aae9d 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -25,13 +25,6 @@ else
>         tree=${srctree}/
>  fi
>
> -# ignore userspace tools
> -if [ -n "$COMPILED_SOURCE" ]; then
> -       ignore="$ignore ( -path ./tools ) -prune -o"
> -else
> -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
> -fi
> -
>  # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
>  if [ "${ALLSOURCE_ARCHS}" = "" ]; then
>         ALLSOURCE_ARCHS=${SRCARCH}
> @@ -100,7 +93,7 @@ all_compiled_sources()
>                 find $ignore -name "*.cmd" -exec \
>                         grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
>                 awk '!a[$0]++'
> -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
>         sort -u
>  }
>
> --
> 2.37.0.rc0.104.g0611611a94-goog
>

Hi Greg,

Any update on the patch?

Thanks
Vipin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-27 17:47 ` Vipin Sharma
@ 2022-06-28  6:05   ` Greg KH
  2022-06-29 22:18     ` Vipin Sharma
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2022-06-28  6:05 UTC (permalink / raw)
  To: Vipin Sharma; +Cc: rkovhaev, dmatlack, linux-kernel

On Mon, Jun 27, 2022 at 10:47:35AM -0700, Vipin Sharma wrote:
> On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
> >
> > Add tools directory in generating tags and quiet the "No such file or
> > directory" warnings.
> >
> > It reverts the changes introduced in commit 162343a876f1
> > ("scripts/tags.sh: exclude tools directory from tags generation") while
> > maintainig the original intent of the patch to get rid of the warnings.
> > This allows the root level cscope files to include tools source code
> > besides kernel and a single place to browse the code for both.
> >
> > Signed-off-by: Vipin Sharma <vipinsh@google.com>
> > ---
> >
> > I have found myself many times to browse tools and other part of the
> > kernel code together. Excluding tools from the root level cscope makes
> > it difficult to efficiently move between files and find user api
> > definitions.
> >
> > Root cause of these warning is due to generated .cmd files which use
> > relative paths in some files, I am not sure how to make them absolute
> > file paths which can satisfy realpath warnings. Also, not sure if those
> > warnings are helpful and should be kept. Passing "-q" to realpath seems
> > easier solution. Please, let me know if there is a better alternative.
> >
> > Thanks
> >
> >  scripts/tags.sh | 9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> >
> > diff --git a/scripts/tags.sh b/scripts/tags.sh
> > index 01fab3d4f90b5..e137cf15aae9d 100755
> > --- a/scripts/tags.sh
> > +++ b/scripts/tags.sh
> > @@ -25,13 +25,6 @@ else
> >         tree=${srctree}/
> >  fi
> >
> > -# ignore userspace tools
> > -if [ -n "$COMPILED_SOURCE" ]; then
> > -       ignore="$ignore ( -path ./tools ) -prune -o"
> > -else
> > -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
> > -fi
> > -
> >  # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
> >  if [ "${ALLSOURCE_ARCHS}" = "" ]; then
> >         ALLSOURCE_ARCHS=${SRCARCH}
> > @@ -100,7 +93,7 @@ all_compiled_sources()
> >                 find $ignore -name "*.cmd" -exec \
> >                         grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
> >                 awk '!a[$0]++'
> > -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> > +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> >         sort -u
> >  }
> >
> > --
> > 2.37.0.rc0.104.g0611611a94-goog
> >
> 
> Hi Greg,
> 
> Any update on the patch?

Nope!

I don't really think we should add back in the tools to this, as if you
want to search them, then can't you just generate the needed tags for
the tools directory?

But as I don't even use this script ever, it feels odd for me to be the
one "owning" it, so it would be great if others could chime in who
actually use it.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-28  6:05   ` Greg KH
@ 2022-06-29 22:18     ` Vipin Sharma
  2022-06-29 22:54       ` Cristian Ciocaltea
  0 siblings, 1 reply; 7+ messages in thread
From: Vipin Sharma @ 2022-06-29 22:18 UTC (permalink / raw)
  To: Greg KH, rkovhaev, cristian.ciocaltea, zackary.liu.pro, ripxorip,
	masahiroy, xujialu, drjones
  Cc: dmatlack, linux-kernel

On Mon, Jun 27, 2022 at 11:05 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Jun 27, 2022 at 10:47:35AM -0700, Vipin Sharma wrote:
> > On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
> > >
> > > Add tools directory in generating tags and quiet the "No such file or
> > > directory" warnings.
> > >
> > > It reverts the changes introduced in commit 162343a876f1
> > > ("scripts/tags.sh: exclude tools directory from tags generation") while
> > > maintainig the original intent of the patch to get rid of the warnings.
> > > This allows the root level cscope files to include tools source code
> > > besides kernel and a single place to browse the code for both.
> > >
> > > Signed-off-by: Vipin Sharma <vipinsh@google.com>
> > > ---
> > >
> > > I have found myself many times to browse tools and other part of the
> > > kernel code together. Excluding tools from the root level cscope makes
> > > it difficult to efficiently move between files and find user api
> > > definitions.
> > >
> > > Root cause of these warning is due to generated .cmd files which use
> > > relative paths in some files, I am not sure how to make them absolute
> > > file paths which can satisfy realpath warnings. Also, not sure if those
> > > warnings are helpful and should be kept. Passing "-q" to realpath seems
> > > easier solution. Please, let me know if there is a better alternative.
> > >
> > > Thanks
> > >
> > >  scripts/tags.sh | 9 +--------
> > >  1 file changed, 1 insertion(+), 8 deletions(-)
> > >
> > > diff --git a/scripts/tags.sh b/scripts/tags.sh
> > > index 01fab3d4f90b5..e137cf15aae9d 100755
> > > --- a/scripts/tags.sh
> > > +++ b/scripts/tags.sh
> > > @@ -25,13 +25,6 @@ else
> > >         tree=${srctree}/
> > >  fi
> > >
> > > -# ignore userspace tools
> > > -if [ -n "$COMPILED_SOURCE" ]; then
> > > -       ignore="$ignore ( -path ./tools ) -prune -o"
> > > -else
> > > -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
> > > -fi
> > > -
> > >  # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
> > >  if [ "${ALLSOURCE_ARCHS}" = "" ]; then
> > >         ALLSOURCE_ARCHS=${SRCARCH}
> > > @@ -100,7 +93,7 @@ all_compiled_sources()
> > >                 find $ignore -name "*.cmd" -exec \
> > >                         grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
> > >                 awk '!a[$0]++'
> > > -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> > > +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> > >         sort -u
> > >  }
> > >
> > > --
> > > 2.37.0.rc0.104.g0611611a94-goog
> > >
> >
> > Hi Greg,
> >
> > Any update on the patch?
>
> Nope!
>
> I don't really think we should add back in the tools to this, as if you
> want to search them, then can't you just generate the needed tags for
> the tools directory?
>

Some folders in the tools directory do provide cscope rules. However,
those tags can only be used when I open the vim in those directories.
For example, if I am writing a KVM selftest and I want to explore code
related to certain ioctl in kernel as well as some code in KVM
selftest library, I cannot use two cscope files (one in the kernel
root dir and another in tools/testing/selftests/kvm) in a single VIM
instance. It starts having issues with the file paths. If the root
level cscope file includes tools directory then all of the tags will
be at one place and makes it very easy to browse tools code along with
the rest of the kernel.

> But as I don't even use this script ever, it feels odd for me to be the
> one "owning" it, so it would be great if others could chime in who
> actually use it.
>

I have added some folks in this email who have touched this script
file in the last couple of years or use cscope, hopefully they can
chime in.

Thanks
Vipin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-29 22:18     ` Vipin Sharma
@ 2022-06-29 22:54       ` Cristian Ciocaltea
  2022-06-30  6:42         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Cristian Ciocaltea @ 2022-06-29 22:54 UTC (permalink / raw)
  To: Vipin Sharma, Greg KH, rkovhaev, zackary.liu.pro, ripxorip,
	masahiroy, xujialu, drjones
  Cc: dmatlack, linux-kernel


On 6/30/22 01:18, Vipin Sharma wrote:
> On Mon, Jun 27, 2022 at 11:05 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>>
>> On Mon, Jun 27, 2022 at 10:47:35AM -0700, Vipin Sharma wrote:
>>> On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
>>>>
>>>> Add tools directory in generating tags and quiet the "No such file or
>>>> directory" warnings.
>>>>
>>>> It reverts the changes introduced in commit 162343a876f1
>>>> ("scripts/tags.sh: exclude tools directory from tags generation") while
>>>> maintainig the original intent of the patch to get rid of the warnings.
>>>> This allows the root level cscope files to include tools source code
>>>> besides kernel and a single place to browse the code for both.
>>>>
>>>> Signed-off-by: Vipin Sharma <vipinsh@google.com>
>>>> ---
>>>>
>>>> I have found myself many times to browse tools and other part of the
>>>> kernel code together. Excluding tools from the root level cscope makes
>>>> it difficult to efficiently move between files and find user api
>>>> definitions.
>>>>
>>>> Root cause of these warning is due to generated .cmd files which use
>>>> relative paths in some files, I am not sure how to make them absolute
>>>> file paths which can satisfy realpath warnings. Also, not sure if those
>>>> warnings are helpful and should be kept. Passing "-q" to realpath seems
>>>> easier solution. Please, let me know if there is a better alternative.
>>>>
>>>> Thanks
>>>>
>>>>   scripts/tags.sh | 9 +--------
>>>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>>>
>>>> diff --git a/scripts/tags.sh b/scripts/tags.sh
>>>> index 01fab3d4f90b5..e137cf15aae9d 100755
>>>> --- a/scripts/tags.sh
>>>> +++ b/scripts/tags.sh
>>>> @@ -25,13 +25,6 @@ else
>>>>          tree=${srctree}/
>>>>   fi
>>>>
>>>> -# ignore userspace tools
>>>> -if [ -n "$COMPILED_SOURCE" ]; then
>>>> -       ignore="$ignore ( -path ./tools ) -prune -o"
>>>> -else
>>>> -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
>>>> -fi
>>>> -
>>>>   # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
>>>>   if [ "${ALLSOURCE_ARCHS}" = "" ]; then
>>>>          ALLSOURCE_ARCHS=${SRCARCH}
>>>> @@ -100,7 +93,7 @@ all_compiled_sources()
>>>>                  find $ignore -name "*.cmd" -exec \
>>>>                          grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
>>>>                  awk '!a[$0]++'
>>>> -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
>>>> +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
>>>>          sort -u
>>>>   }
>>>>
>>>> --
>>>> 2.37.0.rc0.104.g0611611a94-goog
>>>>
>>>
>>> Hi Greg,
>>>
>>> Any update on the patch?
>>
>> Nope!
>>
>> I don't really think we should add back in the tools to this, as if you
>> want to search them, then can't you just generate the needed tags for
>> the tools directory?
>>
> 
> Some folders in the tools directory do provide cscope rules. However,
> those tags can only be used when I open the vim in those directories.
> For example, if I am writing a KVM selftest and I want to explore code
> related to certain ioctl in kernel as well as some code in KVM
> selftest library, I cannot use two cscope files (one in the kernel
> root dir and another in tools/testing/selftests/kvm) in a single VIM
> instance. It starts having issues with the file paths. If the root
> level cscope file includes tools directory then all of the tags will
> be at one place and makes it very easy to browse tools code along with
> the rest of the kernel.
> 
>> But as I don't even use this script ever, it feels odd for me to be the
>> one "owning" it, so it would be great if others could chime in who
>> actually use it.
>>

Since the tools directory has been excluded just to get rid of those 
warnings, I think there is no obvious reason to not add it back - at 
least the use case described above is perfectly valid.

> I have added some folks in this email who have touched this script
> file in the last couple of years or use cscope, hopefully they can
> chime in.
> 
> Thanks
> Vipin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-29 22:54       ` Cristian Ciocaltea
@ 2022-06-30  6:42         ` Greg KH
  2022-06-30  9:26           ` Cristian Ciocaltea
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2022-06-30  6:42 UTC (permalink / raw)
  To: Cristian Ciocaltea
  Cc: Vipin Sharma, rkovhaev, zackary.liu.pro, ripxorip, masahiroy,
	xujialu, drjones, dmatlack, linux-kernel

On Thu, Jun 30, 2022 at 01:54:00AM +0300, Cristian Ciocaltea wrote:
> 
> On 6/30/22 01:18, Vipin Sharma wrote:
> > On Mon, Jun 27, 2022 at 11:05 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> > > 
> > > On Mon, Jun 27, 2022 at 10:47:35AM -0700, Vipin Sharma wrote:
> > > > On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
> > > > > 
> > > > > Add tools directory in generating tags and quiet the "No such file or
> > > > > directory" warnings.
> > > > > 
> > > > > It reverts the changes introduced in commit 162343a876f1
> > > > > ("scripts/tags.sh: exclude tools directory from tags generation") while
> > > > > maintainig the original intent of the patch to get rid of the warnings.
> > > > > This allows the root level cscope files to include tools source code
> > > > > besides kernel and a single place to browse the code for both.
> > > > > 
> > > > > Signed-off-by: Vipin Sharma <vipinsh@google.com>
> > > > > ---
> > > > > 
> > > > > I have found myself many times to browse tools and other part of the
> > > > > kernel code together. Excluding tools from the root level cscope makes
> > > > > it difficult to efficiently move between files and find user api
> > > > > definitions.
> > > > > 
> > > > > Root cause of these warning is due to generated .cmd files which use
> > > > > relative paths in some files, I am not sure how to make them absolute
> > > > > file paths which can satisfy realpath warnings. Also, not sure if those
> > > > > warnings are helpful and should be kept. Passing "-q" to realpath seems
> > > > > easier solution. Please, let me know if there is a better alternative.
> > > > > 
> > > > > Thanks
> > > > > 
> > > > >   scripts/tags.sh | 9 +--------
> > > > >   1 file changed, 1 insertion(+), 8 deletions(-)
> > > > > 
> > > > > diff --git a/scripts/tags.sh b/scripts/tags.sh
> > > > > index 01fab3d4f90b5..e137cf15aae9d 100755
> > > > > --- a/scripts/tags.sh
> > > > > +++ b/scripts/tags.sh
> > > > > @@ -25,13 +25,6 @@ else
> > > > >          tree=${srctree}/
> > > > >   fi
> > > > > 
> > > > > -# ignore userspace tools
> > > > > -if [ -n "$COMPILED_SOURCE" ]; then
> > > > > -       ignore="$ignore ( -path ./tools ) -prune -o"
> > > > > -else
> > > > > -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
> > > > > -fi
> > > > > -
> > > > >   # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
> > > > >   if [ "${ALLSOURCE_ARCHS}" = "" ]; then
> > > > >          ALLSOURCE_ARCHS=${SRCARCH}
> > > > > @@ -100,7 +93,7 @@ all_compiled_sources()
> > > > >                  find $ignore -name "*.cmd" -exec \
> > > > >                          grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
> > > > >                  awk '!a[$0]++'
> > > > > -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> > > > > +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
> > > > >          sort -u
> > > > >   }
> > > > > 
> > > > > --
> > > > > 2.37.0.rc0.104.g0611611a94-goog
> > > > > 
> > > > 
> > > > Hi Greg,
> > > > 
> > > > Any update on the patch?
> > > 
> > > Nope!
> > > 
> > > I don't really think we should add back in the tools to this, as if you
> > > want to search them, then can't you just generate the needed tags for
> > > the tools directory?
> > > 
> > 
> > Some folders in the tools directory do provide cscope rules. However,
> > those tags can only be used when I open the vim in those directories.
> > For example, if I am writing a KVM selftest and I want to explore code
> > related to certain ioctl in kernel as well as some code in KVM
> > selftest library, I cannot use two cscope files (one in the kernel
> > root dir and another in tools/testing/selftests/kvm) in a single VIM
> > instance. It starts having issues with the file paths. If the root
> > level cscope file includes tools directory then all of the tags will
> > be at one place and makes it very easy to browse tools code along with
> > the rest of the kernel.
> > 
> > > But as I don't even use this script ever, it feels odd for me to be the
> > > one "owning" it, so it would be great if others could chime in who
> > > actually use it.
> > > 
> 
> Since the tools directory has been excluded just to get rid of those
> warnings, I think there is no obvious reason to not add it back - at least
> the use case described above is perfectly valid.

So is that an "Acked-by:"?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scripts/tags.sh: Include tools directory in tags generation
  2022-06-30  6:42         ` Greg KH
@ 2022-06-30  9:26           ` Cristian Ciocaltea
  0 siblings, 0 replies; 7+ messages in thread
From: Cristian Ciocaltea @ 2022-06-30  9:26 UTC (permalink / raw)
  To: Greg KH
  Cc: Vipin Sharma, rkovhaev, zackary.liu.pro, ripxorip, masahiroy,
	xujialu, drjones, dmatlack, linux-kernel


On 6/30/22 09:42, Greg KH wrote:
> On Thu, Jun 30, 2022 at 01:54:00AM +0300, Cristian Ciocaltea wrote:
>>
>> On 6/30/22 01:18, Vipin Sharma wrote:
>>> On Mon, Jun 27, 2022 at 11:05 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>
>>>> On Mon, Jun 27, 2022 at 10:47:35AM -0700, Vipin Sharma wrote:
>>>>> On Fri, Jun 17, 2022 at 5:55 PM Vipin Sharma <vipinsh@google.com> wrote:
>>>>>>
>>>>>> Add tools directory in generating tags and quiet the "No such file or
>>>>>> directory" warnings.
>>>>>>
>>>>>> It reverts the changes introduced in commit 162343a876f1
>>>>>> ("scripts/tags.sh: exclude tools directory from tags generation") while
>>>>>> maintainig the original intent of the patch to get rid of the warnings.
>>>>>> This allows the root level cscope files to include tools source code
>>>>>> besides kernel and a single place to browse the code for both.
>>>>>>
>>>>>> Signed-off-by: Vipin Sharma <vipinsh@google.com>
>>>>>> ---
>>>>>>
>>>>>> I have found myself many times to browse tools and other part of the
>>>>>> kernel code together. Excluding tools from the root level cscope makes
>>>>>> it difficult to efficiently move between files and find user api
>>>>>> definitions.
>>>>>>
>>>>>> Root cause of these warning is due to generated .cmd files which use
>>>>>> relative paths in some files, I am not sure how to make them absolute
>>>>>> file paths which can satisfy realpath warnings. Also, not sure if those
>>>>>> warnings are helpful and should be kept. Passing "-q" to realpath seems
>>>>>> easier solution. Please, let me know if there is a better alternative.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>    scripts/tags.sh | 9 +--------
>>>>>>    1 file changed, 1 insertion(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/scripts/tags.sh b/scripts/tags.sh
>>>>>> index 01fab3d4f90b5..e137cf15aae9d 100755
>>>>>> --- a/scripts/tags.sh
>>>>>> +++ b/scripts/tags.sh
>>>>>> @@ -25,13 +25,6 @@ else
>>>>>>           tree=${srctree}/
>>>>>>    fi
>>>>>>
>>>>>> -# ignore userspace tools
>>>>>> -if [ -n "$COMPILED_SOURCE" ]; then
>>>>>> -       ignore="$ignore ( -path ./tools ) -prune -o"
>>>>>> -else
>>>>>> -       ignore="$ignore ( -path ${tree}tools ) -prune -o"
>>>>>> -fi
>>>>>> -
>>>>>>    # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
>>>>>>    if [ "${ALLSOURCE_ARCHS}" = "" ]; then
>>>>>>           ALLSOURCE_ARCHS=${SRCARCH}
>>>>>> @@ -100,7 +93,7 @@ all_compiled_sources()
>>>>>>                   find $ignore -name "*.cmd" -exec \
>>>>>>                           grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
>>>>>>                   awk '!a[$0]++'
>>>>>> -       } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
>>>>>> +       } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
>>>>>>           sort -u
>>>>>>    }
>>>>>>
>>>>>> --
>>>>>> 2.37.0.rc0.104.g0611611a94-goog
>>>>>>
>>>>>
>>>>> Hi Greg,
>>>>>
>>>>> Any update on the patch?
>>>>
>>>> Nope!
>>>>
>>>> I don't really think we should add back in the tools to this, as if you
>>>> want to search them, then can't you just generate the needed tags for
>>>> the tools directory?
>>>>
>>>
>>> Some folders in the tools directory do provide cscope rules. However,
>>> those tags can only be used when I open the vim in those directories.
>>> For example, if I am writing a KVM selftest and I want to explore code
>>> related to certain ioctl in kernel as well as some code in KVM
>>> selftest library, I cannot use two cscope files (one in the kernel
>>> root dir and another in tools/testing/selftests/kvm) in a single VIM
>>> instance. It starts having issues with the file paths. If the root
>>> level cscope file includes tools directory then all of the tags will
>>> be at one place and makes it very easy to browse tools code along with
>>> the rest of the kernel.
>>>
>>>> But as I don't even use this script ever, it feels odd for me to be the
>>>> one "owning" it, so it would be great if others could chime in who
>>>> actually use it.
>>>>
>>
>> Since the tools directory has been excluded just to get rid of those
>> warnings, I think there is no obvious reason to not add it back - at least
>> the use case described above is perfectly valid.
> 
> So is that an "Acked-by:"?

Acked-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-30  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-18  0:54 [PATCH] scripts/tags.sh: Include tools directory in tags generation Vipin Sharma
2022-06-27 17:47 ` Vipin Sharma
2022-06-28  6:05   ` Greg KH
2022-06-29 22:18     ` Vipin Sharma
2022-06-29 22:54       ` Cristian Ciocaltea
2022-06-30  6:42         ` Greg KH
2022-06-30  9:26           ` Cristian Ciocaltea

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.