linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: generate cscope.files when building cscope index
@ 2020-01-12 19:05 Marcelo Diop-Gonzalez
  2020-01-20 22:33 ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Diop-Gonzalez @ 2020-01-12 19:05 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

Currently, running 'make cscope' gives this output:

rm -f cscope*
find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' ! -name '\.#' -print | cscope -b -q
cscope: no source files found
make: *** [Makefile:351: cscope] Error 1

By default, cscope looks in cscope.files for the list of
sources, so printing the source file list to this file
fixes the above error.

Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index efd9ed4..0b15bf5 100644
--- a/Makefile
+++ b/Makefile
@@ -348,7 +348,8 @@ TAGS:	force
 
 cscope: force
 	$(RM) cscope*
-	$(call find_tag_files) | cscope -b -q
+	$(call find_tag_files) > cscope.files
+	cscope -b -q
 
 install_plugins_traceevent: force
 	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins install_plugins
-- 
2.20.1


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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-12 19:05 [PATCH] trace-cmd: generate cscope.files when building cscope index Marcelo Diop-Gonzalez
@ 2020-01-20 22:33 ` Steven Rostedt
  2020-01-22 17:21   ` Marcelo Diop-Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2020-01-20 22:33 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez; +Cc: linux-trace-devel

On Sun, 12 Jan 2020 14:05:37 -0500
Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:

> Currently, running 'make cscope' gives this output:

Hi Marcelo!

> 
> rm -f cscope*
> find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' ! -name '\.#' -print | cscope -b -q
> cscope: no source files found
> make: *** [Makefile:351: cscope] Error 1
> 
> By default, cscope looks in cscope.files for the list of
> sources, so printing the source file list to this file
> fixes the above error.
> 
> Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
> ---
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index efd9ed4..0b15bf5 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -348,7 +348,8 @@ TAGS:	force
>  
>  cscope: force
>  	$(RM) cscope*
> -	$(call find_tag_files) | cscope -b -q
> +	$(call find_tag_files) > cscope.files
> +	cscope -b -q

I think the following should work too, without the need to create an
extra file:

diff --git a/Makefile b/Makefile
index efd9ed4b..782df41b 100644
--- a/Makefile
+++ b/Makefile
@@ -348,7 +348,7 @@ TAGS:	force
 
 cscope: force
 	$(RM) cscope*
-	$(call find_tag_files) | cscope -b -q
+	$(call find_tag_files) | cscope -b -q -i-
 
 install_plugins_traceevent: force
 	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins install_plugins


Care to test it out. And feel free to resend this version.

Thanks!

-- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-20 22:33 ` Steven Rostedt
@ 2020-01-22 17:21   ` Marcelo Diop-Gonzalez
  2020-01-22 17:28     ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Diop-Gonzalez @ 2020-01-22 17:21 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-trace-devel

On Mon, Jan 20, 2020 at 5:33 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Sun, 12 Jan 2020 14:05:37 -0500
> Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
>
> > Currently, running 'make cscope' gives this output:
>
> Hi Marcelo!
>
> >
> > rm -f cscope*
> > find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' ! -name '\.#' -print | cscope -b -q
> > cscope: no source files found
> > make: *** [Makefile:351: cscope] Error 1
> >
> > By default, cscope looks in cscope.files for the list of
> > sources, so printing the source file list to this file
> > fixes the above error.
> >
> > Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
> > ---
> >  Makefile | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index efd9ed4..0b15bf5 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -348,7 +348,8 @@ TAGS:     force
> >
> >  cscope: force
> >       $(RM) cscope*
> > -     $(call find_tag_files) | cscope -b -q
> > +     $(call find_tag_files) > cscope.files
> > +     cscope -b -q
>
> I think the following should work too, without the need to create an
> extra file:
>
> diff --git a/Makefile b/Makefile
> index efd9ed4b..782df41b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -348,7 +348,7 @@ TAGS:       force
>
>  cscope: force
>         $(RM) cscope*
> -       $(call find_tag_files) | cscope -b -q
> +       $(call find_tag_files) | cscope -b -q -i-

Hi Steven!

I think one problem with this is that it requires that you pass cscope a
list of files to look in when using it after building the index.
Running "cscope"
with no arguments gives the output: "cscope: no source files found", whereas
if cscope.files is populated, running "cscope" lets you look at everything that
went into building the index. For example, I think running "make cscope" inside
a kernel repository will spit out a 'cscope.files' (done in docscope()
in ./scripts/tags.sh).
But I guess it depends on how people usually like to use cscope (I'm
no expert!).
What do you think is best?

