A method and apparatus for adaptive and dynamic filtering of threaded
programs. An embodiment of a method comprises analyzing the operation of
a computer program, the computer program comprising a plurality of
program threads; tracking overhead for the computer program; observing
program events for the computer program; rationing overhead between
program threads in inter-thread program events; and filtering program
events based on a dynamic threshold.