Click here to Skip to main content
15,885,309 members
Articles / Web Development / HTML

Building a Mixed-Mode Sampling Profiler

Rate me:
Please Sign up or sign in to vote.
4.90/5 (19 votes)
31 Jul 2014Ms-PL17 min read 64.1K   1.9K   41  
Walking a native and a managed callstack is fairly easy. Walking a mixed-mode callstack is much much harder. Existing documentation is truly minimal. I hope this article and its sample profiler can shed some light in this area.

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiagProfiler", "DiagProfiler\DiagProfiler.vcxproj", "{0E6B854A-DB53-4E77-9243-43803B7A1590}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiagProfilerConsole", "DiagProfilerConsole\DiagProfilerConsole.vcxproj", "{DEA95610-A29C-4D20-8729-A48CCD47C101}"
	ProjectSection(ProjectDependencies) = postProject
		{0E6B854A-DB53-4E77-9243-43803B7A1590} = {0E6B854A-DB53-4E77-9243-43803B7A1590}
	EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiagProfilerLauncher", "DiagProfilerLauncher\DiagProfilerLauncher.csproj", "{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiagProfilerClient", "DiagProfilerClient\DiagProfilerClient.vcxproj", "{D2A48991-3FC3-43F4-89CC-5919E8D4F040}"
	ProjectSection(ProjectDependencies) = postProject
		{0E6B854A-DB53-4E77-9243-43803B7A1590} = {0E6B854A-DB53-4E77-9243-43803B7A1590}
	EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ECD93F38-2CA6-47A5-8290-CA690C3F28F2}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|Mixed Platforms = Debug|Mixed Platforms
		Debug|Win32 = Debug|Win32
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|Mixed Platforms = Release|Mixed Platforms
		Release|Win32 = Release|Win32
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|Any CPU.ActiveCfg = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|Mixed Platforms.Build.0 = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|Win32.ActiveCfg = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|Win32.Build.0 = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Debug|x86.ActiveCfg = Debug|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|Any CPU.ActiveCfg = Release|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|Mixed Platforms.ActiveCfg = Release|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|Mixed Platforms.Build.0 = Release|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|Win32.ActiveCfg = Release|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|Win32.Build.0 = Release|Win32
		{0E6B854A-DB53-4E77-9243-43803B7A1590}.Release|x86.ActiveCfg = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|Any CPU.ActiveCfg = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|Mixed Platforms.Build.0 = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|Win32.ActiveCfg = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|Win32.Build.0 = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Debug|x86.ActiveCfg = Debug|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|Any CPU.ActiveCfg = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|Mixed Platforms.ActiveCfg = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|Mixed Platforms.Build.0 = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|Win32.ActiveCfg = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|Win32.Build.0 = Release|Win32
		{DEA95610-A29C-4D20-8729-A48CCD47C101}.Release|x86.ActiveCfg = Release|Win32
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|Any CPU.ActiveCfg = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|Mixed Platforms.Build.0 = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|Win32.ActiveCfg = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|x86.ActiveCfg = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Debug|x86.Build.0 = Debug|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|Any CPU.ActiveCfg = Release|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|Mixed Platforms.ActiveCfg = Release|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|Mixed Platforms.Build.0 = Release|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|Win32.ActiveCfg = Release|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|x86.ActiveCfg = Release|x86
		{2928C701-6B4C-40DB-9C8C-B9E6F17EDA94}.Release|x86.Build.0 = Release|x86
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|Any CPU.ActiveCfg = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|Mixed Platforms.Build.0 = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|Win32.ActiveCfg = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|Win32.Build.0 = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Debug|x86.ActiveCfg = Debug|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|Any CPU.ActiveCfg = Release|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|Mixed Platforms.ActiveCfg = Release|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|Mixed Platforms.Build.0 = Release|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|Win32.ActiveCfg = Release|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|Win32.Build.0 = Release|Win32
		{D2A48991-3FC3-43F4-89CC-5919E8D4F040}.Release|x86.ActiveCfg = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Architect Visma Software AB
Sweden Sweden
Mattias works at Visma, a leading Nordic ERP solution provider. He has good knowledge in C++/.Net development, test tool development, and debugging. His great passion is memory dump analysis. He likes giving talks and courses.

Comments and Discussions