Thanks,

-Marcelo
>
>  install_plugins_traceevent: force
>         $(Q)$(MAKE) -C $(src)/lib/traceevent/plugins install_plugins
>
>
> Care to test it out. And feel free to resend this version.
>
> Thanks!
>
> -- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-22 17:21   ` Marcelo Diop-Gonzalez
@ 2020-01-22 17:28     ` Steven Rostedt
  2020-01-22 18:49       ` Marcelo Diop-Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2020-01-22 17:28 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez; +Cc: linux-trace-devel

On Wed, 22 Jan 2020 12:21:54 -0500
Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:

> > > Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
> > > ---
> > >  Makefile | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index efd9ed4..0b15bf5 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -348,7 +348,8 @@ TAGS:     force
> > >
> > >  cscope: force
> > >       $(RM) cscope*
> > > -     $(call find_tag_files) | cscope -b -q
> > > +     $(call find_tag_files) > cscope.files
> > > +     cscope -b -q  
> >
> > I think the following should work too, without the need to create an
> > extra file:
> >
> > diff --git a/Makefile b/Makefile
> > index efd9ed4b..782df41b 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -348,7 +348,7 @@ TAGS:       force
> >
> >  cscope: force
> >         $(RM) cscope*
> > -       $(call find_tag_files) | cscope -b -q
> > +       $(call find_tag_files) | cscope -b -q -i-  
> 
> Hi Steven!
> 
> I think one problem with this is that it requires that you pass cscope a
> list of files to look in when using it after building the index.
> Running "cscope"
> with no arguments gives the output: "cscope: no source files found", whereas
> if cscope.files is populated, running "cscope" lets you look at everything that
> went into building the index. For example, I think running "make cscope" inside
> a kernel repository will spit out a 'cscope.files' (done in docscope()
> in ./scripts/tags.sh).
> But I guess it depends on how people usually like to use cscope (I'm
> no expert!).
> What do you think is best?

As I do my development with emacs, I honestly have no opinion on the
use of cscope. ;-)

Is it common practice to look at the file used for cscope? If it is,
then I'm OK with your approach, but we need to make sure we update
the .gitignore and clean make target to remove it.

Thanks!

-- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-22 17:28     ` Steven Rostedt
@ 2020-01-22 18:49       ` Marcelo Diop-Gonzalez
  2020-01-22 19:08         ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Diop-Gonzalez @ 2020-01-22 18:49 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-trace-devel

On Wed, Jan 22, 2020 at 12:28 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 22 Jan 2020 12:21:54 -0500
> Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
>
> > > > Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
> > > > ---
> > > >  Makefile | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/Makefile b/Makefile
> > > > index efd9ed4..0b15bf5 100644
> > > > --- a/Makefile
> > > > +++ b/Makefile
> > > > @@ -348,7 +348,8 @@ TAGS:     force
> > > >
> > > >  cscope: force
> > > >       $(RM) cscope*
> > > > -     $(call find_tag_files) | cscope -b -q
> > > > +     $(call find_tag_files) > cscope.files
> > > > +     cscope -b -q
> > >
> > > I think the following should work too, without the need to create an
> > > extra file:
> > >
> > > diff --git a/Makefile b/Makefile
> > > index efd9ed4b..782df41b 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -348,7 +348,7 @@ TAGS:       force
> > >
> > >  cscope: force
> > >         $(RM) cscope*
> > > -       $(call find_tag_files) | cscope -b -q
> > > +       $(call find_tag_files) | cscope -b -q -i-
> >
> > Hi Steven!
> >
> > I think one problem with this is that it requires that you pass cscope a
> > list of files to look in when using it after building the index.
> > Running "cscope"
> > with no arguments gives the output: "cscope: no source files found", whereas
> > if cscope.files is populated, running "cscope" lets you look at everything that
> > went into building the index. For example, I think running "make cscope" inside
> > a kernel repository will spit out a 'cscope.files' (done in docscope()
> > in ./scripts/tags.sh).
> > But I guess it depends on how people usually like to use cscope (I'm
> > no expert!).
> > What do you think is best?
>
> As I do my development with emacs, I honestly have no opinion on the
> use of cscope. ;-)
>
> Is it common practice to look at the file used for cscope? If it is,

I find it useful to have cscope.files present just so that 'cscope' by itself
works. Also I've been using https://github.com/dkogan/xcscope.el with emacs
a bit, and it's easier to use with cscope.files present. I'm not too sure how
common it is though, my only data point is myself I guess :)

> then I'm OK with your approach, but we need to make sure we update
> the .gitignore and clean make target to remove it.

Ah good point! I'll send out another version if this way's the way to go.

Thanks,

-Marcelo

>
> Thanks!
>
> -- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-22 18:49       ` Marcelo Diop-Gonzalez
@ 2020-01-22 19:08         ` Steven Rostedt
  2020-01-23 19:51           ` Marcelo Diop-Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2020-01-22 19:08 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez; +Cc: linux-trace-devel

