Example #1
0
static inline void put_record(struct st_event_record* rec)
{
	struct local_buffer* buf;
	buf = &__get_cpu_var(st_event_buffer);
	ft_buffer_finish_write(&buf->ftbuf, rec);
	put_cpu_var(st_event_buffer);
}
Example #2
0
static void __add_timestamp_user(struct timestamp *pre_recorded)
{
	unsigned int seq_no;
	struct timestamp *ts;
	seq_no = fetch_and_inc((int *) &ts_seq_no);
	if (ft_buffer_start_write(trace_ts_buf, (void**)  &ts)) {
		*ts = *pre_recorded;
		ts->seq_no = seq_no;
		__save_irq_flags(ts);
		ft_buffer_finish_write(trace_ts_buf, ts);
	}
}
Example #3
0
static inline void __save_timestamp_cpu(unsigned long event,
					uint8_t type, uint8_t cpu)
{
	unsigned int seq_no;
	struct timestamp *ts;
	seq_no = fetch_and_inc((int *) &ts_seq_no);
	if (ft_buffer_start_write(trace_ts_buf, (void**)  &ts)) {
		ts->event     = event;
		ts->seq_no    = seq_no;
		ts->cpu       = cpu;
		ts->task_type = type;
		__save_irq_flags(ts);
		barrier();
		/* prevent re-ordering of ft_timestamp() */
		ts->timestamp = ft_timestamp();
		ft_buffer_finish_write(trace_ts_buf, ts);
	}
}
Example #4
0
feather_callback void save_task_latency(unsigned long event,
					unsigned long when_ptr)
{
	lt_t now = litmus_clock();
	lt_t *when = (lt_t*) when_ptr;
	unsigned int seq_no;
	int cpu = raw_smp_processor_id();
	struct timestamp *ts;

	seq_no = fetch_and_inc((int *) &ts_seq_no);
	if (ft_buffer_start_write(trace_ts_buf, (void**)  &ts)) {
		ts->event     = event;
		ts->timestamp = now - *when;
		ts->seq_no    = seq_no;
		ts->cpu       = cpu;
		ts->task_type = TSK_RT;
		__save_irq_flags(ts);
		ft_buffer_finish_write(trace_ts_buf, ts);
	}
}