Exemplo n.º 1
0
static int
poller_timer (mstime when, void *arg)
{
	rb_poller *poll = (rb_poller*)arg;
	rb_item *item;

	/*
	 * If the previous poll has not completed, then we count it
	 * as a timeout.
	 */
	force_poll (poll, when, "timed out");

	/* Mark this poller as starting requests now */
	poll->last_request = when;
	ASSERT (!poll->polling);
	poll->polling = 1;

	/*
	 * Send off the next query. This needs to be done after
	 * all the timeouts above, as the above could write to RRD.
	 */
	for (item = poll->items; item; item = item->next) {
		item->last_request = when;
		if (item->has_query)
			query_request (item);
		else
			field_request (item);
	}

	snmp_engine_flush ();

	return 1;
}
Exemplo n.º 2
0
static long px_tp_d_ioctl( struct file *fp,
                               unsigned int cmd,
                               unsigned long arg)
#endif
{
	switch (cmd)
	{
	case PX_TP_CMD_START_MODULE_TRACKING:
		return start_module_tracking();

	case PX_TP_CMD_START_SAMPLING:
		return start_sampling((bool *)arg);

	case PX_TP_CMD_STOP_PROFILING:
		return stop_profiling();

	case PX_TP_CMD_PAUSE_PROFILING:
		return pause_profiling();

	case PX_TP_CMD_RESUME_PROFILING:
		return resume_profiling();

	case PX_TP_CMD_ALLOC_EVENT_BUFFER:
		return allocate_event_buffer((unsigned int *)arg);

	case PX_TP_CMD_ALLOC_MODULE_BUFFER:
		return allocate_module_buffer((unsigned int *)arg);

	case PX_TP_CMD_FREE_EVENT_BUFFER:
		return free_event_buffer();

	case PX_TP_CMD_FREE_MODULE_BUFFER:
		return free_module_buffer();

	case PX_TP_CMD_SET_AUTO_LAUNCH_APP_PID:
		return set_auto_launch_app_pid((pid_t *)arg);

	case PX_TP_CMD_SET_WAIT_IMAGE_LOAD_NAME:
		return set_wait_image_load_name((char *)arg);

	case PX_TP_CMD_QUERY_REQUEST:
		return query_request((struct query_request_data *)arg);

	case PX_TP_CMD_GET_CPU_ID:
		return get_cpu_id((unsigned long *)arg);

	case PX_TP_CMD_GET_TARGET_RAW_DATA_LENGTH:
		return get_target_raw_data_length((unsigned long *)arg);

	case PX_TP_CMD_GET_TARGET_INFO:
		return get_target_info((unsigned long *)arg);

	case PX_TP_CMD_GET_CPU_FREQ:
		return get_cpu_freq((unsigned int *)arg);

	case PX_TP_CMD_GET_TIMESTAMP_FREQ:
		return get_timestamp_frequency((unsigned long *)arg);

	case PX_TP_CMD_GET_TIMESTAMP:
		return get_time_stamp((unsigned long long *)arg);

	case PX_TP_CMD_ADD_MODULE_RECORD:
		return add_module_record((struct add_module_data *)arg);
#if 0
	case PX_TP_CMD_RESET_EVENT_BUFFER_FULL:
		return reset_event_buffer_full((bool *)arg);

	case PX_TP_CMD_RESET_MODULE_BUFFER_FULL:
		return reset_module_buffer_full((bool *)arg);
#endif
//	case PX_TP_CMD_SET_KERNEL_FUNC_ADDR:
//		return set_kernel_func_addr((struct tp_kernel_func_addr *)arg);

//	case PX_TP_CMD_HOOK_ADDRESS:
//		return hook_address((struct tp_hook_address *)arg);

	case PX_TP_CMD_READ_EVENT_BUFFER:
		return read_event_buffer((struct read_buffer_data *)arg);

	case PX_TP_CMD_READ_MODULE_BUFFER:
		return read_module_buffer((struct read_buffer_data *)arg);

	case PX_TP_CMD_GET_POSSIBLE_CPU_NUM:
		return get_possible_cpu_number((unsigned int *)arg);

	case PX_TP_CMD_GET_ONLINE_CPU_NUM:
		return get_online_cpu_number((unsigned int *)arg);

	default:
		return -EINVAL;
	}
}
Exemplo n.º 3
0
static long px_hotspot_d_ioctl(struct file *fp,
                               unsigned int cmd,
                               unsigned long arg)