On Wed, 22 Jan 2020 13:49:40 -0500
Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
> 
> > then I'm OK with your approach, but we need to make sure we update
> > the .gitignore and clean make target to remove it.  
> 
> Ah good point! I'll send out another version if this way's the way to go.

Yes, please do. Thanks!

-- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-22 19:08         ` Steven Rostedt
@ 2020-01-23 19:51           ` Marcelo Diop-Gonzalez
  2020-01-23 21:08             ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Diop-Gonzalez @ 2020-01-23 19:51 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-trace-devel

On Wed, Jan 22, 2020 at 2:08 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 22 Jan 2020 13:49:40 -0500
> Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
> >
> > > then I'm OK with your approach, but we need to make sure we update
> > > the .gitignore and clean make target to remove it.
> >
> > Ah good point! I'll send out another version if this way's the way to go.
>
> Yes, please do. Thanks!

Ah actually, should these be covered by the 'cscope* ' lines in
.gitignore and the clean make target?

-Marcelo

>
> -- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-23 19:51           ` Marcelo Diop-Gonzalez
@ 2020-01-23 21:08             ` Steven Rostedt
  2020-01-23 21:11               ` Marcelo Diop-Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2020-01-23 21:08 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez; +Cc: linux-trace-devel

On Thu, 23 Jan 2020 14:51:53 -0500
Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:

> On Wed, Jan 22, 2020 at 2:08 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > On Wed, 22 Jan 2020 13:49:40 -0500
> > Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:  
> > >  
> > > > then I'm OK with your approach, but we need to make sure we update
> > > > the .gitignore and clean make target to remove it.  
> > >
> > > Ah good point! I'll send out another version if this way's the way to go.  
> >
> > Yes, please do. Thanks!  
> 
> Ah actually, should these be covered by the 'cscope* ' lines in
> .gitignore and the clean make target?
>

Ah, I guess they are ;-)

OK, I'll take your original patch. Thanks!

-- Steve

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

* Re: [PATCH] trace-cmd: generate cscope.files when building cscope index
  2020-01-23 21:08             ` Steven Rostedt
@ 2020-01-23 21:11               ` Marcelo Diop-Gonzalez
  0 siblings, 0 replies; 9+ messages in thread
From: Marcelo Diop-Gonzalez @ 2020-01-23 21:11 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-trace-devel

On Thu, Jan 23, 2020 at 4:08 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu, 23 Jan 2020 14:51:53 -0500
> Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
>
> > On Wed, Jan 22, 2020 at 2:08 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > On Wed, 22 Jan 2020 13:49:40 -0500
> > > Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:
> > > >
> > > > > then I'm OK with your approach, but we need to make sure we update
> > > > > the .gitignore and clean make target to remove it.
> > > >
> > > > Ah good point! I'll send out another version if this way's the way to go.
> > >
> > > Yes, please do. Thanks!
> >
> > Ah actually, should these be covered by the 'cscope* ' lines in
> > .gitignore and the clean make target?
> >
>
> Ah, I guess they are ;-)
>
> OK, I'll take your original patch. Thanks!

Sounds good, thanks!

-Marcelo
>
> -- Steve

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

end of thread, other threads:[~2020-01-23 21:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-12 19:05 [PATCH] trace-cmd: generate cscope.files when building cscope index Marcelo Diop-Gonzalez
2020-01-20 22:33 ` Steven Rostedt
2020-01-22 17:21   ` Marcelo Diop-Gonzalez
2020-01-22 17:28     ` Steven Rostedt
2020-01-22 18:49       ` Marcelo Diop-Gonzalez
2020-01-22 19:08         ` Steven Rostedt
2020-01-23 19:51           ` Marcelo Diop-Gonzalez
2020-01-23 21:08             ` Steven Rostedt
2020-01-23 21:11               ` Marcelo Diop-Gonzalez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).