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 8444463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:24:13+00:00 2026-06-10T09:24:13+00:00

I now have a project which I want do profiling on, but it used

  • 0

I now have a project which I want do profiling on, but it used another library which I have no control of. Say if there if such a function:

#include <library.h>
void function(...)
{
    // do something
    for (...)
    {
        // ...
        library_function(...);
        // ...
    }
    // do something
}

Let’s assume that library_function is from another static library which is not compiled with profiling enabled. Now if gprof tells me running function took 10s including all its children, will this include the time spent in library_function?

  • 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-06-10T09:24:13+00:00Added an answer on June 10, 2026 at 9:24 am

    No, because the way gprof works, it samples the program counter, figures out which function the program counter is in, and increments the self time for that function.

    In addition, it counts the number of times any function A calls any function B.

    From that, it tries to figure everything else out.

    Of course, this only works for functions it knows about.

    It’s very clever, but you can do better.

    ADDED: since somebody in their wisdom decided to delete the above post, here is a brief summary of how you can do better:

    Try this instead.
    Here’s an example of a 44x speedup.
    Here’s a 730x speedup.
    Here’s an explanation of the statistics.
    Here’s an answer to critiques.
    Here’s an 8-minute video demonstration.

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

Sidebar

Related Questions

I have an project which is dependent on the another project. But now i
Now I have a Xcode project which is built for iOS 5, but now
I have a library project which contains an abstract class, let's say ClassA .
I have a C++ project which uses Makefile,now i want to use QT creator
I have three projects under another project of which each contains one namespace. Now
I have a project which fully designed for smart phone and now, I need
ok i have a project which has many gridview in its pages... now i
I am writing a MVC3 project. Right now I have a table which has
I am writing a MVC3 project. Right now I have a table which has
I am a C programmer (on linux), but now I have a project on

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.