Re: FW: Question about aarch64

8 views
Skip to first unread message

Heike Jagode

unread,
Feb 8, 2023, 1:58:42 PM2/8/23
to Poole, Steve, ptools-perfapi, perfapi-devel
Hi Steve,

This error comes from libpfm4 and relates to gcc's newer versions complaining about snprintf().
Are you using the latest version from master?
Can you try recompiling with the option -Wno-error=format-truncation to make format-truncation non-fatal?

Thanks,
Heike

On Sat, Feb 4, 2023 at 2:20 AM Poole, Steve <swp...@lanl.gov> wrote:

 

From: "Poole, Steve" <swp...@lanl.gov>
Date: Thursday, February 2, 2023 at 3:10 AM
To: "ptools-...@icl.utk.edu" <ptools-...@icl.utk.edu>
Subject: Question about aarch64

 

I am trying to build PAPI on aarch64 (specifically the Ampere 80 core device on the Nvidia DevKits).

Has this already been built? I am getting errors as below::

 

make[2]: Entering directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib'

gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c

pfmlib_perf_event_pmu.c: In function ‘gen_tracepoint_table’:

pfmlib_perf_event_pmu.c:349:50: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                                                  ^~

pfmlib_perf_event_pmu.c:349:17: note: snprintf’ output between 2 and 4352 bytes into a destination of size 4096

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pfmlib_perf_event_pmu.c:399:58: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                                                          ^~

pfmlib_perf_event_pmu.c:399:25: note: snprintf’ output between 5 and 4355 bytes into a destination of size 4096

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

 

I am using gcc/12.1.0.

 

Thanks..

 

V/r,

Steve…

 

Cell     : (505) 695-3033

Office  : (505) 664-0584

 

IMPORTANT NOTICE: The contents of this email and any attachments are company confidential and

may also be privileged. If you are not the intended recipient, please notify the sender immediately

and do not disclose the contents to any other person, use it for any purpose, or store or copy the

information in any medium.

Thank you.

 

 



--
______________________________________
Heike Jagode, Ph.D., Research Asst. Professor
Innovative Computing Laboratory, University of Tennessee Knoxville
http://icl.utk.edu/~jagode/

Poole, Steve

unread,
Feb 8, 2023, 2:15:28 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

Will do and send the results. I did download what I think is the latest master.

 

Thank you!!

Poole, Steve

unread,
Feb 8, 2023, 3:06:55 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

I went all the way back to gcc-10.30 same results.

I can go back to gcc-9.x if that might help.

 

V/r,

Steve…

 

Cell     : (505) 695-3033

Office  : (505) 664-0584

 

IMPORTANT NOTICE: The contents of this email and any attachments are company confidential and

may also be privileged. If you are not the intended recipient, please notify the sender immediately

and do not disclose the contents to any other person, use it for any purpose, or store or copy the

information in any medium.

Thank you.

 

 

 

From: "Poole, Steve" <swp...@lanl.gov>
Date: Wednesday, February 8, 2023 at 12:25 PM
To: Heike Jagode <jag...@icl.utk.edu>, ptools-perfapi <ptools-...@icl.utk.edu>, perfapi-devel <perfap...@icl.utk.edu>
Subject: Re: [EXTERNAL] Re: FW: Question about aarch64

 

Here are the results::

 

./configure --prefix=/vast/home/spoole/local-darwin-G+H  LDFLAGS="-Wno-error=format-truncation"

 

 make

make -C /vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4 ARCH="aarch64" CC="gcc  -Wno-override-init"  lib

make[1]: Entering directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4'

make -C lib

make[2]: Entering directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib'

gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c

pfmlib_perf_event_pmu.c: In function ‘gen_tracepoint_table’:

pfmlib_perf_event_pmu.c:349:50: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                                                  ^~

pfmlib_perf_event_pmu.c:349:17: note: snprintf’ output between 2 and 4352 bytes into a destination of size 4096

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pfmlib_perf_event_pmu.c:399:58: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                                                          ^~

pfmlib_perf_event_pmu.c:399:25: note: snprintf’ output between 5 and 4355 bytes into a destination of size 4096

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

make[2]: *** [/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/../rules.mk:30: pfmlib_perf_event_pmu.o] Error 1

make[2]: Leaving directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib'

make[1]: *** [Makefile:52: lib] Error 2

