Re: [PATCH 4/4] perf: provide a DEPRECTAED power trace API to user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi -

> Provide a CONFIG_DEPRECATED_POWER_EVENT_TRACING  option in order
> to provide backward compatibility with the user space tracing tools.

This is clever:

> +/* Map new events trace points calls to old ones */
> +#define trace_processor_idle(state, cpu_id)				\
> +	do {								\
> +		if (state != 0)						\
> +			trace_power_start(POWER_CSTATE, state, cpu_id);	\
> +		else							\
> +			trace_power_end(cpu_id);			\
> +	} while (0)

but with this code, are the new tracepoints firing at all?  In other
words, does this backward-compatibility config option effectively
disable the newer ones?  If so, this is probably avoidable.

Instead of redirecting the new tracepoint calls to these macros, an
alternative may intercept (un)registration for the old tracepoint
names, and map them to (un)registration of the real tracepoints.  See
how syscall tracepoints map to a special (un)registration callback in
include/trace/events/syscalls.h (syscall_*regfunc).  Instead of
setting a TIF flag, the new functions can call
register_processor_idle() et al., and their respective callbacks can
call the backward-compatibility tracepoints.

The starting point would be to recast the power_start, power_end,
power_frequency tracepoints via TRACE_EVENT_FN() instead of
TRACE_EVENT().

- FChE
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux