title: using the gprof -f option in Linux for c++
body: <p>Hi so i have started using gprof for my profiling work and it works fine except for the -f option which allows me to specifiy a particular function to be viewed in the call graph.</p>
  
  <p>for example</p>
  
  <pre><code>                 Call graph (explanation follows)
  
  
  granularity: each sample hit covers 4 byte(s) no time propagated
  
  index % time    self  children    called     name
                  0.00    0.00       1/1           __do_global_ctors_aux [13]
  [5]      0.0    0.00    0.00       1         global constructors keyed to main [5]
                  0.00    0.00       1/1           __static_initialization_and_destruction_0(int, int) [6]
  -----------------------------------------------
                  0.00    0.00       1/1           global constructors keyed to main [5]
  [6]      0.0    0.00    0.00       1         __static_initialization_and_destruction_0(int, int) [6]
  -----------------------------------------------
                  0.00    0.00       1/1           main [4]
  [7]      0.0    0.00    0.00       1         car::DisplayPrice() [7]
  -----------------------------------------------
                  0.00    0.00       1/1           main [4]
  [8]      0.0    0.00    0.00       1         car::showc() [8]
  -----------------------------------------------
                  0.00    0.00       1/1           main [4]
  [9]      0.0    0.00    0.00       1         car::car(std::string, int) [9]
                  0.00    0.00       1/1           vehical::vehical(int, int) [12]
  -----------------------------------------------
                  0.00    0.00       1/1           main [4]
  [10]     0.0    0.00    0.00       1         car::~car() [10]
  -----------------------------------------------
                  0.00    0.00       1/1           main [4]
  [11]     0.0    0.00    0.00       1         vehical::show() [11]
  -----------------------------------------------
                  0.00    0.00       1/1           car::car(std::string, int) [9]
  [12]     0.0    0.00    0.00       1         vehical::vehical(int, int) [12]
  -----------------------------------------------
  </code></pre>
  
  <p>Now if i specify </p>
  
  <pre><code>gprof -f car::car(std::string, int) a.out gmon.out
  </code></pre>
  
  <p>i get error </p>
  
  <blockquote>
    <p>syntax error near unexpected token '('</p>
  </blockquote>
  
  <p>now if i do </p>
  
  <p>gprof -f car::car(std::string, int) a.out gmon.out</p>
  
  <p>i get an error </p>
  
  <blockquote>
    <p>No such file or directory</p>
  </blockquote>
  
  <p>if i try putting the function in double quotes i get an output as above with no change..</p>
  
  <p>CAN Someone please help me with this ??
  Thanks in advance</p>