title: How do I get `cProfile.run` to log time consumed by calls to `str`?
body: <p>I'm trying to analyze the performance of some code that makes a lot of calls to <code>str</code> to see if I can benefit from substituting other approaches for the use of <code>str</code>, but I can't get <code>cProfile.run</code> to show me how much time calls to <code>str</code> are consuming.</p>
  
  <p>For example if I test the (nonsense) code </p>
  
  <pre><code>def foo(n):
      x = ''
      for i in range(n):
          x += str(n)
          x = str(len(str(n)))
  </code></pre>
  
  <p>with <code>cProfile.run('foo(1000000)')</code> I get no mention of the many calls that must have been made to <code>str</code>:</p>
  
  <pre><code>         1000004 function calls in 1.163 seconds
  
     Ordered by: standard name
  
     ncalls  tottime  percall  cumtime  percall filename:lineno(function)
          1    0.000    0.000    1.163    1.163 &lt;string&gt;:1(&lt;module&gt;)
          1    1.046    1.046    1.163    1.163 example.py:172(foo)
    1000000    0.081    0.000    0.081    0.000 {len}
          1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
          1    0.036    0.036    0.036    0.036 {range}
  </code></pre>
  
  <p>How do I get <code>cProfile.run</code> to show statistics for calls to <code>str</code>?</p>