Ejemplo n.º 1
0
static int
process_event(event_t *event, unsigned long offset, unsigned long head)
{
	trace_event(event);

	switch (event->header.type) {
	case PERF_RECORD_MMAP ... PERF_RECORD_LOST:
		return 0;

	case PERF_RECORD_COMM:
		return process_comm_event(event, offset, head);

	case PERF_RECORD_EXIT ... PERF_RECORD_READ:
		return 0;

	case PERF_RECORD_SAMPLE:
		return process_sample_event(event, offset, head);

	case PERF_RECORD_MAX:
	default:
		return -1;
	}

	return 0;
}
Ejemplo n.º 2
0
static void process_samples(void)
{
	struct sample_wrapper *cursor;
	event_t *event;

	sort_queued_samples();

	cursor = all_samples;
	while (cursor) {
		event = (void *)&cursor->data;
		cursor = cursor->next;
		process_sample_event(event);
	}
}
Ejemplo n.º 3
0
static int process_event(struct machine *machine, struct perf_evlist *evlist,
			 union perf_event *event, struct state *state)
{
	if (event->header.type == PERF_RECORD_SAMPLE)
		return process_sample_event(machine, evlist, event, state);

	if (event->header.type == PERF_RECORD_THROTTLE ||
	    event->header.type == PERF_RECORD_UNTHROTTLE)
		return 0;

	if (event->header.type < PERF_RECORD_MAX) {
		int ret;

		ret = machine__process_event(machine, event, NULL);
		if (ret < 0)
			pr_debug("machine__process_event failed, event type %u\n",
				 event->header.type);
		return ret;
	}

	return 0;
}