1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
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
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.resources
.evProcessor
;
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
;
19 * Creates instances of specific after state update handlers, per corresponding
25 public class ResourcesAfterUpdateHandlers
{
29 * Handles: LTT_EVENT_SCHED_SCHEDULE
31 * Replace C function named "after_schedchange_hook" in eventhooks.c
33 * Fields: LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE
38 final ILttngEventProcessor
getAfterSchedChangeHandler() {
39 AbsResourcesTRangeUpdate handler
= new AbsResourcesTRangeUpdate() {
41 public boolean process(LttngEvent trcEvent
, LttngTraceState traceSt
) {
43 // TODO: After sched scheduler handler should implement an
44 // update to the current resource data, similar to
45 // current_hash_data in C
46 // We don't keep track of current hashed resource, we look in
47 // the hash table every time. keeping track of current hash may
48 // improve performance, although needs to be bench marked to
50 // if there's is a real gain.
52 // process_list->current_hash_data[trace_num][process_in->cpu] =
53 // hashed_process_data_in;
65 // int after_request(void *hook_data, void *call_data)
66 // int after_chunk(void *hook_data, void *call_data)
67 // int before_statedump_end(void *hook_data, void *call_data)