Opened 10 years ago

Last modified 10 years ago

#44628 new request

gprof for Mac via MacPorts

Reported by: Haefler1985 Owned by: macports-tickets@…
Priority: Low Milestone:
Component: ports Version: 2.3.1
Keywords: gprof Cc: cooljeanius (Eric Gallager)
Port: N.A.

Description

Hello,

I am wondering if anyone has yet considered to include gprof as a port.

https://www.cs.utah.edu/dept/old/texinfo/as/gprof_toc.html

I have read that there are several problems with Mac OSX using gprof anyways. If I can help I certainly would, but I am a very inexperienced programmer.

Cheers,

Benni

Change History (4)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

/usr/bin/gprof is included in OS X but it's probably BSD gprof not GNU gprof.

GNU gprof is part of binutils, isn't it? We have a binutils port, but it doesn't install gprof; I don't know why. Maybe GNU gprof is not compatible with OS X. Or maybe gprof is not installed by default, but could be, by some means. If you can figure out what those means are, let us know.

comment:2 in reply to:  1 ; Changed 10 years ago by Haefler1985

Replying to ryandesign@…:

/usr/bin/gprof is included in OS X but it's probably BSD gprof not GNU gprof.

GNU gprof is part of binutils, isn't it? We have a binutils port, but it doesn't install gprof; I don't know why. Maybe GNU gprof is not compatible with OS X. Or maybe gprof is not installed by default, but could be, by some means. If you can figure out what those means are, let us know.

Yes, gprof is part of binutils. It is not installed in /usr/bin/gprof/on my machine?!?

There are some problems, e.g. with g++/gcc-mp-4.8/2.9 the flag -pg does not work..... see: https://rachelbythebay.com/w/2012/09/14/mac/

If there is a compiler which handles the flag "-pg" and therefore produces "gmon.out" I could test gprof. First question would be which compiler implementation can handle the relevant flag "-pg"!?! Or am I on the wrong track?

comment:3 in reply to:  2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ben.haefele@…:

Yes, gprof is part of binutils. It is not installed in /usr/bin/gprof/on my machine?!?

It is part of the command line tools package; make sure you've installed that.

There are some problems, e.g. with g++/gcc-mp-4.8/2.9 the flag -pg does not work..... see: https://rachelbythebay.com/w/2012/09/14/mac/

If there is a compiler which handles the flag "-pg" and therefore produces "gmon.out" I could test gprof. First question would be which compiler implementation can handle the relevant flag "-pg"!?! Or am I on the wrong track?

Sorry; I don't know about such things.

comment:4 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.