How to detect which timer interrupt called callback when using ASF?
The Atmel Studio Framework doesn't clear any of the flags and the underlying code is quite straightforward in that area. The callback routines get setup as follows:

void tc_set_overflow_interrupt_callback(volatile void *tc,
        tc_callback_t callback)
{
#ifdef TCC0
    if ((uintptr_t) tc == (uintptr_t) &amp; TCC0) {
        tc_tcc0_ovf_callback = callback;
    } else
#endif
#ifdef TCC1
    if ((uintptr_t) tc == (uintptr_t) &amp; TCC1) {
        tc_tcc1_ovf_callback = callback;
    } else
#endif
... etc for other timers


And the actual interrupt code is:

ISR(TCC0_OVF_vect)
{
    if (tc_tcc0_ovf_callback) {
        tc_tcc0_ovf_callback();
    }
}
... etc for other timers


The XMEGA is a little different to some processors in that some of the flags get cleared before the interrupt code is called rather than on return. For example the following is the description of the OVFIF flag:


  This flag is set either on a TOP (overflow) or BOTTOM (underflow) condition, depending on the WGMODE setting. OVFIF is automatically cleared when the corresponding interrupt vector is executed. The flag can also be cleared by writing a one to its bit location.


One implication of using ASF is that the #ifdef directives above cause all interrupt vectors applicable to a device to be included once you include the timer/counter driver in the project.

But back to your original question as you've found those flags get cleared before the interrupt routine is called. After re-checking the documentation and taking a look at the various timer / interrupt flags before and after an interrupt in a debugger I can't see any way to achieve exactly what you're after. You might have to stick with a seperate callback for each timer that calls the main handler with a parameter. At least the code overhead shouldn't be too great because all the vectors are already included.