[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Allow specifying both of -r and -s for -f on 2-pass mode
From: |
Hideki IWAMOTO |
Subject: |
Re: [PATCH] Allow specifying both of -r and -s for -f on 2-pass mode |
Date: |
Sun, 22 Nov 2009 02:18:28 +0900 |
Hi.
> This patch allows specifying both of -r and -s for "global -f" command in
> 2-pass mode.
The number of executions of "global -f" from htags has decreased
by this change and adding new format to --result option.
The CPU time of 2-pass mode is shorter than that of the default mode now.
$ foreach label ( default 2pass )
foreach? echo ==== label:$label ====
foreach? rm -fr linux-2.6.31; tar xfj ~/download/linux/linux-2.6.31.tar.bz2;
sync
foreach? (cd linux-2.6.31; setenv GTAGSLABEL $label; gtags; strace -c -f -F -q
-S calls htags)
foreach? end
==== label:default ====
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
34.09 121.072744 80 1508837 76 write
43.94 156.029997 107 1453270 read
8.53 30.283076 82 367068 pread
2.56 9.091694 51 179733 lseek
1.82 6.463504 38 169023 mmap
1.67 5.915556 35 167323 close
1.81 6.413643 38 167047 fstat
2.86 10.138799 61 166820 open
1.86 6.613891 40 166056 munmap
0.39 1.368624 13 109252 1325 stat
0.32 1.131337 47 24007 brk
0.04 0.125198 9 13329 mremap
0.01 0.040300 25 1632 rt_sigaction
0.01 0.039444 30 1335 mprotect
0.01 0.038355 43 901 297 access
0.01 0.021350 24 888 rt_sigprocmask
0.00 0.011483 26 445 uname
0.05 0.187592 632 297 execve
0.00 0.006622 22 297 arch_prctl
0.00 0.003066 20 152 getpid
0.00 0.007155 48 148 pipe
0.00 0.004293 29 148 dup2
0.02 0.063565 429 148 clone
0.00 0.008626 58 148 wait4
0.00 0.004727 32 148 getuid
0.00 0.003798 26 148 getgid
0.00 0.007550 51 148 geteuid
0.00 0.004409 30 148 getegid
0.00 0.003346 23 148 getppid
0.00 0.005175 35 148 getpgrp
0.00 0.001957 16 122 fcntl
0.00 0.000308 10 30 lstat
0.00 0.000113 5 24 getrusage
0.00 0.000156 14 11 getcwd
0.00 0.000277 35 8 mkdir
0.00 0.000206 26 8 unlink
0.00 0.000210 30 7 chdir
0.00 0.000044 15 3 chmod
------ ----------- ----------- --------- --------- ----------------
100.00 355.112190 4499405 1698 total
==== label:2pass ====
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
47.37 131.383273 87 1508223 47 write
39.64 109.940091 82 1337643 read
1.58 4.381549 31 142934 mmap
1.37 3.804107 27 141797 close
1.55 4.287069 30 141481 fstat
2.69 7.466272 53 141393 open
1.57 4.343462 31 140907 munmap
1.56 4.317122 36 119833 lseek
0.32 0.896082 11 82572 904 stat
2.06 5.719395 92 62208 pread
0.04 0.105069 8 13297 mremap
0.05 0.133677 25 5324 brk
0.01 0.017807 16 1115 rt_sigaction
0.01 0.019009 21 912 mprotect
0.01 0.014424 23 618 203 access
0.00 0.009484 16 606 rt_sigprocmask
0.00 0.004613 15 304 uname
0.11 0.299395 1475 203 execve
0.00 0.003417 17 203 arch_prctl
0.00 0.001624 16 104 getpid
0.00 0.004607 46 101 pipe
0.00 0.003418 34 101 dup2
0.07 0.182768 1810 101 clone
0.00 0.004143 41 101 wait4
0.00 0.001716 17 101 getuid
0.00 0.001417 14 101 getgid
0.00 0.001835 18 101 geteuid
0.00 0.001522 15 101 getegid
0.00 0.001358 13 101 getppid
0.00 0.001555 15 101 getpgrp
0.00 0.000110 4 29 fcntl
0.00 0.000519 19 27 lstat
0.00 0.000083 3 24 getrusage
0.00 0.000105 11 10 getcwd
0.00 0.004208 526 8 mkdir
0.00 0.004116 588 7 unlink
0.00 0.000193 39 5 chdir
0.00 0.000042 14 3 chmod
------ ----------- ----------- --------- --------- ----------------
100.00 277.360656 3842800 1154 total
$ foreach cpumask ( 1 3 )
foreach? foreach label ( default 2pass )
foreach? echo ==== cpumask:$cpumask label:$label ====
foreach? rm -fr linux-2.6.31; tar xfj ~/download/linux/linux-2.6.31.tar.bz2;
sync
foreach? (cd linux-2.6.31; setenv GTAGSLABEL $label; gtags; taskset $cpumask
htags --statistics)
foreach? end
foreach? end
==== cpumask:1 label:default ====
period user[sec] system[sec] elapsed[sec] %CPU
--------------------------------- --------- ----------- ------------ ----
Time of making duplicate entries 43.791 2.732 54.398 85.5
Time of making function index 4.544 0.620 5.628 91.8
Time of making file index 0.388 0.336 2.189 33.1
Time of making include file index 12.485 2.984 18.859 82.0
Time of making hypertext 222.534 30.930 376.875 67.3
--------------------------------- --------- ----------- ------------ ----
The entire time 283.762 37.638 458.304 70.1
==== cpumask:1 label:2pass ====
period user[sec] system[sec] elapsed[sec] %CPU
--------------------------------- --------- ----------- ------------ ----
Time of making duplicate entries 42.275 2.500 46.125 97.1
Time of making function index 4.460 0.684 5.189 99.1
Time of making file index 0.404 0.328 2.719 26.9
Time of making include file index 12.421 3.016 19.498 79.2
Time of making hypertext 201.149 25.862 365.167 62.2
--------------------------------- --------- ----------- ------------ ----
The entire time 260.728 32.418 439.295 66.7
==== cpumask:3 label:default ====
period user[sec] system[sec] elapsed[sec] %CPU
--------------------------------- --------- ----------- ------------ -----
Time of making duplicate entries 43.083 3.124 63.430 72.8
Time of making function index 4.448 0.628 4.612 110.1
Time of making file index 0.396 0.344 1.092 67.8
Time of making include file index 12.065 3.048 18.916 79.9
Time of making hypertext 217.850 30.350 284.112 87.4
--------------------------------- --------- ----------- ------------ -----
The entire time 277.865 37.510 372.440 84.7
==== cpumask:3 label:2pass ====
period user[sec] system[sec] elapsed[sec] %CPU
--------------------------------- --------- ----------- ------------ -----
Time of making duplicate entries 42.403 2.476 45.594 98.4
Time of making function index 4.556 0.568 4.756 107.7
Time of making file index 0.404 0.344 1.160 64.5
Time of making include file index 12.229 3.128 19.792 77.6
Time of making hypertext 197.568 25.990 297.968 75.0
--------------------------------- --------- ----------- ------------ -----
The entire time 257.192 32.526 369.692 78.4
Diffstat:
global/global.c | 87 +++++++++++++++++++++++++++++---------------------
gtags/gtags.c | 2 -
htags/anchor.c | 37 ++++++++++++++-------
htags/anchor.h | 8 ++--
htags/htags.c | 3 +
htags/htags.h | 1
libutil/format.h | 19 +++++++---
libutil/pathconvert.c | 14 ++++++--
libutil/pathconvert.h | 7 +---
9 files changed, 115 insertions(+), 63 deletions(-)
On Sat, 21 Nov 2009 01:23:00 +0900, Hideki IWAMOTO wrote...
> Hi.
>
> This patch allows specifying both of -r and -s for "global -f" command in
> 2-pass mode.
>
>
> Example:
> $ env GTAGSLABEL=gtags global -fr test.c
> g 1 test.c void f(void){g();}
> $ env GTAGSLABEL=gtags global -fs test.c
> h 2 test.c void g(void){h();}
> $ env GTAGSLABEL=gtags global -frs test.c
> global: both of -s and -r are not allowed.
> $ env GTAGSLABEL=gtags-2pass global -fr test.c
> g 1 test.c void f(void){g();}
> $ env GTAGSLABEL=gtags-2pass global -fs test.c
> h 2 test.c void g(void){h();}
> $ env GTAGSLABEL=gtags-2pass global -frs test.c
> g 1 test.c void f(void){g();}
> h 2 test.c void g(void){h();}
>
> ----
> Hideki IWAMOTO address@hidden
> ______________________________________________________________________
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-global
----
Hideki IWAMOTO address@hidden
20091121-global-frs+ctags-xtype.patch
Description: Binary data