3 Replies Latest reply on Mar 25, 2010 8:10 AM by strictlymike

    Only one VProbe fires when multiple are specified

    strictlymike Novice

      I am trying to use VProbes with VMWare Workstation 6.5 on Windows Vista SP2.

       

       

      When I create two VProbes using two back-to-back invocations of vmrun.exe, only the second probe takes effect: the log contains a few entries from the first one (for example, Guest_IRQ), and then contains only entries from the other (for example, Guest_PF).

       

      vmrun vprobeLoad %VMX% "(vprobe Guest_IRQ (printf \"%s: 0x%08x\n\" PROBENAME (getguest RSP)))"
      vmrun vprobeLoad %VMX% "(vprobe Guest_PF (printf \"%s: 0x%08x\n\" PROBENAME (getguest RSP)))"

       

      When I create two VProbes in a single invocation of VProbes, only the first probe listed in my argument takes effect: the log contains only entries from the first (for example, Guest_IRQ) and none from the second (for example, Guest_PF).

       

      vmrun vprobeLoad %VMX% "(vprobe Guest_IRQ (printf \"%s: 0x%08x\n\" PROBENAME (getguest RSP))) (vprobe Guest_PF (printf \"%s: 0x%08x\n\" PROBENAME (getguest RSP)))"

       

      How is a Windows user supposed to get two of these to coexist?

       

       

      Lastly, I want to mention that this would be a LOT easier if I could just write a script file for this and pass it into vmrun.exe.  Instead, I have been using Windows NT Command Scripts (.CMD files) and carefully experimenting to detect and fix quoting issues.  I see that fixitchris has been running around the same issues.  Eventually I'll probably break down and install cygwin and/or the vprobe-toolkit, but that seems really unnecessary--I mean, how hard is it for you to make vmrun.exe memory map a file and point its parser to the resulting buffer instead of using command-line arguments?  :-P

       

       

      Superficial criticism aside, this tool has gained me two very valuable insights in as many days; props for adding it and providing usable documentation.

       

      -M.

        • 1. Re: Only one VProbe fires when multiple are specified
          rugina Novice

           

          1) Calling vmrun twice in a row won't work for what you need. The first call to vmrun loads the first script (with GUEST_IRQ). The second call to vmrun unloads the first script and loads the second script (with GUEST_PF). This explains why you first see only GUEST_IRQ, and then you only see GUEST_PF.

           

           

          2)  Calling vmrun only once with 2 probes (both GUEST_IRQ and GUEST_PF) should work and you should see output from both probes. Are you sure there is no output from GUEST_PF? Note that GUEST_IRQ happens much more frequently than GUEST_PF, so the output will contain a lot of GUEST_IRQ and little GUEST_PF.

           

           

          3) Loading a script directly from a file is supported in Workstation 7 via vmrun's vprobeLoadFile command. For example:

           

           

            vmrun vprobeLoadFile myvm.vmx myscript.vp

           

           

          See the documentation: http://www.vmware.com/pdf/ws7_f3_vprobes_reference.pdf

           

           

          Hope this helps.

           

           

          Radu

           

           

          1 person found this helpful
          • 2. Re: Only one VProbe fires when multiple are specified
            strictlymike Novice

            Thank you rugina, I surmised that my first approach was resulting in a race condition between the two probes.

             

             

            As for your #2 comment--I'll just have to try Cygwin, because the Microsoft command shell doesn't get the result you and I are expecting, and Cygwin is what the VProbes reference prescribes.

             

             

            It's a little unfortunate that the designers didn't foresee the very commonplace desire to input one's script into a file (and thus avoid any shell quoting and escaping idiosynchrasies). But ce'est la vie; maybe when I have some time to kill I'll upgrade my VMM!

            • 3. Re: Only one VProbe fires when multiple are specified
              strictlymike Novice

               

              Fortunately, Cygwin works.  Unfortunately, bash $(command) expansion removes newlines (true of both native Linux bash and the Cygwin port), so any single comment in a script will effectively comment out every line starting from the first comment to the end of the program.  This, however, I can deal with.