* [gprofng] Parsing of function definitions fails
@ 2022-03-21 16:17 Thomas Gruber
2022-03-21 17:51 ` Vladimir Mezentsev
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gruber @ 2022-03-21 16:17 UTC (permalink / raw)
To: binutils
Hi,
A colleague of mine reported problems when specifying C++ functions in
gp-display-text:
# the function 'csr_spmv_kernel<double, int>' exists
(gp-display-text) fsingle csr_spmv_kernel<double, int>
Error: Invalid number entered: int>
Error: Invalid number entered: int>
Error: No function with given name `csr_spmv_kernel<double,' found.
(gp-display-text) fsingle csr_spmv_kernel<double,int>
Error: No function with given name `csr_spmv_kernel<double,int>' found.
So, spaces in the template parameter list seem to be bad. Moreover, '*'
in the function parameter list seem to be not parsed properly:
(gp-display-text) source csr_spmv_kernel<double,int>(long,long,int
const*,int const*,double const*,double const*,double*)
Warning: extra arguments to source command, line 2
Error: Invalid number entered: const*,int
Error: Invalid number entered: const*,int
Error: No function or file with given name
`csr_spmv_kernel<double,int>(long,long,int' found.
Best,
Thomas
--
Thomas Gruber
Software & Tools
Erlangen National High Performance Computing Center (NHR@FAU)
Friedrich-Alexander University Erlangen-Nürnberg
Martensstraße 1, 91058 Erlangen, Germany
mailto:Thomas.Gruber@fau.de
https://hpc.fau.de/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gprofng] Parsing of function definitions fails
2022-03-21 16:17 [gprofng] Parsing of function definitions fails Thomas Gruber
@ 2022-03-21 17:51 ` Vladimir Mezentsev
2022-03-22 16:51 ` Thomas Gruber
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Mezentsev @ 2022-03-21 17:51 UTC (permalink / raw)
To: Thomas Gruber, binutils
On 3/21/22 09:17, Thomas Gruber wrote:
> Hi,
>
> A colleague of mine reported problems when specifying C++ functions in
> gp-display-text:
>
> # the function 'csr_spmv_kernel<double, int>' exists
>
> (gp-display-text) fsingle csr_spmv_kernel<double, int>
Hi Thomas,
This demangled name should t be surrounded by double quotes:
fsingle "csr_spmv_kernel<double,int>(long,long,int const*,int
const*,double const*,double const*,double*) "
Or you can use this form:
fsingle csr_spmv_kernel [N]
If N is absent, gp-display-text asks which function you want to see.
Thank you,
-Vladimir
> Error: Invalid number entered: int>
> Error: Invalid number entered: int>
> Error: No function with given name `csr_spmv_kernel<double,' found.
> (gp-display-text) fsingle csr_spmv_kernel<double,int>
> Error: No function with given name `csr_spmv_kernel<double,int>' found.
>
> So, spaces in the template parameter list seem to be bad. Moreover,
> '*' in the function parameter list seem to be not parsed properly:
>
> (gp-display-text) source csr_spmv_kernel<double,int>(long,long,int
> const*,int const*,double const*,double const*,double*)
> Warning: extra arguments to source command, line 2
> Error: Invalid number entered: const*,int
> Error: Invalid number entered: const*,int
> Error: No function or file with given name
> `csr_spmv_kernel<double,int>(long,long,int' found.
>
>
> Best,
> Thomas
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gprofng] Parsing of function definitions fails
2022-03-21 17:51 ` Vladimir Mezentsev
@ 2022-03-22 16:51 ` Thomas Gruber
2022-03-22 18:46 ` Vladimir Mezentsev
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gruber @ 2022-03-22 16:51 UTC (permalink / raw)
To: binutils
Hi,
Thanks for the hint. But the double-quotes do not really help.
Function without any template parameter work:
(gp-display-text) fsingle _IO_vfscanf
_IO_vfscanf
Exclusive Total CPU Time: 13.199 ( 14.3%)
Inclusive Total CPU Time: 20.424 ( 22.1%)
Size: 33367
PC Address: 6:0x0006b1f0
Source File: (unknown)
Object File: (unknown)
Load Object: /lib/x86_64-linux-gnu/libc-2.27.so
Mangled Name:
Aliases:
Functions with one template parameter work:
(gp-display-text) fsingle rho_calc<double>
void rho_calc<double>(long, double const*, double*) [clone ._omp_fn.8]
Exclusive Total CPU Time: 1.001 ( 1.1%)
Inclusive Total CPU Time: 1.001 ( 1.1%)
Size: 828
PC Address: 12:0x000064f0
Source File: cg-omp.cpp
Object File: test.6.er/archives/cg-omp_1X48lPAm9a2
Load Object:
/home/hpc/unrz/unrz55/projects/PELS-Tutorial/CG/code/cg-omp
Mangled Name: _Z8rho_calcIdEvlPKT_PS0_._omp_fn.8
Aliases:
But function with multiple template parameters cause problems:
(gp-display-text) fsingle csr_spmv_kernel
Error: No function with given name `csr_spmv_kernel' found.
(gp-display-text) fsingle "csr_spmv_kernel<double, int>(long, long, int
const*, int const*, double const*, double const*, double*)"
Error: No function with given name `csr_spmv_kernel<double, int>(long,
long, int const*, int const*, double const*, double const*, double*)' found.
(gp-display-text) fsingle "csr_spmv_kernel<double,int>(long, long, int
const*, int const*, double const*, double const*, double*)"
Error: No function with given name `csr_spmv_kernel<double,int>(long,
long, int const*, int const*, double const*, double const*, double*)' found.
(gp-display-text) fsingle "csr_spmv_kernel<double,int>"
Error: No function with given name `csr_spmv_kernel<double,int>' found.
(gp-display-text) fsingle csr_spmv_kernel [N]
Error: Invalid number entered: [N]
Error: Invalid number entered: [N]
Error: No function with given name `csr_spmv_kernel' found.
I checked the documentation (gprofng/doc) and there the double-quotes
are not mentioned.
Best,
Thomas
Full list of functions for reference:
(gp-display-text) functions
Functions sorted by metric: Exclusive Total CPU Time
Excl. Incl. Name
Total Total
CPU sec. CPU sec.
92.455 92.455 <Total>
63.304 63.304 void csr_spmv_kernel<double, int>(long, long, int
const*, int const*, double const*, double const*, double*) [clone
._omp_fn.11]
13.199 20.424 _IO_vfscanf
3.362 3.362 void x_r_update<double>(long, double const*,
double const*, double*, double*, double const*) [clone ._omp_fn.13]
2.632 2.632 <static>@0x45142 (<libc-2.27.so>)
2.101 2.782 <static>@0x4917a (<libc-2.27.so>)
1.801 1.801 void p_update<double>(long, double*, double*,
double const*, double const*) [clone ._omp_fn.10]
1.591 1.591 void x_r_update<double>(long, double const*,
double const*, double*, double*, double const*) [clone ._omp_fn.12]
1.021 1.021 _IO_sputbackc
1.001 1.001 void rho_calc<double>(long, double const*,
double*) [clone ._omp_fn.8]
0.630 0.630 read
0.480 0.480 <static>@0x169c14 (<libc-2.27.so>)
0.380 0.380 <static>@0x52411 (<libc-2.27.so>)
0.350 21.135 void allocate_and_initialize<double,
int>(_IO_FILE*, int**, int**, double**, double**, double**, long, long,
long, long, char (&) [4])
0.200 20.624 fscanf
0.090 92.455 BenchmarkResult bench_cg<double, int>(_IO_FILE*,
long, long, long, long, stop_criterion&, char (&) [4])
0.080 0.080 void setup<double>(long, double const*, double*,
double*, double*) [clone ._omp_fn.7]
0.070 0.070 _pthread_cleanup_pop_restore
0.050 0.050 __strtol_internal
0.030 0.030 __strtod_internal
0.030 0.030 _pthread_cleanup_push_defer
0.030 0.030 vfscanf
0.010 71.150 GOMP_parallel
0.010 0.640 _IO_file_underflow
0. 71.170 BenchmarkResult cg<double, int>(stop_criterion&,
long, long, long, int const*, int const*, double const*, double const*,
double*, bool)
0. 0.640 _IO_default_uflow
0. 92.455 __libc_start_main
0. 71.150 double cg_solve_kernel<double,
int>(stop_criterion&, long, long, int const*, int const*, double const*,
double const*, double*)
0. 92.455 main
Am 21.03.22 um 18:51 schrieb Vladimir Mezentsev:
>
>
> On 3/21/22 09:17, Thomas Gruber wrote:
>> Hi,
>>
>> A colleague of mine reported problems when specifying C++ functions in
>> gp-display-text:
>>
>> # the function 'csr_spmv_kernel<double, int>' exists
>>
>> (gp-display-text) fsingle csr_spmv_kernel<double, int>
>
> Hi Thomas,
>
> This demangled name should t be surrounded by double quotes:
> fsingle "csr_spmv_kernel<double,int>(long,long,int const*,int
> const*,double const*,double const*,double*) "
>
>
> Or you can use this form:
> fsingle csr_spmv_kernel [N]
>
> If N is absent, gp-display-text asks which function you want to see.
>
> Thank you,
> -Vladimir
>
>
>
>
>
>
>> Error: Invalid number entered: int>
>> Error: Invalid number entered: int>
>> Error: No function with given name `csr_spmv_kernel<double,' found.
>> (gp-display-text) fsingle csr_spmv_kernel<double,int>
>> Error: No function with given name `csr_spmv_kernel<double,int>' found.
>>
>> So, spaces in the template parameter list seem to be bad. Moreover,
>> '*' in the function parameter list seem to be not parsed properly:
>>
>> (gp-display-text) source csr_spmv_kernel<double,int>(long,long,int
>> const*,int const*,double const*,double const*,double*)
>> Warning: extra arguments to source command, line 2
>> Error: Invalid number entered: const*,int
>> Error: Invalid number entered: const*,int
>> Error: No function or file with given name
>> `csr_spmv_kernel<double,int>(long,long,int' found.
>>
>>
>> Best,
>> Thomas
>>
>>
>
--
Thomas Gruber
Software & Tools
Erlangen National High Performance Computing Center (NHR@FAU)
Friedrich-Alexander University Erlangen-Nürnberg
Martensstraße 1, 91058 Erlangen, Germany
mailto:Thomas.Gruber@fau.de
https://hpc.fau.de/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gprofng] Parsing of function definitions fails
2022-03-22 16:51 ` Thomas Gruber
@ 2022-03-22 18:46 ` Vladimir Mezentsev
0 siblings, 0 replies; 4+ messages in thread
From: Vladimir Mezentsev @ 2022-03-22 18:46 UTC (permalink / raw)
To: Thomas Gruber, binutils
On 3/22/22 09:51, Thomas Gruber wrote:
> Hi,
>
> Thanks for the hint. But the double-quotes do not really help.
>
> Function without any template parameter work:
>
> (gp-display-text) fsingle _IO_vfscanf
> _IO_vfscanf
> Exclusive Total CPU Time: 13.199 ( 14.3%)
> Inclusive Total CPU Time: 20.424 ( 22.1%)
> Size: 33367
> PC Address: 6:0x0006b1f0
> Source File: (unknown)
> Object File: (unknown)
> Load Object: /lib/x86_64-linux-gnu/libc-2.27.so
> Mangled Name:
> Aliases:
>
> Functions with one template parameter work:
>
> (gp-display-text) fsingle rho_calc<double>
> void rho_calc<double>(long, double const*, double*) [clone ._omp_fn.8]
> Exclusive Total CPU Time: 1.001 ( 1.1%)
> Inclusive Total CPU Time: 1.001 ( 1.1%)
> Size: 828
> PC Address: 12:0x000064f0
> Source File: cg-omp.cpp
> Object File: test.6.er/archives/cg-omp_1X48lPAm9a2
> Load Object:
> /home/hpc/unrz/unrz55/projects/PELS-Tutorial/CG/code/cg-omp
> Mangled Name: _Z8rho_calcIdEvlPKT_PS0_._omp_fn.8
> Aliases:
>
> But function with multiple template parameters cause problems:
>
> (gp-display-text) fsingle csr_spmv_kernel
> Error: No function with given name `csr_spmv_kernel' found.
> (gp-display-text) fsingle "csr_spmv_kernel<double, int>(long, long,
> int const*, int const*, double const*, double const*, double*)"
> Error: No function with given name `csr_spmv_kernel<double, int>(long,
> long, int const*, int const*, double const*, double const*, double*)'
> found.
> (gp-display-text) fsingle "csr_spmv_kernel<double,int>(long, long, int
> const*, int const*, double const*, double const*, double*)"
> Error: No function with given name `csr_spmv_kernel<double,int>(long,
> long, int const*, int const*, double const*, double const*, double*)'
> found.
> (gp-display-text) fsingle "csr_spmv_kernel<double,int>"
> Error: No function with given name `csr_spmv_kernel<double,int>' found.
>
Try:
fsingle "void csr_spmv_kernel<double, int>(long, long, int const*,
int const*, double const*, double const*, double*)"
or maybe
fsingle "void csr_spmv_kernel<double, int>(long, long, int const*,
int const*, double const*, double const*, double*) [clone ._omp_fn.11] "
You can find a mangled function name and use this name in fsingle.
To find a mangled function name:
name mangled
func
> (gp-display-text) fsingle csr_spmv_kernel [N]
N must be a number.
But the problem is gp-display-text doesn't know csr_spmv_kernel
> Error: Invalid number entered: [N]
> Error: Invalid number entered: [N]
> Error: No function with given name `csr_spmv_kernel' found.
>
>
> I checked the documentation (gprofng/doc) and there the double-quotes
> are not mentioned.
We are preparing the gprofng documentation.
Temporarily, you can find the description of the commands in our old
product:
https://docs.oracle.com/cd/E19205-01/820-4180/man1/er_print.1.html
fsingle function_name [N | ADDR]
Write the summary panel for the named function. The
optional parameter is needed for those cases where the
function name is ambiguous; see under the "source" com-
mand for more information.
source { filename | function_name } [N | ADDR] ||
Write annotated source of the given object file, or of |
the object file containing the given function. If the |
name of the function is a that of a C++ function or a |
Java method, the demangled name, in either short or |
long form, or the mangled name may be used. If the |
demangled name contains spaces, it must be surrounded |
by double quotes. The optional parameter, N or ADDR, |
is needed for those cases where the filename or func- |
tion name is ambiguous. If the N form is used, pick |
the Nth possible choice (with the numbering starting |
from 1). If there is more than one possibility, and |
the N supplied is not within the possible range, report |
an error; if there is only one possibility, ignore any |
such error. |
If the ADDR form is used, it is written as @segment- |
number:address. The segment-number:address values should be |
specified exactly as they appear as the address metric for |
the function.
If an ambiguous name is given without the specifier, print a
list of choices instead of the annotated source. Each list
item will contain the number that can be used for N, the
name of the object module that references the function or
file and, in the case of an ambiguous function, the function
name.
-Vladimir
>
> Best,
> Thomas
>
>
> Full list of functions for reference:
>
> (gp-display-text) functions
> Functions sorted by metric: Exclusive Total CPU Time
>
> Excl. Incl. Name
> Total Total
> CPU sec. CPU sec.
> 92.455 92.455 <Total>
> 63.304 63.304 void csr_spmv_kernel<double, int>(long, long, int
> const*, int const*, double const*, double const*, double*) [clone
> ._omp_fn.11]
> 13.199 20.424 _IO_vfscanf
> 3.362 3.362 void x_r_update<double>(long, double const*,
> double const*, double*, double*, double const*) [clone ._omp_fn.13]
> 2.632 2.632 <static>@0x45142 (<libc-2.27.so>)
> 2.101 2.782 <static>@0x4917a (<libc-2.27.so>)
> 1.801 1.801 void p_update<double>(long, double*, double*,
> double const*, double const*) [clone ._omp_fn.10]
> 1.591 1.591 void x_r_update<double>(long, double const*,
> double const*, double*, double*, double const*) [clone ._omp_fn.12]
> 1.021 1.021 _IO_sputbackc
> 1.001 1.001 void rho_calc<double>(long, double const*,
> double*) [clone ._omp_fn.8]
> 0.630 0.630 read
> 0.480 0.480 <static>@0x169c14 (<libc-2.27.so>)
> 0.380 0.380 <static>@0x52411 (<libc-2.27.so>)
> 0.350 21.135 void allocate_and_initialize<double,
> int>(_IO_FILE*, int**, int**, double**, double**, double**, long,
> long, long, long, char (&) [4])
> 0.200 20.624 fscanf
> 0.090 92.455 BenchmarkResult bench_cg<double, int>(_IO_FILE*,
> long, long, long, long, stop_criterion&, char (&) [4])
> 0.080 0.080 void setup<double>(long, double const*, double*,
> double*, double*) [clone ._omp_fn.7]
> 0.070 0.070 _pthread_cleanup_pop_restore
> 0.050 0.050 __strtol_internal
> 0.030 0.030 __strtod_internal
> 0.030 0.030 _pthread_cleanup_push_defer
> 0.030 0.030 vfscanf
> 0.010 71.150 GOMP_parallel
> 0.010 0.640 _IO_file_underflow
> 0. 71.170 BenchmarkResult cg<double, int>(stop_criterion&,
> long, long, long, int const*, int const*, double const*, double
> const*, double*, bool)
> 0. 0.640 _IO_default_uflow
> 0. 92.455 __libc_start_main
> 0. 71.150 double cg_solve_kernel<double,
> int>(stop_criterion&, long, long, int const*, int const*, double
> const*, double const*, double*)
> 0. 92.455 main
>
>
> Am 21.03.22 um 18:51 schrieb Vladimir Mezentsev:
>>
>>
>> On 3/21/22 09:17, Thomas Gruber wrote:
>>> Hi,
>>>
>>> A colleague of mine reported problems when specifying C++ functions
>>> in gp-display-text:
>>>
>>> # the function 'csr_spmv_kernel<double, int>' exists
>>>
>>> (gp-display-text) fsingle csr_spmv_kernel<double, int>
>>
>> Hi Thomas,
>>
>> This demangled name should t be surrounded by double quotes:
>> fsingle "csr_spmv_kernel<double,int>(long,long,int const*,int
>> const*,double const*,double const*,double*) "
>>
>>
>> Or you can use this form:
>> fsingle csr_spmv_kernel [N]
>>
>> If N is absent, gp-display-text asks which function you want to see.
>>
>> Thank you,
>> -Vladimir
>>
>>
>>
>>
>>
>>
>>> Error: Invalid number entered: int>
>>> Error: Invalid number entered: int>
>>> Error: No function with given name `csr_spmv_kernel<double,' found.
>>> (gp-display-text) fsingle csr_spmv_kernel<double,int>
>>> Error: No function with given name `csr_spmv_kernel<double,int>' found.
>>>
>>> So, spaces in the template parameter list seem to be bad. Moreover,
>>> '*' in the function parameter list seem to be not parsed properly:
>>>
>>> (gp-display-text) source csr_spmv_kernel<double,int>(long,long,int
>>> const*,int const*,double const*,double const*,double*)
>>> Warning: extra arguments to source command, line 2
>>> Error: Invalid number entered: const*,int
>>> Error: Invalid number entered: const*,int
>>> Error: No function or file with given name
>>> `csr_spmv_kernel<double,int>(long,long,int' found.
>>>
>>>
>>> Best,
>>> Thomas
>>>
>>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-22 18:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 16:17 [gprofng] Parsing of function definitions fails Thomas Gruber
2022-03-21 17:51 ` Vladimir Mezentsev
2022-03-22 16:51 ` Thomas Gruber
2022-03-22 18:46 ` Vladimir Mezentsev
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 read-only IMAP folder(s) and NNTP newsgroup(s).