I cannot differentiate between Instrumentation and Virtual machine introspection. Since the goal of Virtual Machine introspection is to examine the properties of a target through virtual machine monitor then what is the purpose and use of instrumentation technique.

2 Answers 2


The terminology is slippery and not completely stabilized; however, we can say that, usually, "code instrumentation" relates to modifications of some target code so that monitoring tools (or other kind of automatic management tools) can be applied on it; this does not necessarily involve a virtual machine. With a virtual machine, on the other hand, the code to inspect and monitor is unmodified and unaware of the fact that it is monitored.

For instance, if you compile C code with GCC, you can "profile" it (performance monitoring at the granularity of individual functions) with the -pg command-line flag: this flag instructs GCC to add extra instructions in the binary which record function entry and exit, for each function. This is instrumentation. It does not need any kind of virtual machine.

To make a metaphor, virtual machine introspection is like a zoologist crouched on a rocky hilltop, with powerful binoculars, observing from afar a lion stalking a herd of zebras. Instrumentation is more like the lion being sedated, strapped on an examination table, and the zoologist forcing an endoscope in its throat. Not the same activity, not the same goals, not the same kind of harvested data; and instrumentation is a bit more "invasive".

  • great answer can you refer me to some reading stuff on code instrumentation i need to know more thanks.
    – Ali Ahmad
    Jul 27, 2013 at 13:31
  • 3
    Pictures! We need more pictures with lions. Jul 27, 2013 at 17:27

The lion simile is a great one. An interesting point that should be included is that introspecting on a VM is much more difficult / target specific than instrumentation. As tom-leek says above, instrumentation adds to the code under inspection where introspection does not. This is a big problem for introspection.

The introspection APIs for a hypervisor like Xen don't do a whole lot more than allow one VM to inspect / map memory that belongs to another VM. Without any instrumentation to assist the introspecting program it must be able to deduce for itself what is in the memory it is observing. This would be like the zoologist in tom-leeks example having to determine what a lion and a zebra are, maybe never having seen either before (not a zoologist then?). This problem has been termed the "semantic gap".

Thus the value in an introspection engine is its ability to determine what it's looking at. Typically it will have to know something about the structure of the binary program it's watching. Most systems use a system.map file to get data about the Linux kernel and then select specific data structures (process list etc) to monitor. For Windows it's a completely different story and the companies that do introspection on Windows typically consider their methods to be extremely valuable intellectual property.

There was a great company called Virtuata that did introspection on the Windows kernel using Xen. Unfortunately they were acquired by Cisco last year and have since disappeared: http://www.cisco.com/web/about/ac49/ac0/ac1/ac259/virtuata.html

Good reading on this topic:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.