Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (19 posts)

CLR Profiler 2.0 or 4.0 doesn't work in Vista

Last post 6/17/2011 2:32 AM by Funkmasonry Industries. 18 replies.
  • 6/8/2011 3:35 AM

    CLR Profiler 2.0 or 4.0 doesn't work in Vista

    I've tried placing the CLR Profiler .exe and .dll files locally to the .exe being tested, and even registered the .dll in admin mode, and even ran the .exe in admin mode, and it just won't connect to my XNA 4.0 game.  Is there any way to do this?

    Due to the new garbage produced by XACT in XNA Game Studio 4.0, and the garbage even SoundEffect produces, I cannot get rid of the horrible quarter-second slowdown and sound glitching that occurs every minute or so due to a garbage collection.  I need to check my code to make absolutely sure I am not doing something stupid and generating needless garbage, or also that the conversion from GS3.1 to GS4.0 didn't introduce some new garbage creation in a place I'm unaware.

    Any help is appreciated.  Thank you!!
    p.s. if there are other profilers that can measure garbage, please mention them!

  • 6/8/2011 3:57 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Answer
    Reply Quote
    These instructions to get the profiler working with XNA 4.0 worked for me:


  • 6/8/2011 4:17 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    JasonD:
    I've tried placing the CLR Profiler .exe and .dll files locally to the .exe being tested, and even registered the .dll in admin mode, and even ran the .exe in admin mode, and it just won't connect to my XNA 4.0 game.  Is there any way to do this?

    Connect? Wha? Previous versions of the CLR profiler required running with admin permissions, but with .NET 4 and CLR Profiler 4, all you should need is to use "Start Application", browse to your game's bin/ folder (by default, or wherever you output it otherwise). You'll probably also need to change the execution path in the run parametres to point to your game's executable folder.

    If that doesn't work, please specify exactly what isn't working, you sorta forgot to mention that.
  • 6/8/2011 5:41 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Phil Fortier:
    These instructions to get the profiler working with XNA 4.0 worked for me:


    Phil, thanks for the tip.  I tried this solution, and it doesn't work.  That guy is using Windows 7, and I'm on Vista.  I even tried registering ProfilerOBJ.dll like someone else stated with his solution, and it still doesn't work.  I made sure I was using CLR Profiler 2.0.

    But... shouldn't CLR Profiler 4.0 work with XNA Game Studio 4.0 automatically, as-is, meaning I shouldn't have to bother to try and make CLR Profiler 2.0 work at all?
  • 6/8/2011 5:46 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Answer
    Reply Quote
    WAIT!  I decided to try the x86 version and it does work. :)  It was the 64-bit version that didn't work.  And the registering of the .dll is not required (perhaps because I've already done it, though).

    So thank you! :)
  • 6/8/2011 5:56 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Seleste:

    Connect? Wha? Previous versions of the CLR profiler required running with admin permissions, but with .NET 4 and CLR Profiler 4, all you should need is to use "Start Application", browse to your game's bin/ folder (by default, or wherever you output it otherwise). You'll probably also need to change the execution path in the run parametres to point to your game's executable folder.

    If that doesn't work, please specify exactly what isn't working, you sorta forgot to mention that.
    Seleste, the issue is that it doesn't work when I select an .exe game for it to monitor... the game starts, but that window in the background remains with an error window that says "Waiting For Connection...", with the text "Waiting for application to start common language runtime".  I understand how to use CLR Profiler, and how to start an application, and how to make sure the current directories are proper so that the game runs, and to run it as admin, etc.

    In any case, I appear to have gotten v2.0 working thanks to Phil.  I am still unsure why I can't just run 4.0 as admin, and click "start app", and let it 'connect' as it says it is waiting to do.


  • 6/8/2011 6:00 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    I'm not sure what's going on, but CLR Profiler 4.0 is now working fine -- just the x86 version.  I am not setting any environment variables or registering any DLLs, and it just works.  I don't know if I fix an issue already to cause this, but I was certain I tried the x86 version before.  Who knows, but it works.

    Thanks for your time guys!!
  • 6/8/2011 6:39 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    One thing I noticed is that I have to have Allocations and/or Calls checked before I start my app. If I check them after the app starts (if I'm trying to just profile a certain part of the app for example) then I never get any data.  So I always make sure those are checked, leave Profiling Active unchecked, start the app, navigate to where I want, then check Profiling Active. It's unfortunate that they seem to default to unchecked every time I run the profiler.

    Other than that, as long as I set the working directory in File/Set Parameters everything seems to work pretty well with it.

    As far as the 64-bit thing - this is from the CLRProfiler.doc that's part of the installation...


    Q: CLRProfiler does not seem to work on my 64-bit application - the form that says "Waiting for application to start common language runtime" stays up forever, even though the application has started already.


    A: On a 64-bit operating system, you want to make sure you profile 64-bit applications with a version of CLRProfiler.exe and profilerOBJ.dll built for x64/IA64. Conversely, you want to make sure you profile a 32-bit application with a version of CLRProfiler.exe and profilerOBJ.dll built for Win32.

    The document has a 2007 date, so it doesn't look like it was upated for this release, but that probably still applies.

  • 6/8/2011 7:18 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Thanks for the tips on usage.  That's too bad that the checkboxes don't work at run-time (I haven't tried this yet), since it's nice to profile just one section of the game.

    As for the documentation for the x64 issue, that clears up everything.  Basically, x64 isn't for the operating system, it's for the application, and XNA games are still x86, so you need to use x86 to profile them.  Simple enough.

    Thanks!
  • 6/8/2011 11:39 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    JasonD:
    Thanks for the tips on usage.  That's too bad that the checkboxes don't work at run-time (I haven't tried this yet), since it's nice to profile just one section of the game.


    The "profiling active" checkbox works at run time, so you can still profile just a section of the code. It's the other two checkboxes that don't seem to (Allocations, Calls) and have to be checked before the app is run. At least for me, on Windows 7.
  • 6/8/2011 12:32 PM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Ah gotcha!

    Thanks.
  • 6/9/2011 12:35 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    JasonD:
    ...I need to check my code to make absolutely sure I am not doing something stupid and generating needless garbage...
    CLR Profiler is a godsend.  Using the run-time activation of profiling I was able to profile only a section of actual gameplay, and found a single allocation that was occuring, that was introduced when I had to update the pixel shader code for GS4.0.  Unfortunately, I just used the example shown in MSDN, and wasn't smart enough to check and see that it was not a struct, but a class (even though it appears on the outside that it'd be a struct, but I should know better that almost no one uses structs anymore -- why? I have no idea).  In any case, I am in the midst of testing and confirming this was the source of all evil for me recently.

    Thank you so much for helping me get CLR Profiler to work.  I knew and wished that I could've used this right from the get-go.  Also the XNA Framework Remote Performance Monitor is a godsend as well.

    Cheers!
  • 6/16/2011 9:53 PM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Jason, were you able to get CLR Profiler working with XACT running? For some reason my game crashes every time I try opening it with CLR Profiler. Very frustrating.
  • 6/16/2011 11:02 PM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    XACT posed no problem at all to me.

    Note: I did not have the auditioning utility or XACT 3.0 open at the time, however, nor did I have the VC# IDE open (I believe).

    I should also note that XACT 3.0 crashes for me when I attempt to play a sound in Vista (I have another thread on that, and the forums have an announcement post for getting XACT 2.0 to work in Vista, but I think it's entirely crazy to have to go through ALL that, and so far I haven't needed to actually play sounds in XACT, but I'd hate trying to create a project from scratch like this).
  • 6/17/2011 12:09 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Thanks. I ended up fixing the problem by copying the binary files into my debug folder.
  • 6/17/2011 1:03 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Ah. I had to do the same.  I had to paste the .DLL files in too, I believe.  Strange, since on Windows XP I didn't have that problem (with v2.0).
  • 6/17/2011 1:10 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Woah, I had no idea how much garbage XACT was generating. This is insane! It's really making me question whether I can even do this project using XNA. The SoundEffect API just doesn't have the functionality I need but XACT is creating a ridiculous amount of garbage.
  • 6/17/2011 1:30 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    Really?

    I have all settings on default for loading samples into memory (not streaming) and after they are loaded the first time, they never generate garbage again.  So, at run time, XACT basically generates 0 garbage after the first hit.  I couldn't really ask for better garbage creation than that.  I feel horrible even insinuating that XACT may have been the cause of the slowdown (although it can cause this when doing variable pitches, I've found).
  • 6/17/2011 2:32 AM In reply to

    Re: CLR Profiler 2.0 or 4.0 doesn't work in Vista

    No worries, it actually is creating tons of garbage for me, so you didn't slander XACT unfairly ;).

    My problem is exactly what you're talking about -- my project has a completely dynamic music system, so every time I want to play a cue, I call GetCue() and set a bunch of parameters (volume, pitch, reverb, filter, etc.), each of which creates garbage from what I understand. On top of that, if I want to fade the volume of a looping sound in and out, for example, I have to call SetVariable() every frame. If I have 12 sounds I want to fade in and out individually (I do in one particular instance), I'm creating massive amounts of garbage.

    It's fine for the most part on PC but on Xbox 360 it's an absolute mess.
Page 1 of 1 (19 posts) Previous Discussion Next Discussion