diff options
author | Massimiliano Mantione <massi@mono-cvs.ximian.com> | 2008-10-10 18:20:40 +0400 |
---|---|---|
committer | Massimiliano Mantione <massi@mono-cvs.ximian.com> | 2008-10-10 18:20:40 +0400 |
commit | 198a8665153aadb61b6ab4d91881dc22509f6742 (patch) | |
tree | 484785dc04fc21a57c28fe18136c81f41b9f755d /Mono.Profiler | |
parent | 08217c3893c7b60f99f071acfa113ee250522cfc (diff) |
Preliminary (but working) code to control the profiler at runtime.
svn path=/trunk/mono-tools/; revision=115432
Diffstat (limited to 'Mono.Profiler')
-rw-r--r-- | Mono.Profiler/Mono.Profiler.mds | 4 | ||||
-rw-r--r-- | Mono.Profiler/mprof-runtime/AssemblyInfo.cs | 30 | ||||
-rw-r--r-- | Mono.Profiler/mprof-runtime/Runtime.cs | 16 | ||||
-rw-r--r-- | Mono.Profiler/mprof-runtime/mprof-runtime.mdp | 24 |
4 files changed, 74 insertions, 0 deletions
diff --git a/Mono.Profiler/Mono.Profiler.mds b/Mono.Profiler/Mono.Profiler.mds index 217748fc..f579e3f4 100644 --- a/Mono.Profiler/Mono.Profiler.mds +++ b/Mono.Profiler/Mono.Profiler.mds @@ -5,12 +5,14 @@ <Entry build="True" name="mprof-decoder" configuration="Debug" /> <Entry build="True" name="mprof-heap-viewer" configuration="Debug" /> <Entry build="True" name="mprof-heap-explorer" configuration="Debug" /> + <Entry build="True" name="mprof-runtime" configuration="Debug" /> </Configuration> <Configuration name="Release" ctype="CombineConfiguration"> <Entry build="True" name="mprof-decoder-library" configuration="Release" /> <Entry build="True" name="mprof-decoder" configuration="Release" /> <Entry build="True" name="mprof-heap-viewer" configuration="Release" /> <Entry build="True" name="mprof-heap-explorer" configuration="Release" /> + <Entry build="True" name="mprof-runtime" configuration="Release" /> </Configuration> </Configurations> <StartMode startupentry="mprof-decoder" single="True"> @@ -18,6 +20,7 @@ <Execute type="None" entry="mprof-decoder" /> <Execute type="None" entry="mprof-heap-viewer" /> <Execute type="None" entry="mprof-heap-explorer" /> + <Execute type="None" entry="mprof-runtime" /> </StartMode> <MonoDevelop.ChangeLogAddIn.ChangeLogInfo policy="UpdateNearestChangeLog" /> <Entries> @@ -25,5 +28,6 @@ <Entry filename="profiler-file-decoder/profiler-file-decoder.mdp" /> <Entry filename="heap-snapshot-viewer/heap-snapshot-viewer.mdp" /> <Entry filename="heap-snapshot-explorer/heap-snapshot-explorer.mdp" /> + <Entry filename="mprof-runtime/mprof-runtime.mdp" /> </Entries> </Combine>
\ No newline at end of file diff --git a/Mono.Profiler/mprof-runtime/AssemblyInfo.cs b/Mono.Profiler/mprof-runtime/AssemblyInfo.cs new file mode 100644 index 00000000..1acaf869 --- /dev/null +++ b/Mono.Profiler/mprof-runtime/AssemblyInfo.cs @@ -0,0 +1,30 @@ +// AssemblyInfo.cs created with MonoDevelop +// User: massi at 7:28 PMĀ 9/7/2008 +// +// To change standard headers go to Edit->Preferences->Coding->Standard Headers +// +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("mprof-runtime")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// If the build and revision are set to '*' they will be updated automatically. + +[assembly: AssemblyVersion("1.0.*.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/Mono.Profiler/mprof-runtime/Runtime.cs b/Mono.Profiler/mprof-runtime/Runtime.cs new file mode 100644 index 00000000..eb104a3a --- /dev/null +++ b/Mono.Profiler/mprof-runtime/Runtime.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Mono.Profiler { + public class RuntimeControls { + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + public static extern void TakeHeapSnapshot (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + public static extern void EnableProfiler (); + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + public static extern void DisableProfiler (); + } +} diff --git a/Mono.Profiler/mprof-runtime/mprof-runtime.mdp b/Mono.Profiler/mprof-runtime/mprof-runtime.mdp new file mode 100644 index 00000000..4dcbe4b9 --- /dev/null +++ b/Mono.Profiler/mprof-runtime/mprof-runtime.mdp @@ -0,0 +1,24 @@ +<Project name="mprof-runtime" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject"> + <Configurations active="Debug"> + <Configuration name="Debug" ctype="DotNetProjectConfiguration"> + <Output directory="bin/Debug" assembly="mprof-runtime" /> + <Build debugmode="True" target="Library" /> + <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> + </Configuration> + <Configuration name="Release" ctype="DotNetProjectConfiguration"> + <Output directory="bin/Release" assembly="mprof-runtime" /> + <Build debugmode="False" target="Library" /> + <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> + </Configuration> + </Configurations> + <Contents> + <File name="Runtime.cs" subtype="Code" buildaction="Compile" /> + <File name="AssemblyInfo.cs" subtype="Code" buildaction="Compile" /> + </Contents> + <References> + <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </References> + <Deployment.LinuxDeployData generatePcFile="False" /> +</Project>
\ No newline at end of file |