Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function names are not resolved if profilee exits too soon (original: The column Function does not contain function names) #59

Closed
sebhtml opened this issue May 13, 2020 · 20 comments

Comments

@sebhtml
Copy link

sebhtml commented May 13, 2020

Hello,

Versions

  • Microsoft Windows 10 Pro
  • Microsoft Visual Studio Professional 2015 Version 14.0.25431.01 Update 3
  • MicroProfiler 1.7.624.0

Steps to reproduce

  1. File -> New -> Project... -> Win32 Console Application
  2. Right-click on project, click "Enabled profiling"
  3. Press CTRL + F5

Expected result

A table with function names is shown, including function names.

Actual result

A table with function names is shown, but function names are all empty strings.

microprofiler-bug

@tyoma
Copy link
Owner

tyoma commented May 14, 2020

Hi

This seems to be a known issue with dbghelp.dll that cannot read 'fast' PDBs.
Please try to set "Project Settings / Linker / Generate Debug Info" to /DEBUG or /DEBUG:FULL rather then /DEBUG:FASTLINK. See #52

Thank you,
Artem

@sebhtml
Copy link
Author

sebhtml commented May 14, 2020

Hi,

In Visual Studio 2015, I am using /DEBUG.

I tried /DEBUG:FULL :
image

Thank you.

@tyoma
Copy link
Owner

tyoma commented May 14, 2020

Got it.
Another thing that comes to mind - since your application is very small (I presume it's just a basic template ConsoleApplication) the symbols may not be loaded during the application lifetime (the loading is done in the profilee process asyncrhonously). Can you please add waiting for user input before exiting it?

thanks,
Artem

@sebhtml
Copy link
Author

sebhtml commented May 14, 2020

Hi tyoma,

You were right.

With the following Win32 Console Application, it does work.

// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <sstream>

int main()
{
	std::ostringstream s;
	for (size_t i = 0; i < 100000; ++i)
	{
		s << i << std::endl;
	}

	std::cout << s.str() << std::endl;

    return 0;
}

image

It means that the problem is not a problem with MicroProfiler or with Visual Studio, but rather with the options used when building the proprietary software I am working on at my job.

You can thus close the issue.

I thank you for your time and expertise.

@tyoma
Copy link
Owner

tyoma commented May 14, 2020

Cool! In fact, it still seems to be kind of an issue - applications running too fast will leave UI without function names - I'll better keep this issue open for a time being...
Meanwhile, if you're going to use it and it turns to be helpful for you - please, leave a review on Marketplace.
Thanks!

@sebhtml
Copy link
Author

sebhtml commented May 14, 2020

Meanwhile, if you're going to use it and it turns to be helpful for you - please, leave a review on Marketplace.

Done:

https://marketplace.visualstudio.com/items?itemName=ArtemGevorkyan.MicroProfilerx64x86&ssr=false#review-details

Thanks

@tyoma
Copy link
Owner

tyoma commented May 14, 2020

Thanks!

@tyoma tyoma changed the title The column Function does not contain function names Function names are not resolved if profilee exits too soon (original: The column Function does not contain function names) May 14, 2020
@sebhtml
Copy link
Author

sebhtml commented May 14, 2020

Hi tyoma,

With what you said in mind, I found a workaround to be able to have symbols in the profiling table when using MicroProfiler.

I simply added a sleep before my program exits.


+#include <chrono>

+       std::this_thread::sleep_for (std::chrono::seconds(60));

image

@sebhtml
Copy link
Author

sebhtml commented May 14, 2020

@tyoma Nice new edited title BTW.

TIL my programs are profilees.

@tyoma
Copy link
Owner

tyoma commented May 15, 2020

Isn't it the same to employer/employee?

@sebhtml
Copy link
Author

sebhtml commented May 15, 2020

Yes, it is.

English is not my mother tongue.

I use caller/callee. But I had never saw profiler/profilee.

@tyoma
Copy link
Owner

tyoma commented May 17, 2020

neither it's mine ))

tyoma added a commit that referenced this issue Oct 23, 2021
…rocess last stat update and necessary metadata is requested

- 'exiting' invokes disconnection sequence in frontend, that requests the last update and then all the missing metadata from the collector;
- symbol_resolver invalidation leads to statistics views invalidation;
- tables::module_mappings now provides mapping layout (this moved from the symbol_resolver).
@tyoma tyoma closed this as completed Oct 25, 2021
tyoma added a commit that referenced this issue Oct 25, 2021
…last update batch if no metadata is necessary
@tyoma
Copy link
Owner

tyoma commented Oct 25, 2021

@sebhtml, @r-pankevicius, guys, please check the new release (2.0.637) for the fix of this.
Thank you!

@r-pankevicius
Copy link

@tyoma
Pulled latest, compiled and ran playground vs standalone (Debug, Win32).
No issues with function names now, and the little magic happened: main was called 1 time, not 0.
image
Looks good for me, thank you.
I don't have plans to install release version, though.

My version is:

commit 32f6981c643b93997752d414f631fd6684772b28 (tag: v2.0.638.0, origin/master, origin/HEAD)
Author: Artem G <email>
Date:   Mon Oct 25 16:29:31 2021 -0600

@tyoma
Copy link
Owner

tyoma commented Oct 26, 2021

thanks @r-pankevicius!

@r-pankevicius
Copy link

@tyoma Some time ago I saw the issue: if time is more that 1s it is reported as 0.
Not sure if I was fooled by "1 call was reported as 0" then or such issue existed.

Anyway, now I see times longer than 1 second OK.

@sebhtml
Copy link
Author

sebhtml commented Nov 5, 2021

@tyoma I will try it out at work in Visual Studio 2019 to test the water. Thanks !

@tyoma
Copy link
Owner

tyoma commented Nov 9, 2021

thanks, @sebhtml !

@sebhtml
Copy link
Author

sebhtml commented Nov 17, 2021

@tyoma

Hi Artem,

I installed MicroProfiler Version 2.0.637.0 in Visual Studio Professional 2019 Version 16.7.5 and it works well. Thanks.

@tyoma
Copy link
Owner

tyoma commented Nov 17, 2021

Cool, thanks @sebhtml !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants