static int start(void)
{
	unsigned int cnt;

	/* Clean all data for the next capture */
	for (cnt = 0; cnt < NUMBER_OF_TIMELINE_EVENTS; cnt++) {
		timeline_event_starttime[cnt].tv_sec = timeline_event_starttime[cnt].tv_nsec = 0;
		timeline_data[cnt] = 0;
	}

	for (cnt = 0; cnt < NUMBER_OF_SOFTWARE_COUNTERS; cnt++) {
		sw_counter_data[cnt] = 0;
	}

	for (cnt = 0; cnt < NUMBER_OF_ACCUMULATORS; cnt++) {
		accumulators_data[cnt] = 0;
	}

	/* Register tracepoints */
	if (register_tracepoints() == 0) {
		return -1;
	}

	/*
	 * Set the first timestamp for calculating the sample interval. The first interval could be quite long,
	 * since it will be the time between 'start' and the first 'read'.
	 * This means that timeline values will be divided by a big number for the first sample.
	 */
	getnstimeofday(&prev_timestamp);

	return 0;
}
Exemplo n.º 2
0
/*
 *  call-seq:
 *    Byebug.start -> bool
 *
 *  The return value is the value of !Byebug.started? <i>before</i> issuing the
 *  +start+; That is, +true+ is returned, unless byebug was previously started.
 */
static VALUE
Start(VALUE self)
{
  if (IS_STARTED)
    return Qfalse;

  catchpoints = rb_hash_new();

  threads = create_threads_table();

  register_tracepoints(self);

  return Qtrue;
}
Exemplo n.º 3
0
static int start(void)
{
	unsigned int cnt;
	mali_profiling_control_type *mali_control;

	previous_shader_bitmask = 0;
	previous_tiler_bitmask = 0;
	previous_l2_bitmask = 0;

	/* Clean all data for the next capture */
	for (cnt = 0; cnt < NUMBER_OF_TIMELINE_EVENTS; cnt++) {
		timeline_event_starttime[cnt].tv_sec = timeline_event_starttime[cnt].tv_nsec = 0;
		timeline_data[cnt] = 0;
	}

	for (cnt = 0; cnt < NUMBER_OF_SOFTWARE_COUNTERS; cnt++)
		sw_counter_data[cnt] = 0;

	for (cnt = 0; cnt < NUMBER_OF_ACCUMULATORS; cnt++)
		accumulators_data[cnt] = 0;

	/* Register tracepoints */
	if (register_tracepoints() == 0)
		return -1;

	/* Generic control interface for Mali DDK. */
	mali_control = symbol_get(_mali_profiling_control);
	if (mali_control) {
		/* The event attribute in the XML file keeps the actual frame rate. */
		unsigned int enabled = counters[FILMSTRIP].enabled ? 1 : 0;
		unsigned int rate = filmstrip_event & 0xff;
		unsigned int resize_factor = (filmstrip_event >> 8) & 0xff;

		pr_debug("gator: mali online _mali_profiling_control symbol @ %p\n", mali_control);

#define FBDUMP_CONTROL_ENABLE (1)
#define FBDUMP_CONTROL_RATE (2)
#define FBDUMP_CONTROL_RESIZE_FACTOR (4)
		mali_control(FBDUMP_CONTROL_ENABLE, enabled);
		mali_control(FBDUMP_CONTROL_RATE, rate);
		mali_control(FBDUMP_CONTROL_RESIZE_FACTOR, resize_factor);

		pr_debug("gator: sent mali_control enabled=%d, rate=%d, resize_factor=%d\n", enabled, rate, resize_factor);

		symbol_put(_mali_profiling_control);
	} else {
static int __init trace_log_init(void)
{
	int o, sz, entries;

	for (sz = SZ_4K, o = 0; !(entries = entries_ok(sz)); sz <<= ++o)
		;

	trace_log_data.start_vaddr =
		dma_alloc_coherent(NULL, sz,
			&trace_log_data.start_paddr, GFP_KERNEL);
	if (!trace_log_data.start_vaddr) {
		pr_err("trace log allocation failed\n");
		return 0;
	}

	trace_log_data.sz = sz;
	pr_info("trace log: va:%p, pa:0x%x, sz:%d, en:%d\n",
			trace_log_data.start_vaddr,
			(unsigned int)trace_log_data.start_paddr,
			sz, entries);

	if (init_trace_buf(entries)) {
		pr_err("trace log failed in init_trace_buf\n");
		trace_freeup(0x1);
		goto error;
	}

	if (register_tracepoints()) {
		pr_err("trace log failed in register_tracepoints\n");
		trace_freeup(0x7);
		goto error;
	}

#ifdef TL_TEST
	atomic_notifier_chain_register(&panic_notifier_list, &tl_panic_nb);
#endif

	return 0;
error:
	return -1;
}