make[1]: Leaving directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4'

make: *** [Rules.pfm4_pe:41: /vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/libpfm.a] Error 2

 

 

V/r,

Steve…

 

Cell     : (505) 695-3033

Office  : (505) 664-0584

 

IMPORTANT NOTICE: The contents of this email and any attachments are company confidential and

may also be privileged. If you are not the intended recipient, please notify the sender immediately

and do not disclose the contents to any other person, use it for any purpose, or store or copy the

information in any medium.

Thank you.

 

 

 

From: Heike Jagode <jag...@icl.utk.edu>


Date: Wednesday, February 8, 2023 at 11:58 AM
To: "Poole, Steve" <swp...@lanl.gov>, ptools-perfapi <ptools-...@icl.utk.edu>, perfapi-devel <perfap...@icl.utk.edu>
Subject: [EXTERNAL] Re: FW: Question about aarch64

 

Hi Steve,

Poole, Steve

unread,
Feb 8, 2023, 3:06:58 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

9.x has the same results. It is like the build is not seeing my CFLAGS options.

Poole, Steve

unread,
Feb 8, 2023, 3:07:01 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

Here are the results::

 

./configure --prefix=/vast/home/spoole/local-darwin-G+H  LDFLAGS="-Wno-error=format-truncation"

 

 make

make -C /vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4 ARCH="aarch64" CC="gcc  -Wno-override-init"  lib

make[1]: Entering directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4'

make -C lib

make[2]: Entering directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib'

gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c

pfmlib_perf_event_pmu.c: In function ‘gen_tracepoint_table’:

pfmlib_perf_event_pmu.c:349:50: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                                                  ^~

pfmlib_perf_event_pmu.c:349:17: note: snprintf’ output between 2 and 4352 bytes into a destination of size 4096

  349 |                 snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);

      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pfmlib_perf_event_pmu.c:399:58: error: %s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                                                          ^~

pfmlib_perf_event_pmu.c:399:25: note: snprintf’ output between 5 and 4355 bytes into a destination of size 4096

  399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);

      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

make[2]: *** [/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/../rules.mk:30: pfmlib_perf_event_pmu.o] Error 1

make[2]: Leaving directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib'

make[1]: *** [Makefile:52: lib] Error 2

make[1]: Leaving directory '/vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4'

make: *** [Rules.pfm4_pe:41: /vast/home/spoole/src/G+H/TAKE/papi-master/src/libpfm4/lib/libpfm.a] Error 2

 

 

V/r,

Steve…

 

Cell     : (505) 695-3033

Office  : (505) 664-0584

 

IMPORTANT NOTICE: The contents of this email and any attachments are company confidential and

may also be privileged. If you are not the intended recipient, please notify the sender immediately

and do not disclose the contents to any other person, use it for any purpose, or store or copy the

information in any medium.

Thank you.

 

 

 

From: Heike Jagode <jag...@icl.utk.edu>


Date: Wednesday, February 8, 2023 at 11:58 AM
To: "Poole, Steve" <swp...@lanl.gov>, ptools-perfapi <ptools-...@icl.utk.edu>, perfapi-devel <perfap...@icl.utk.edu>
Subject: [EXTERNAL] Re: FW: Question about aarch64

 

Hi Steve,

Heike Jagode

unread,
Feb 8, 2023, 3:07:03 PM2/8/23
to Poole, Steve, ptools-perfapi, perfapi-devel
The compiler flag you passed to the PAPI configure line is not passed to libpfm4. That's why libpfm4 doesn't compile with it.

As a temporary option, you can add "CFLAGS +=-Wno-error=format-truncation" at the end of config.mk under src/libpfm4. At least it should make progress with the compilation.

Thanks,
Heike

Poole, Steve

unread,
Feb 8, 2023, 3:07:03 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

Did a hack which I think might work. I will let you know.

Poole, Steve

unread,
Feb 8, 2023, 3:14:20 PM2/8/23
to Heike Jagode, ptools-perfapi, perfapi-devel

That is sort of what I did in my hack.

Heike Jagode

unread,
Feb 8, 2023, 3:19:48 PM2/8/23
to Poole, Steve, ptools-perfapi, perfapi-devel
Excellent! Thanks, Steve! Keep us posted!

Heike
Reply all
Reply to author
Forward
0 new messages