Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:42:24+00:00 2026-05-13T17:42:24+00:00

My standard Linux way of profiling app is: 1) compile with g++ -pg 2)

  • 0

My standard Linux way of profiling app is:

1) compile with g++ -pg
2) run prog
3) gprof

Apparently gprof is broek on MacOSX 10.5, and I am supposed to use Shark. All the tutorials I’ve found aby Shark involves XCode (whereas my build is done with Makefiels and g++).

Can someone post step by step instructions for using shark on an app built with g++? Say something like:

int main() { while(1); }

g++ blah.cpp -o blah; do I need to give it more command line arguments?

how do I use shark here?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:42:24+00:00Added an answer on May 13, 2026 at 5:42 pm

    Instrumented profiling such as gprof is not particularly useful unless you really just want to know about call graphs and the number of times that functions are called. Much more useful for performance analysis is a sampling profiler, and for this Apple’s Shark tool (part of CHUD) is one of the best.

    You really don’t need to use Xcode to build an app for profiling under Shark – I have command line tools built with Makefiles that I profile with Shark all the time. You can either trigger Shark automatically from within your code (there are a couple of different APIs for this) or you can use the “chudRemoteCtrl” command line tool (man chudRemoteCtrl) or you can just configure the Launch options in Shark to set the executable path, working directory, command line arguments, etc, and away you go. Make sure you build your app with -g so that Shark can display source code rather than disassembled object code.

    Shark configuration for command line tool http://www.freeimagehosting.net/uploads/386737a1fa.jpg

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a standard Linux command i can use to read a file chunk
I have standard source code package under Linux which requires to run ./configure make
Is their a standard way to make a particular window borderless on Linux? I
I'm trying to run my C#/C++ app on Linux after developing it on Windows.
Porting a Qt 4.6.3 application from Windows to Linux. The standard way to port
Is there a standard linux/unix pattern for communicating with long running process? For example,
Is there a way I can do something like the following using the standard
What is the standard way to retrive and check for the argc and argv
I'm developing application with Qt Embedded and run it in linux framebuffer. I need
Background I used to have a standard Linux hosting account for my domain with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.