add block device resource tracing to resourceview plugin
[lttv.git] / ltt / branches / poly / lttv / modules / gui / resourceview / eventhooks.h
CommitLineData
9e01e6d4 1/* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Mathieu Desnoyers
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 * MA 02111-1307, USA.
17 */
18
19
20/* eventhooks.h defines the hooks that are given to processTrace as parameter.
21 * These hooks call the drawing API to draw the information on the screen,
22 * using information from Context, but mostly state (running, waiting...).
23 */
24
25
26#ifndef _EVENT_HOOKS_H
27#define _EVENT_HOOKS_H
28
29#include <gtk/gtk.h>
30#include <lttvwindow/mainwindow.h>
31#include <ltt/time.h>
32
33#include "processlist.h"
34#include "drawing.h"
35#include "cfv.h"
36
37
38/* Structure used to store and use information relative to one events refresh
39 * request. Typically filled in by the expose event callback, then passed to the
40 * library call, then used by the drawing hooks. Then, once all the events are
41 * sent, it is freed by the hook called after the reading.
42 */
43//typedef struct _EventRequest
44//{
45// ControlFlowData *control_flow_data;
46// LttTime time_begin, time_end;
47// gint x_begin, x_end;
48 /* Fill the Events_Context during the initial expose, before calling for
49 * events.
50 */
51 //GArray Events_Context; //FIXME
52//} EventRequest ;
53
54
55
56
57
58void send_test_data(ProcessList *process_list, Drawing_t *drawing);
59
58a9b31b 60GtkWidget *h_resourceview(LttvPlugin *plugin);
9e01e6d4 61
62GtkWidget *h_legend(LttvPlugin *plugin);
63
64int event_selected_hook(void *hook_data, void *call_data);
65
66/*
67 * The draw event hook is called by the reading API to have a
68 * particular event drawn on the screen.
69 * @param hook_data ControlFlowData structure of the viewer.
70 * @param call_data Event context with state.
71 *
72 * This function basically draw lines and icons. Two types of lines are drawn :
73 * one small (3 pixels?) representing the state of the process and the second
74 * type is thicker (10 pixels?) representing on which CPU a process is running
75 * (and this only in running state).
76 *
77 * Extremums of the lines :
78 * x_min : time of the last event context for this process kept in memory.
79 * x_max : time of the current event.
80 * y : middle of the process in the process list. The process is found in the
81 * list, therefore is it's position in pixels.
82 *
83 * The choice of lines'color is defined by the context of the last event for this
84 * process.
85 */
86int before_schedchange_hook(void *hook_data, void *call_data);
87int after_schedchange_hook(void *hook_data, void *call_data);
88int before_execmode_hook(void *hook_data, void *call_data);
89int after_execmode_hook(void *hook_data, void *call_data);
90
91
92int before_process_exit_hook(void *hook_data, void *call_data);
93int before_process_release_hook(void *hook_data, void *call_data);
94int after_process_exit_hook(void *hook_data, void *call_data);
95int after_process_fork_hook(void *hook_data, void *call_data);
96int after_fs_exec_hook(void *hook_data, void *call_data);
97int after_user_generic_thread_brand_hook(void *hook_data, void *call_data);
98int after_event_enum_process_hook(void *hook_data, void *call_data);
99
100#if 0
101int before_process_hook(void *hook_data, void *call_data);
102int after_process_hook(void *hook_data, void *call_data);
103#endif //0
104
105void draw_closure(gpointer key, gpointer value, gpointer user_data);
106
107int before_chunk(void *hook_data, void *call_data);
108int after_chunk(void *hook_data, void *call_data);
109int before_request(void *hook_data, void *call_data);
110int after_request(void *hook_data, void *call_data);
111int before_statedump_end(void *hook_data, void *call_data);
20d16f82 112int before_bdev_event_hook(void *hook_data, void *call_data);
9e01e6d4 113
114
115gint update_time_window_hook(void *hook_data, void *call_data);
116gint update_current_time_hook(void *hook_data, void *call_data);
117gint traceset_notify(void *hook_data, void *call_data);
118gint redraw_notify(void *hook_data, void *call_data);
119gint continue_notify(void *hook_data, void *call_data);
120
121void legend_destructor(GtkWindow *legend);
122
123#endif // _EVENT_HOOKS_H
This page took 0.039421 seconds and 4 git commands to generate.