Lluís Vilanova writes: [...] > From my experience, these are the basics I need:
> * Decide what to do when an event is translated (by default - no > instrumentation > -, it just generates a TCG call to an execution-time tracing routine). > This includes: > * Deciding whether to generate the TCG call to the execution-time tracing > routine. > * Access to generating other arbitrary TCG code (the API is pretty stable, > but > headers depend on target-specific defines). > This could also include generating code like incrementing a counter (e.g., > when counting instructions), instead of calling the execution-time tracing > routine. > My library actually hides this from the user, who just provides conditions > to establish whether to trace the event. Then the library automatically > establishes whether it's best to evaluate each condition at translation > time, using TCG code or when the execution-time tracing routine is > invoked. > * [still don't have it] Access to a map between target-specific abstractions > (mainly register names) and TCG values (e.g., to generate code that gets > or > sets the value of a well-known register). > * Decide what to do when an event is executed, including calls to > execution-time > event tracing routines generated by TCG code (by default, it just calls the > tracing backend). > This includes: > * Arbitrary user-provided code (the analysis itself when not inlined with > TCG). > * [still don't have it] Access to get and set the values of target-specific > abstractions (mainly registers). > * Add a per-vCPU opaque pointer with data private to the analyzer code. I forgot to add that another nice addition is to let the translation-time user-code specify which global registers might be accessed in the execution-time user code (thus the translation can generate TCG_CALL_CONST by default). Right now, it is established at compile time by having two event properties; one with and one without TCG_CALL_CONST-enabled TCG helpers. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth