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 * Michel Dagenais (michel.dagenais@polymtl.ca) - Reference C implementation, used with permission
12 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.resources
.evProcessor
;
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
;
20 * Creates instances of specific after state update handlers, per corresponding
26 public class ResourcesAfterUpdateHandlers
{
30 * Handles: LTT_EVENT_SCHED_SCHEDULE
32 * Replace C function named "after_schedchange_hook" in eventhooks.c
34 * Fields: LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE
39 final ILttngEventProcessor
getAfterSchedChangeHandler() {
40 AbsResourcesTRangeUpdate handler
= new AbsResourcesTRangeUpdate() {
43 public boolean process(LttngEvent trcEvent
, LttngTraceState traceSt
) {
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
52 // if there's is a real gain.
54 // process_list->current_hash_data[trace_num][process_in->cpu] =
55 // hashed_process_data_in;
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)