optopgprof is segfaulting

Pgcollect does not write proper output for pgprof but retains data in /var/lib/oprofile/samples/
when event based sampling is used.
This can be reproduced under SLES 11 SP 3 with pgcc 14.9-0 64-bit target on x86-64 Linux and
pgcc 15.10-0 64-bit target on x86-64 Linux with -tp bulldozer and -tp sandybridge for root and
non root users.

pgcollect -es-function my_profile ./a.out results in:

pgoprun: line 579: 39384 Speicherzugriffsfehler optopgprof --pid=$programpid --fq $blocks $exe > $tf 2>&1

followed by:

DEBUG 5: execute ‘ldd ./a.out’
DEBUG 6: execute ‘opreport -d --merge=cpu,tid,tgid,unitmask --sort=vma ./a,out’
Using /var/lib/oprofile/samples/ for samples directory.
DEBUG 1: execute ‘opreport --merge=cpu -d event:CPU_CLK_UNHALTED count:240000 --sort=vma ./a.out’
Using /var/lib/oprofile/samples/ for samples directory.
DEBUG 7: execute ‘opreport --merge=cpu,tid,tgid,unitmask -d --sort=vma --no-header ./a.out’
Using /var/lib/oprofile/samples/ for samples directory.

a.out was compiled with -O0 -mp -Mprof=ccff
.pgoprun contains:

my_profile () {
   event[${#event[@]}]=--event=CPU_CLK_UNHALTED:${mhz}00:0x00:0:1 # 0, 1, 2 - yes

However pgcollect without event based sampling seems to work fine.

There was one similar thread in 2009 ‘Error while profiling with "pgcollect -allcache ./a.ou’ which unfortunately was
never successfully closed.

Is there something I have missed? Thank you for any ideas.

Best regards


We no longer ship pgcollect as of the current 16.1 release.

See http://www.pgi.net/twiki/bin/view.cgi/Projects/ProjectPgprofNext
about how to use the new pgprof to do this.