/* * platform_cpu_die: shutdown a CPU * @cpu: */ void platform_cpu_die(unsigned int cpu) { int spurious = 0; struct wd_api *wd_api = NULL; HOTPLUG_INFO("platform_cpu_die, cpu: %d\n", cpu); get_wd_api(&wd_api); if (wd_api) wd_api->wd_cpu_hot_plug_off_notify(cpu); #ifdef CONFIG_MTK_SCHED_TRACERS trace_cpu_hotplug(cpu, 0, per_cpu(last_event_ts, cpu)); per_cpu(last_event_ts, cpu) = ns2usecs(ftrace_now(cpu)); #endif /* * we're ready for shutdown now, so do it */ cpu_enter_lowpower(cpu); platform_do_lowpower(cpu, &spurious); /* * bring this CPU back into the world of cache * coherency, and then restore interrupts */ cpu_leave_lowpower(cpu); if (spurious) HOTPLUG_INFO("platform_do_lowpower, spurious wakeup call, cpu: %d, spurious: %d\n", cpu, spurious); }
static int kplib_print_trace_clock(ktap_state_t *ks) { unsigned long long t; unsigned long secs, usec_rem; u64 timestamp; /* use ring buffer's timestamp */ timestamp = ring_buffer_time_stamp(G(ks)->buffer, smp_processor_id()); t = ns2usecs(timestamp); usec_rem = do_div(t, USEC_PER_SEC); secs = (unsigned long)t; kp_printf(ks, "%5lu.%06lu\n", secs, usec_rem); return 0; }