#endif
{
	int ret;
	
	if ((ret = check_ioctl(fp, cmd, arg)) != 0)
		return ret;

	switch (cmd)
	{
	case PX_HS_CMD_START_MODULE_TRACKING:
		return start_module_tracking_hs();

	case PX_HS_CMD_START_SAMPLING:
		return start_sampling((bool *)arg);

	case PX_HS_CMD_STOP_PROFILING:
		return stop_profiling();

	case PX_HS_CMD_PAUSE_PROFILING:
		return pause_profiling();

	case PX_HS_CMD_RESUME_PROFILING:
		return resume_profiling();

	case PX_HS_CMD_ALLOC_SAMPLE_BUFFER:
		return allocate_all_sample_buffers((unsigned int *)arg);

	case PX_HS_CMD_ALLOC_MODULE_BUFFER:
		return allocate_module_buffer((unsigned int *)arg);

	case PX_HS_CMD_FREE_SAMPLE_BUFFER:
		return free_all_sample_buffers();

	case PX_HS_CMD_FREE_MODULE_BUFFER:
		return free_module_buffer();

	case PX_HS_CMD_SET_AUTO_LAUNCH_APP_PID:
		return set_auto_launch_app_pid((pid_t *)arg);

	case PX_HS_CMD_SET_WAIT_IMAGE_LOAD_NAME:
		return set_wait_image_load_name((char *)arg);

	case PX_HS_CMD_SET_TBS_SETTINGS:
		return set_tbs_settings((struct HSTimerSettings *)arg);

	case PX_HS_CMD_SET_EBS_SETTINGS:
		return set_ebs_settings((struct HSEventSettings *)arg);

	case PX_HS_CMD_SET_CALIBRATION_MODE:
		return set_calibration_mode((bool *)arg);

	case PX_HS_CMD_QUERY_REQUEST:
		return query_request((struct query_request_data *)arg);

	case PX_HS_CMD_GET_CALIBRATION_RESULT:
		return get_calibration_result((struct calibration_result *)arg);

	case PX_HS_CMD_GET_CPU_ID:
		return get_cpu_id((unsigned long *)arg);

	case PX_HS_CMD_GET_TARGET_RAW_DATA_LENGTH:
		return get_target_raw_data_length((unsigned long *)arg);

	case PX_HS_CMD_GET_TARGET_INFO:
		return get_target_info((unsigned long *)arg);

	case PX_HS_CMD_GET_CPU_FREQ:
		return get_cpu_freq((unsigned int *)arg);

	case PX_HS_CMD_GET_TIMESTAMP_FREQ:
		return get_timestamp_frequency((unsigned long *)arg);

	case PX_HS_CMD_GET_TIMESTAMP:
		return get_time_stamp((unsigned long long *)arg);

	case PX_HS_CMD_ADD_MODULE_RECORD:
		return add_module_record_hs((struct add_module_data *)arg);

	case PX_HS_CMD_READ_SAMPLE_BUFFER:
		return read_sample_buffer((struct read_buffer_data *)arg);

	case PX_HS_CMD_READ_MODULE_BUFFER:
		return read_module_buffer((struct read_buffer_data *)arg);

	case PX_HS_CMD_READ_TOTAL_SAMPLE_COUNT:
		return read_total_sample_count((unsigned long long *)arg);

	case PX_HS_CMD_GET_POSSIBLE_CPU_NUM:
		return get_possible_cpu_number((unsigned int *)arg);

	case PX_HS_CMD_GET_ONLINE_CPU_NUM:
		return get_online_cpu_number((unsigned int *)arg);

	default:
		return -EINVAL;
	}
}