Commit | Line | Data |
---|---|---|
6e512b93 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation | |
860cadcf | 11 | * Michel Dagenais (michel.dagenais@polymtl.ca) - Reference C implementation, used with permission |
6e512b93 | 12 | *******************************************************************************/ |
638eac44 | 13 | package org.eclipse.linuxtools.internal.lttng.ui.views.resources.evProcessor; |
6e512b93 | 14 | |
5945cec9 FC |
15 | import org.eclipse.linuxtools.internal.lttng.core.event.LttngEvent; |
16 | import org.eclipse.linuxtools.internal.lttng.core.state.evProcessor.ILttngEventProcessor; | |
17 | import org.eclipse.linuxtools.internal.lttng.core.state.model.LttngTraceState; | |
6e512b93 ASL |
18 | |
19 | /** | |
20 | * Creates instances of specific after state update handlers, per corresponding | |
21 | * event. | |
22 | * | |
23 | * @author alvaro | |
24 | * | |
25 | */ | |
26 | public class ResourcesAfterUpdateHandlers { | |
27 | ||
28 | /** | |
29 | * <p> | |
30 | * Handles: LTT_EVENT_SCHED_SCHEDULE | |
31 | * </p> | |
32 | * Replace C function named "after_schedchange_hook" in eventhooks.c | |
33 | * <p> | |
34 | * Fields: LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE | |
35 | * </p> | |
36 | * | |
37 | * @return | |
38 | */ | |
39 | final ILttngEventProcessor getAfterSchedChangeHandler() { | |
40 | AbsResourcesTRangeUpdate handler = new AbsResourcesTRangeUpdate() { | |
41 | ||
d4011df2 | 42 | @Override |
6e512b93 ASL |
43 | public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) { |
44 | ||
45 | // TODO: After sched scheduler handler should implement an | |
46 | // update to the current resource data, similar to | |
47 | // current_hash_data in C | |
48 | // We don't keep track of current hashed resource, we look in | |
49 | // the hash table every time. keeping track of current hash may | |
50 | // improve performance, although needs to be bench marked to | |
51 | // verify | |
52 | // if there's is a real gain. | |
53 | ||
54 | // process_list->current_hash_data[trace_num][process_in->cpu] = | |
55 | // hashed_process_data_in; | |
56 | ||
57 | return false; | |
58 | } | |
59 | }; | |
60 | ||
61 | return handler; | |
62 | } | |
63 | ||
64 | /** | |
65 | * Drawing stuff ? | |
66 | */ | |
67 | // int after_request(void *hook_data, void *call_data) | |
68 | // int after_chunk(void *hook_data, void *call_data) | |
69 | // int before_statedump_end(void *hook_data, void *call_data) | |
70 | } |