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 | |
11 | *******************************************************************************/ | |
12 | package org.eclipse.linuxtools.lttng.ui.views.resources.evProcessor; | |
13 | ||
14 | import org.eclipse.linuxtools.lttng.event.LttngEvent; | |
15 | import org.eclipse.linuxtools.lttng.state.evProcessor.ILttngEventProcessor; | |
16 | import org.eclipse.linuxtools.lttng.state.model.LttngTraceState; | |
17 | ||
18 | /** | |
19 | * Creates instances of specific after state update handlers, per corresponding | |
20 | * event. | |
21 | * | |
22 | * @author alvaro | |
23 | * | |
24 | */ | |
25 | public class ResourcesAfterUpdateHandlers { | |
26 | ||
27 | /** | |
28 | * <p> | |
29 | * Handles: LTT_EVENT_SCHED_SCHEDULE | |
30 | * </p> | |
31 | * Replace C function named "after_schedchange_hook" in eventhooks.c | |
32 | * <p> | |
33 | * Fields: LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE | |
34 | * </p> | |
35 | * | |
36 | * @return | |
37 | */ | |
38 | final ILttngEventProcessor getAfterSchedChangeHandler() { | |
39 | AbsResourcesTRangeUpdate handler = new AbsResourcesTRangeUpdate() { | |
40 | ||
d4011df2 | 41 | @Override |
6e512b93 ASL |
42 | public boolean process(LttngEvent trcEvent, LttngTraceState traceSt) { |
43 | ||
44 | // TODO: After sched scheduler handler should implement an | |
45 | // update to the current resource data, similar to | |
46 | // current_hash_data in C | |
47 | // We don't keep track of current hashed resource, we look in | |
48 | // the hash table every time. keeping track of current hash may | |
49 | // improve performance, although needs to be bench marked to | |
50 | // verify | |
51 | // if there's is a real gain. | |
52 | ||
53 | // process_list->current_hash_data[trace_num][process_in->cpu] = | |
54 | // hashed_process_data_in; | |
55 | ||
56 | return false; | |
57 | } | |
58 | }; | |
59 | ||
60 | return handler; | |
61 | } | |
62 | ||
63 | /** | |
64 | * Drawing stuff ? | |
65 | */ | |
66 | // int after_request(void *hook_data, void *call_data) | |
67 | // int after_chunk(void *hook_data, void *call_data) | |
68 | // int before_statedump_end(void *hook_data, void *call_data) | |
69 | } |