本文整理汇总了C++中SPLIT_NS函数的典型用法代码示例。如果您正苦于以下问题:C++ SPLIT_NS函数的具体用法?C++ SPLIT_NS怎么用?C++ SPLIT_NS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SPLIT_NS函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_task
static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
if (rq->curr == p)
SEQ_printf(m, "R");
else
SEQ_printf(m, " ");
SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
p->comm, p->pid,
SPLIT_NS(p->se.vruntime),
(long long)(p->nvcsw + p->nivcsw),
p->prio);
#ifdef CONFIG_SCHEDSTATS
SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
SPLIT_NS(p->se.vruntime),
SPLIT_NS(p->se.sum_exec_runtime),
SPLIT_NS(p->se.statistics.sum_sleep_runtime));
#else
SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
#endif
#ifdef CONFIG_CGROUP_SCHED
SEQ_printf(m, " %s", task_group_path(task_group(p)));
#endif
SEQ_printf(m, "\n");
}
示例2: print_task
static void print_task(struct seq_file *m, struct task_struct *p)
{
SEQ_printf(m, "%15s %5d %9Ld %5d ",
p->comm, p->pid, (long long)(p->nvcsw + p->nivcsw), p->prio);
#ifdef CONFIG_SCHEDSTATS
SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld\n",
SPLIT_NS(p->se.vruntime),
SPLIT_NS(p->se.sum_exec_runtime), SPLIT_NS(p->se.statistics.sum_sleep_runtime));
#else
SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld\n",
0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
#endif
}
示例3: MT_trace_hardirqs_on
void MT_trace_hardirqs_on(void)
{
unsigned long long t_diff, t_on, t_off;
if(unlikely(__raw_get_cpu_var(mtsched_mon_enabled) & 0x2)){
if( 0 == current->pid) /* Ignore swap thread */
return;
if( __raw_get_cpu_var(MT_trace_in_sched))
return;
if( __raw_get_cpu_var(MT_trace_in_resume_console))
return;
if(__raw_get_cpu_var(MT_tracing_cpu) == 1)
{
MT_trace_irq_on();
t_on = sched_clock();
t_off = __raw_get_cpu_var(t_irq_off);
t_diff = t_on - t_off;
__raw_get_cpu_var(t_irq_on) = t_on;
if(t_diff > TIME_20MS){
printk("\n----------------------------[IRQ disable monitor]-------------------------\n");
printk("[Sched Latency Warning:IRQ Disable too long(>20ms)] Duration: %lld.%lu ms (off:%lld.%lums, on:%lld.%lums)\n", SPLIT_NS(t_diff), SPLIT_NS(t_off), SPLIT_NS(t_on));
mt_dump_irq_off_traces();
printk("irq on at: %lld.%lu ms\n", SPLIT_NS(t_on));
printk("irq on backtraces:\n");
dump_stack();
printk("--------------------------------------------------------------------------\n\n");
}
__raw_get_cpu_var(t_irq_off) = 0;
}
__raw_get_cpu_var(MT_tracing_cpu) = 0;
}
}
示例4: sched_debug_show
static int sched_debug_show(struct seq_file *m, void *v)
{
u64 now = ktime_to_ns(ktime_get());
int cpu;
SEQ_printf(m, "Sched Debug Version: v0.09, %s %.*s\n",
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
SEQ_printf(m, "now at %Lu.%06ld msecs\n", SPLIT_NS(now));
#define P(x) \
SEQ_printf(m, " .%-40s: %Ld\n", #x, (long long)(x))
#define PN(x) \
SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))
P(jiffies);
PN(sysctl_sched_latency);
PN(sysctl_sched_min_granularity);
PN(sysctl_sched_wakeup_granularity);
PN(sysctl_sched_child_runs_first);
P(sysctl_sched_features);
#undef PN
#undef P
for_each_online_cpu(cpu)
print_cpu(m, cpu);
SEQ_printf(m, "\n");
return 0;
}
示例5: mt_dump_irq_off_traces
void mt_dump_irq_off_traces(void)
{
#ifdef CONFIG_MT_SCHED_MONITOR
int i;
struct stack_trace *trace;
trace = &__raw_get_cpu_var(MT_stack_trace);
printk("irq off at:%lld.%lu ms\n", SPLIT_NS(__raw_get_cpu_var(TS_irq_off)) );
printk("irq off backtraces:\n");
for (i = 0; i < trace->nr_entries; i++) {
printk("[<%pK>] %pS\n",(void *)trace->entries[i], (void *)trace->entries[i]);
}
#endif
}
示例6: log_boot
void log_boot(char *str)
{
unsigned long long ts;
if( 0 == mt_bootprof_enabled)
return;
ts = sched_clock();
printk("BOOTPROF:%10Ld.%06ld:%s\n", SPLIT_NS(ts), str);
if(boot_log_count >= BOOT_LOG_NUM)
{
printk("[BOOTPROF] not enuough bootprof buffer\n");
return;
}
mutex_lock(&mt_bootprof_lock);
mt_bootprof[boot_log_count].timestamp = ts;
strcpy((char*)&mt_bootprof[boot_log_count].event, str);
boot_log_count++;
mutex_unlock(&mt_bootprof_lock);
}
示例7: mt_bootprof_show
static int mt_bootprof_show(struct seq_file *m, void *v)
{
int i;
SEQ_printf(m, "----------------------------------------\n");
SEQ_printf(m, "%d BOOT PROF (unit:msec)\n", mt_bootprof_enabled);
SEQ_printf(m, "----------------------------------------\n");
if (pl_t > 0 && lk_t > 0) {
SEQ_printf(m, "%10d : %s\n", pl_t, "preloader");
SEQ_printf(m, "%10d : %s\n", lk_t, "lk");
SEQ_printf(m, "----------------------------------------\n");
}
for(i = 0 ;i< boot_log_count;i ++){
SEQ_printf(m, "%10Ld.%06ld : %s\n", SPLIT_NS(mt_bootprof[i].timestamp), mt_bootprof[i].event);
}
SEQ_printf(m, "----------------------------------------\n");
return 0;
}
示例8: print_cfs_rq
void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
{
s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1,
spread, rq0_min_vruntime, spread0;
struct rq *rq = cpu_rq(cpu);
struct sched_entity *last;
unsigned long flags;
SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
SPLIT_NS(cfs_rq->exec_clock));
raw_spin_lock_irqsave(&rq->lock, flags);
if (cfs_rq->rb_leftmost)
MIN_vruntime = (__pick_next_entity(cfs_rq))->vruntime;
last = __pick_last_entity(cfs_rq);
if (last)
max_vruntime = last->vruntime;
min_vruntime = cfs_rq->min_vruntime;
rq0_min_vruntime = cpu_rq(0)->cfs.min_vruntime;
raw_spin_unlock_irqrestore(&rq->lock, flags);
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "MIN_vruntime",
SPLIT_NS(MIN_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "min_vruntime",
SPLIT_NS(min_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "max_vruntime",
SPLIT_NS(max_vruntime));
spread = max_vruntime - MIN_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread",
SPLIT_NS(spread));
spread0 = min_vruntime - rq0_min_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread0",
SPLIT_NS(spread0));
SEQ_printf(m, " .%-30s: %ld\n", "nr_running", cfs_rq->nr_running);
SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
SEQ_printf(m, " .%-30s: %d\n", "nr_spread_over",
cfs_rq->nr_spread_over);
#ifdef CONFIG_FAIR_GROUP_SCHED
#ifdef CONFIG_SMP
SEQ_printf(m, " .%-30s: %lu\n", "shares", cfs_rq->shares);
#endif
print_cfs_group_stats(m, cpu, cfs_rq->tg);
#endif
}
示例9: print_cfs_rq
void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
{
s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1,
spread, rq0_min_vruntime, spread0;
struct rq *rq = &per_cpu(runqueues, cpu);
struct sched_entity *last;
unsigned long flags;
SEQ_printf(m, "\ncfs_rq\n");
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
SPLIT_NS(cfs_rq->exec_clock));
spin_lock_irqsave(&rq->lock, flags);
if (cfs_rq->rb_leftmost)
MIN_vruntime = (__pick_next_entity(cfs_rq))->vruntime;
last = __pick_last_entity(cfs_rq);
if (last)
max_vruntime = last->vruntime;
min_vruntime = rq->cfs.min_vruntime;
rq0_min_vruntime = per_cpu(runqueues, 0).cfs.min_vruntime;
spin_unlock_irqrestore(&rq->lock, flags);
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "MIN_vruntime",
SPLIT_NS(MIN_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "min_vruntime",
SPLIT_NS(min_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "max_vruntime",
SPLIT_NS(max_vruntime));
spread = max_vruntime - MIN_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread",
SPLIT_NS(spread));
spread0 = min_vruntime - rq0_min_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread0",
SPLIT_NS(spread0));
SEQ_printf(m, " .%-30s: %ld\n", "nr_running", cfs_rq->nr_running);
SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
#ifdef CONFIG_SCHEDSTATS
SEQ_printf(m, " .%-30s: %d\n", "bkl_count",
rq->bkl_count);
#endif
SEQ_printf(m, " .%-30s: %ld\n", "nr_spread_over",
cfs_rq->nr_spread_over);
}
示例10: print_cfs_rq
void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
{
s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1,
spread, rq0_min_vruntime, spread0;
struct rq *rq = cpu_rq(cpu);
struct sched_entity *last;
unsigned long flags;
#ifdef CONFIG_FAIR_GROUP_SCHED
SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, task_group_path(cfs_rq->tg));
#else
SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
#endif
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
SPLIT_NS(cfs_rq->exec_clock));
raw_spin_lock_irqsave(&rq->lock, flags);
if (cfs_rq->rb_leftmost)
MIN_vruntime = (__pick_first_entity(cfs_rq))->vruntime;
last = __pick_last_entity(cfs_rq);
if (last)
max_vruntime = last->vruntime;
min_vruntime = cfs_rq->min_vruntime;
rq0_min_vruntime = cpu_rq(0)->cfs.min_vruntime;
raw_spin_unlock_irqrestore(&rq->lock, flags);
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "MIN_vruntime",
SPLIT_NS(MIN_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "min_vruntime",
SPLIT_NS(min_vruntime));
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "max_vruntime",
SPLIT_NS(max_vruntime));
spread = max_vruntime - MIN_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread",
SPLIT_NS(spread));
spread0 = min_vruntime - rq0_min_vruntime;
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread0",
SPLIT_NS(spread0));
SEQ_printf(m, " .%-30s: %d\n", "nr_spread_over",
cfs_rq->nr_spread_over);
SEQ_printf(m, " .%-30s: %d\n", "nr_running", cfs_rq->nr_running);
SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
#ifdef CONFIG_FAIR_GROUP_SCHED
#ifdef CONFIG_SMP
SEQ_printf(m, " .%-30s: %lld\n", "runnable_load_avg",
cfs_rq->runnable_load_avg);
SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg",
cfs_rq->blocked_load_avg);
SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg",
(unsigned long long)atomic64_read(&cfs_rq->tg->load_avg));
SEQ_printf(m, " .%-30s: %lld\n", "tg_load_contrib",
cfs_rq->tg_load_contrib);
SEQ_printf(m, " .%-30s: %d\n", "tg_runnable_contrib",
cfs_rq->tg_runnable_contrib);
SEQ_printf(m, " .%-30s: %d\n", "tg->runnable_avg",
atomic_read(&cfs_rq->tg->runnable_avg));
#endif
#ifdef CONFIG_CFS_BANDWIDTH
SEQ_printf(m, " .%-30s: %d\n", "tg->cfs_bandwidth.timer_active",
cfs_rq->tg->cfs_bandwidth.timer_active);
SEQ_printf(m, " .%-30s: %d\n", "throttled",
cfs_rq->throttled);
SEQ_printf(m, " .%-30s: %d\n", "throttle_count",
cfs_rq->throttle_count);
#endif
print_cfs_group_stats(m, cpu, cfs_rq->tg);
#endif
}
示例11: dprec_logger_get_result_string
int dprec_logger_get_result_string(DPREC_LOGGER_ENUM source, char *stringbuf, int strlen)
{
unsigned long flags = 0;
spin_lock_irqsave(&gdprec_logger_spinlock, flags);
int len = 0;
dprec_logger* l = &logger[source];
unsigned long long total = 0;
// calculate average period need use available total period
if(l->period_total)
total = l->period_total;
else
total = l->ts_trigger - l->ts_start;
unsigned long long avg = total?total:1;
unsigned long long count = l->count?l->count:1;
do_div(avg, count);
// calculate fps need use whole time period
//total = l->ts_trigger - l->ts_start;
unsigned long long fps_high = 0;
unsigned long fps_low = 0;
fps_high = l->count;
do_div(total, 1000*1000*1000);
if(total == 0) total = 1;
fps_high *= 100;
do_div(fps_high, total);
fps_low = do_div(fps_high, 100);
//DISPMSG("total = %lld, count = %lld, fps=%lld.%2ld, avg=%lld, trigger=%lld, start=%lld\n", total, l->count, fps_high, fps_low,avg, l->ts_trigger, l->ts_start);
//len += scnprintf(stringbuf+len, strlen - len, "[DPREC][LOGGER]%s, count=%d, avg count=%d.%02dfps, avg period=%lld.%ludms, max=%d.%02dms, min=%lld.%lums\n", dprec_logger_spy(source), l->count, fps/100, fps%100,SPLIT_NS(l->period_max_frame), max/100, max%100, SPLIT_NS(l->period_min_frame));
len += scnprintf(stringbuf+len, strlen - len, "|%-24s|%8llu |%8lld.%02ld |%8llu.%02ld |%8llu.%02ld |%8llu.%02ld |\n", dprec_logger_spy(source), l->count, fps_high, fps_low, SPLIT_NS(avg), SPLIT_NS(l->period_max_frame), SPLIT_NS(l->period_min_frame));
spin_unlock_irqrestore(&gdprec_logger_spinlock, flags);
return len;
}