Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 85a012e6f3ff293d245a181c9528bb4648234b8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*******************************************************************************
 * Copyright (c) 2009 Ericsson
 * 
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
 * 	 Michel Dagenais (michel.dagenais@polymtl.ca) - Reference C implementation, used with permission
 *******************************************************************************/
package org.eclipse.linuxtools.lttng.ui.views.resources.evProcessor;

import org.eclipse.linuxtools.lttng.event.LttngEvent;
import org.eclipse.linuxtools.lttng.state.evProcessor.ILttngEventProcessor;
import org.eclipse.linuxtools.lttng.state.model.LttngTraceState;

/**
 * Creates instances of specific after state update handlers, per corresponding
 * event.
 * 
 * @author alvaro
 * 
 */
public class ResourcesAfterUpdateHandlers {

	/**
	 * <p>
	 * Handles: LTT_EVENT_SCHED_SCHEDULE
	 * </p>
	 * Replace C function named "after_schedchange_hook" in eventhooks.c
	 * <p>
	 * Fields: LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE
	 * </p>
	 * 
	 * @return
	 */
	final ILttngEventProcessor getAfterSchedChangeHandler() {
		AbsResourcesTRangeUpdate handler = new AbsResourcesTRangeUpdate() {

			@Override
			public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) {

				// TODO: After sched scheduler handler should implement an
				// update to the current resource data, similar to
				// current_hash_data in C
				// We don't keep track of current hashed resource, we look in
				// the hash table every time. keeping track of current hash may
				// improve performance, although needs to be bench marked to
				// verify
				// if there's is a real gain.

				// process_list->current_hash_data[trace_num][process_in->cpu] =
				// hashed_process_data_in;

				return false;
			}
		};

		return handler;
	}

	/**
	 * Drawing stuff ?
	 */
	// int after_request(void *hook_data, void *call_data)
	// int after_chunk(void *hook_data, void *call_data)
	// int before_statedump_end(void *hook_data, void *call_data)
}

Back to the top