Forum Discussion

MartinB_1's avatar
Occasional Contributor
15 years ago

Performance Profiling sprintf and friends

I'm currently testing some number parsing, where swscanf is used to parse the numbers.

To get proper timings for the calling funtction, I wanted to include the swscanf function in the Performance profiler.

However, I cannot get this to work.


1) The executable calls swscanf (among other things)

2) PE Reader -> lists MSVCR80.dll and MSVCRT.dll both of which have swscanf in the export table

3) Right-Click "Add Module to project on these two DLLs

4) They are listed in the module list, however only msvcrt.dll contains any functions there.

5) Either add the whole msvcrt.dll to a Routine-Area, or add just swscanf

6) Run Performance Profiler.


* The Function that calls swscanf is line-profiled, the timings seem OK and the line containing the swscanf call correctly shows some percentage value.

* (!) Neither the call tree nor the Details or Report panel show the swscanf function.

The path for msvcr80.dll is shown as C:\WINDOWS\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989

The path for msvcrt.dll is shown as C\windows\system32

Isn't it possible to have timings included from these system DLLs?

Note that timings from kernel32.dll work allright (e.g. Sleep)



1 Reply

  • MartinB_1's avatar
    Occasional Contributor
    I found the problem:

    Options > General > [ ] Exclude Standard Source Files must not be ticked. (It seems to be on by default.)

    Then it is sufficient to include MSVCR80.dll and one can profile swscanf.obj