Loading drivers/soc/qcom/lpm-stats.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <linux/debugfs.h> #include <linux/debugfs.h> #include <linux/sched.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/slab.h> #include <linux/smp.h> #include <linux/suspend.h> #include <linux/suspend.h> #include <soc/qcom/spm.h> #include <soc/qcom/spm.h> #include <soc/qcom/pm.h> #include <soc/qcom/pm.h> Loading Loading @@ -255,6 +256,15 @@ static ssize_t level_stats_file_write(struct file *file, return count; return count; } } static void reset_cpu_stats(void *info) { struct lpm_stats *stats = &(*this_cpu_ptr(&(cpu_stats))); int i; for (i = 0; i < stats->num_levels; i++) level_stats_reset(&stats->time_stats[i]); } static ssize_t lpm_stats_file_write(struct file *file, static ssize_t lpm_stats_file_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) const char __user *buffer, size_t count, loff_t *off) { { Loading @@ -276,6 +286,12 @@ static ssize_t lpm_stats_file_write(struct file *file, return -EINVAL; return -EINVAL; level_stats_reset_all(stats); level_stats_reset_all(stats); /* * Wake up each CPU and reset the stats from that CPU, * for that CPU, so we could have better timestamp for * accounting. */ on_each_cpu(reset_cpu_stats, NULL, 1); return count; return count; } } Loading Loading
drivers/soc/qcom/lpm-stats.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <linux/debugfs.h> #include <linux/debugfs.h> #include <linux/sched.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/slab.h> #include <linux/smp.h> #include <linux/suspend.h> #include <linux/suspend.h> #include <soc/qcom/spm.h> #include <soc/qcom/spm.h> #include <soc/qcom/pm.h> #include <soc/qcom/pm.h> Loading Loading @@ -255,6 +256,15 @@ static ssize_t level_stats_file_write(struct file *file, return count; return count; } } static void reset_cpu_stats(void *info) { struct lpm_stats *stats = &(*this_cpu_ptr(&(cpu_stats))); int i; for (i = 0; i < stats->num_levels; i++) level_stats_reset(&stats->time_stats[i]); } static ssize_t lpm_stats_file_write(struct file *file, static ssize_t lpm_stats_file_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) const char __user *buffer, size_t count, loff_t *off) { { Loading @@ -276,6 +286,12 @@ static ssize_t lpm_stats_file_write(struct file *file, return -EINVAL; return -EINVAL; level_stats_reset_all(stats); level_stats_reset_all(stats); /* * Wake up each CPU and reset the stats from that CPU, * for that CPU, so we could have better timestamp for * accounting. */ on_each_cpu(reset_cpu_stats, NULL, 1); return count; return count; } } Loading