您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timer_stats_hrtimer_set_start_info函数代码示例

51自学网 2021-06-03 08:51:37
  C++
这篇教程C++ timer_stats_hrtimer_set_start_info函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中timer_stats_hrtimer_set_start_info函数的典型用法代码示例。如果您正苦于以下问题:C++ timer_stats_hrtimer_set_start_info函数的具体用法?C++ timer_stats_hrtimer_set_start_info怎么用?C++ timer_stats_hrtimer_set_start_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了timer_stats_hrtimer_set_start_info函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: hrtimer_start

/** * hrtimer_start - (re)start an relative timer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @mode:	expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL) * * Returns: *  0 on success *  1 when the timer was active */inthrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret, raise;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	ret = remove_hrtimer(timer, base);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base);	if (mode == HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, new_base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, base->resolution);#endif	}	timer->expires = tim;	timer_stats_hrtimer_set_start_info(timer);	/*	 * Only allow reprogramming if the new base is on this CPU.	 * (it might still be on another CPU if the timer was pending)	 */	enqueue_hrtimer(timer, new_base,			new_base->cpu_base == &__get_cpu_var(hrtimer_bases));	/*	 * The timer may be expired and moved to the cb_pending	 * list. We can not raise the softirq with base lock held due	 * to a possible deadlock with runqueue lock.	 */	raise = timer->state == HRTIMER_STATE_PENDING;	unlock_hrtimer_base(timer, &flags);	if (raise)		hrtimer_raise_softirq();	return ret;}
开发者ID:mikuhatsune001,项目名称:linux-2.6,代码行数:64,


示例2: hrtimer_start

/** * hrtimer_start - (re)start an relative timer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @mode:	expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL) * * Returns: *  0 on success *  1 when the timer was active */inthrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	ret = remove_hrtimer(timer, base);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base);	if (mode == HRTIMER_MODE_REL) {		tim = ktime_add(tim, new_base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add(tim, base->resolution);#endif		/*		 * Careful here: User space might have asked for a		 * very long sleep, so the add above might result in a		 * negative number, which enqueues the timer in front		 * of the queue.		 */		if (tim.tv64 < 0)			tim.tv64 = KTIME_MAX;	}	timer->expires = tim;	timer_stats_hrtimer_set_start_info(timer);	/*	 * Only allow reprogramming if the new base is on this CPU.	 * (it might still be on another CPU if the timer was pending)	 */	enqueue_hrtimer(timer, new_base,			new_base->cpu_base == &__get_cpu_var(hrtimer_bases));	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:61,


示例3: hrtimer_start_range_ns

/** * hrtimer_start_range_ns - (re)start an hrtimer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @delta_ns:	"slack" range for the timer * @mode:	expiry mode: absolute (HRTIMER_MODE_ABS) or *		relative (HRTIMER_MODE_REL) */void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,			    unsigned long delta_ns, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int leftmost;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	remove_hrtimer(timer, base, true);	if (mode & HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));#endif	}	hrtimer_set_expires_range_ns(timer, tim, delta_ns);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);	timer_stats_hrtimer_set_start_info(timer);	leftmost = enqueue_hrtimer(timer, new_base);	if (!leftmost)		goto unlock;	if (!hrtimer_is_hres_active(timer)) {		/*		 * Kick to reschedule the next tick to handle the new timer		 * on dynticks target.		 */		if (new_base->cpu_base->nohz_active)			wake_up_nohz_cpu(new_base->cpu_base->cpu);	} else {		hrtimer_reprogram(timer, new_base);	}unlock:	unlock_hrtimer_base(timer, &flags);}
开发者ID:DenisLug,项目名称:mptcp,代码行数:58,



注:本文中的timer_stats_hrtimer_set_start_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ timer_tick函数代码示例
C++ timer_stats_hrtimer_clear_start_info函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。