11

A simple C++ console app

int main()
{
  return 0;
}

compiled in Visual Studio 2015 Update 2 adds a call to telemetry_main_invoke_trigger to both Debug and Release binaries.

enter image description here

How can I prevent this?

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • Full thread [here on reddit](https://www.reddit.com/r/cpp/comments/4ibauu/visual_studio_adding_telemetry_function_calls_to/) – Marco A. Jun 11 '16 at 09:53

1 Answers1

10

According to Microsoft’s Steve Carroll (Development Manager for the Visual C++ team), you can remove telemetry calls by adding notelemetry.obj to the command options of the linker:

enter image description here

Steve Carroll explained that this will be removed in the upcoming Update 3:

Our intent was benign – our desire was to build a framework that will help investigate performance problems and improve the quality of our optimizer should we get any reports of slowdowns or endemic perf problems in the field. We apologize for raising the suspicion levels even further by not including the CRT source, this was just an oversight on our part. Despite that, some of you already investigated how this mechanism works in nice detail. As you have already called out, what the code does is trigger an ETW event which, when it’s turned on, will emit timestamps and module loads events. The event data can only be interpreted if a customer gives us symbol information (i.e. PDBs) so this data is only applicable to customers that are actively seeking help from us and are willing to share these PDBs as part of their investigation. We haven’t actually gone through this full exercise with any customers to date though, and we are so far relying on our established approaches to investigate and address potential problems instead. We plan to remove these events in Update 3. In the meantime, to remove this dependency in Update 2, you should add notelemetry.obj to your linker command line.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • Can i add this into source code with a #pragma comment lib line ? – Lothar Jun 11 '16 at 14:12
  • It doesn't appear to work. I end up with `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\notelemetry.obj : warning LNK4003: invalid library format; library ignored` and the telemetry stubs are still present in the binary. – Joel Jun 22 '16 at 14:26
  • this is the x86 one, if you compile for x64 the lib from amd64 must be used – magicandre1981 Jun 22 '16 at 15:40