All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem using gtags target
@ 2013-07-08 17:22 Punit Agrawal
  2013-07-23 12:49 ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Punit Agrawal @ 2013-07-08 17:22 UTC (permalink / raw)
  To: linux-kernel

Hi,

I am trying to use GNU global for kernel source browsing but have run
into a problem when using "gtags" target in Makefile. The index
files(GTAGS, GSYMS, GPATH, GRTAGS) don't work and on further
investigation turned out to be 16kb each in size. My command line is - 

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 gtags

On some digging, I traced the relevant code to scripts/tags.sh which
produces reasonably sized indices (modulo some  missing environment
variables) when run as - 

./scripts/tags.sh gtags

I used the following patch

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 74f02e4..59b24ee 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -143,7 +143,8 @@ docscope()
 
 dogtags()
 {
-   all_target_sources | gtags -i -f -
+ all_target_sources > gtags.files
+ gtags -i -f gtags.files
 }
 
 exuberant()

to check the file list being produced and it seems correct but the
indices are still broken. Yet manually running

gtags -i -f gtags.files

does seem to do the right thing.

I was wondering if anybody has faced similar issues when using gtags and
how to fix this.

Thanks,
Punit

ps: Please include me in the cc as I am not subscribed to the list.


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

* Re: Problem using gtags target
  2013-07-08 17:22 Problem using gtags target Punit Agrawal
@ 2013-07-23 12:49 ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2013-07-23 12:49 UTC (permalink / raw)
  To: Punit Agrawal; +Cc: linux-kernel

On 8.7.2013 19:22, Punit Agrawal wrote:
> Hi,
> 
> I am trying to use GNU global for kernel source browsing but have run
> into a problem when using "gtags" target in Makefile. The index
> files(GTAGS, GSYMS, GPATH, GRTAGS) don't work and on further
> investigation turned out to be 16kb each in size. My command line is - 
> 
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 gtags

So you have a command that fails

> 
> On some digging, I traced the relevant code to scripts/tags.sh which
> produces reasonably sized indices (modulo some  missing environment
> variables) when run as - 
> 
> ./scripts/tags.sh gtags

...and a command that works. So you can start "bisecting" between these
two: Try removing -j5 or ARCH= or  CROSS_COMPILE= from the make command
line. Still failing? Add 'printenv >env.make' to the tags.sh script and
run it via make tags. Compare the env.make file with printenv output
from the shell. Try setting the variables from env.make in the shell and
see when ./scripts/tags.sh gtags starts failing.

FWIW, both your commands seem to work for me and produce a GRTAGS that
is 256MB big.

Michal

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

* Re: Problem using gtags target
@ 2013-07-23 14:03 Punit Agrawal
  0 siblings, 0 replies; 3+ messages in thread
From: Punit Agrawal @ 2013-07-23 14:03 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel

Michal Marek <mmarek@suse.cz> writes:

> On 8.7.2013 19:22, Punit Agrawal wrote:
>> Hi,
>> 
>> I am trying to use GNU global for kernel source browsing but have run
>> into a problem when using "gtags" target in Makefile. The index
>> files(GTAGS, GSYMS, GPATH, GRTAGS) don't work and on further
>> investigation turned out to be 16kb each in size. My command line is - 
>> 
>> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 gtags
>
> So you have a command that fails
>
>> 
>> On some digging, I traced the relevant code to scripts/tags.sh which
>> produces reasonably sized indices (modulo some  missing environment
>> variables) when run as - 
>> 
>> ./scripts/tags.sh gtags
>
> ...and a command that works. So you can start "bisecting" between these
> two: Try removing -j5 or ARCH= or  CROSS_COMPILE= from the make command
> line. Still failing? Add 'printenv >env.make' to the tags.sh script and
> run it via make tags. Compare the env.make file with printenv output
> from the shell. Try setting the variables from env.make in the shell and
> see when ./scripts/tags.sh gtags starts failing.
>

:) I'd already tried without the ARCH and CROSS_COMPILE and was half-way
through trying out the various env options, before I accidentally
discovered what the problem was.

Althought I had the latest version (5.7.1) of the global package (which
gtags is part of), it was only the latest version that my distro (Ubuntu
12.10) provided and not the latest upstream release (6.2.8) for the
package. I should have checked but didn't think it would be so out of
date (more than 3 years) as most packages are quite up-to-date.

Upgrading the binaries to v6.2.8 solved the problem for me along with a
very very nice speed bump while indexing the kernel sources.

> FWIW, both your commands seem to work for me and produce a GRTAGS that
> is 256MB big.
>

My tag files are in the same size range as well.

Hopefully, this thread should make it easier to search for others who
face this issue.

Cheers,
Punit

> Michal

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

end of thread, other threads:[~2013-07-23 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08 17:22 Problem using gtags target Punit Agrawal
2013-07-23 12:49 ` Michal Marek
2013-07-23 14:03 Punit Agrawal

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.