ring_buffer_set_clock(tr->trace_buffer.buffer,
early_trace_clock);
Then have:
static u64 early_timestamp __initdata;
static __init u64 early_trace_clock(void)
{
return early_timestamp;
}
Then we can have:
+ preempt_disable_notrace();
+ for (i = 0; i < vearly_entries_count; i++) {
+ entry = &ftrace_vearly_entries[i];
+
+#ifdef CONFIG_X86_TSC
+ ns = cycles_to_ns(entry->clock, cpu_khz);
+#else
+ ns = entry->clock;
+#endif
early_timestamp = ns;
+ trace_function(tr, entry->ip, entry->parent_ip, 0, 0);
And it will fill the entries properly, and you don't need to worry
about delta's or anything.
+ }
+ preempt_enable_notrace();
/* Set the default clock back */
ring_buffer_set_clock(tr->trace_buffer.buffer,
trace_local_clock);
+static struct ftrace_vearly_obs_param ftrace_vearly_params[] __initdata = {
+ { .str = "ftrace_vearly", .setup_func = set_ftrace_vearly_enable },
+#ifdef CONFIG_DYNAMIC_FTRACE
+ {
+ .str = "ftrace_notrace",
+ .data = &ftrace_data_notrace,
+ .setup_func = set_ftrace_vearly_filtering,
+ },
+ {
+ .str = "ftrace_filter",
+ .data = &ftrace_data_filter,
+ .setup_func = set_ftrace_vearly_filtering,
+ },
+#endif
Hmm, wouldn't this actually still be able to work even if
DYNAMIC_FTRACE was not set?