resourceview: add trap resource
[lttv.git] / ltt / branches / poly / lttv / modules / gui / resourceview / processlist.c
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#ifdef HAVE_CONFIG_H
20#include <config.h>
21#endif
22
23#include <gtk/gtk.h>
24#include <gdk/gdk.h>
25#include <glib.h>
26#include <string.h>
27#include <stdlib.h>
28#include <math.h>
29
30#include "processlist.h"
31#include "drawing.h"
32#include "drawitem.h"
33
34#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
58a9b31b 35//#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
9e01e6d4 36
37/* Preallocated Size of the index_to_pixmap array */
38#define ALLOCATE_PROCESSES 1000
39
40/*****************************************************************************
41 * Methods to synchronize process list *
42 *****************************************************************************/
43
44
fb93b151 45gint resource_sort_func ( GtkTreeModel *model,
46 GtkTreeIter *it_a,
47 GtkTreeIter *it_b,
48 gpointer user_data)
49{
50 gchar *a_name;
51 gchar *b_name;
52
53 gtk_tree_model_get(model, it_a, NAME_COLUMN, &a_name, -1);
54
55 gtk_tree_model_get(model, it_b, NAME_COLUMN, &b_name, -1);
56
57 return strcmp(a_name, b_name);
58}
9e01e6d4 59
67f72973 60static guint ru_numeric_hash_fct(gconstpointer key)
9e01e6d4 61{
d0e4ae2f 62 ResourceUniqueNumeric *ru = (ResourceUniqueNumeric *)key;
67f72973 63 int tmp = (ru->trace_num << 8) ^ ru->id;
64
65 return g_int_hash(&tmp);
9e01e6d4 66}
67
67f72973 68static gboolean ru_numeric_equ_fct(gconstpointer a, gconstpointer b)
9e01e6d4 69{
67f72973 70 const ResourceUniqueNumeric *pa = (const ResourceUniqueNumeric *)a;
71 const ResourceUniqueNumeric *pb = (const ResourceUniqueNumeric *)b;
9e01e6d4 72
67f72973 73 if(pa->id == pb->id && pa->trace_num == pb->trace_num)
74 return TRUE;
9e01e6d4 75
67f72973 76 return FALSE;
9e01e6d4 77}
78
79void destroy_hash_key(gpointer key);
80
81void destroy_hash_data(gpointer data);
82
83
84gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data)
85{
86 ControlFlowData *control_flow_data =
87 (ControlFlowData*)g_object_get_data(
88 G_OBJECT(widget),
67f72973 89 "resourceview_data");
9e01e6d4 90 Drawing_t *drawing = control_flow_data->drawing;
91 unsigned int cell_height =
92 get_cell_height(GTK_TREE_VIEW(control_flow_data->process_list->process_list_widget));
93
94 switch(event->direction) {
95 case GDK_SCROLL_UP:
96 gtk_adjustment_set_value(control_flow_data->v_adjust,
97 gtk_adjustment_get_value(control_flow_data->v_adjust) - cell_height);
98 break;
99 case GDK_SCROLL_DOWN:
100 gtk_adjustment_set_value(control_flow_data->v_adjust,
101 gtk_adjustment_get_value(control_flow_data->v_adjust) + cell_height);
102 break;
103 default:
104 g_error("should only scroll up and down.");
105 }
106 return TRUE;
107}
108
67f72973 109static gboolean update_index_to_pixmap_each (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, UpdateIndexPixmapArg *arg)
9e01e6d4 110{
67f72973 111 guint array_index = arg->count;
112 HashedResourceData *hdata;
113 gchar *name;
114
115 gtk_tree_model_get(model, iter, NAME_COLUMN, &name, DATA_COLUMN, &hdata, -1);
116
117 g_assert(array_index < arg->process_list->index_to_pixmap->len);
9e01e6d4 118
67f72973 119 GdkPixmap **pixmap =
120 (GdkPixmap**)&g_ptr_array_index(arg->process_list->index_to_pixmap, array_index);
121 *pixmap = hdata->pixmap;
9e01e6d4 122
67f72973 123 arg->count++;
9e01e6d4 124
67f72973 125 return FALSE;
9e01e6d4 126}
127
9e01e6d4 128void update_index_to_pixmap(ProcessList *process_list)
129{
67f72973 130 int i, items=0;
131 UpdateIndexPixmapArg arg;
132
133 for(i=0; i<RV_RESOURCE_COUNT; i++) {
134 items += g_hash_table_size(process_list->restypes[i].hash_table);
135 }
136
137 g_ptr_array_set_size(process_list->index_to_pixmap, items);
138
139 arg.count = 0;
140 arg.process_list = process_list;
141
d0e4ae2f 142 gtk_tree_model_foreach(GTK_TREE_MODEL(process_list->list_store),
67f72973 143 (GtkTreeModelForeachFunc)update_index_to_pixmap_each, &arg);
9e01e6d4 144}
145
146
67f72973 147static void update_pixmap_size_each(void *key,
58a9b31b 148 HashedResourceData *value,
9e01e6d4 149 guint width)
150{
151 GdkPixmap *old_pixmap = value->pixmap;
152
153 value->pixmap =
154 gdk_pixmap_new(old_pixmap,
155 width,
156 value->height,
157 -1);
158
159 gdk_pixmap_unref(old_pixmap);
160}
161
162
163void update_pixmap_size(ProcessList *process_list, guint width)
164{
67f72973 165 int i;
166 for(i=0; i<RV_RESOURCE_COUNT; i++) {
167 g_hash_table_foreach(process_list->restypes[i].hash_table,
9e01e6d4 168 (GHFunc)update_pixmap_size_each,
169 (gpointer)width);
67f72973 170 }
9e01e6d4 171}
172
173
174typedef struct _CopyPixmap {
175 GdkDrawable *dest;
176 GdkGC *gc;
177 GdkDrawable *src;
178 gint xsrc, ysrc, xdest, ydest, width, height;
179} CopyPixmap;
180
67f72973 181static void copy_pixmap_region_each(void *key,
58a9b31b 182 HashedResourceData *value,
9e01e6d4 183 CopyPixmap *cp)
184{
185 GdkPixmap *src = cp->src;
186 GdkPixmap *dest = cp->dest;
187
188 if(dest == NULL)
189 dest = value->pixmap;
190 if(src == NULL)
191 src = value->pixmap;
192
193 gdk_draw_drawable (dest,
194 cp->gc,
195 src,
196 cp->xsrc, cp->ysrc,
197 cp->xdest, cp->ydest,
198 cp->width, cp->height);
199}
200
9e01e6d4 201void copy_pixmap_region(ProcessList *process_list, GdkDrawable *dest,
202 GdkGC *gc, GdkDrawable *src,
203 gint xsrc, gint ysrc,
204 gint xdest, gint ydest, gint width, gint height)
205{
67f72973 206 int i;
9e01e6d4 207 CopyPixmap cp = { dest, gc, src, xsrc, ysrc, xdest, ydest, width, height };
208
67f72973 209 for(i=0; i<RV_RESOURCE_COUNT; i++) {
210 g_hash_table_foreach(process_list->restypes[i].hash_table,
9e01e6d4 211 (GHFunc)copy_pixmap_region_each,
212 &cp);
67f72973 213 }
9e01e6d4 214}
215
216
217
218typedef struct _RectanglePixmap {
219 gboolean filled;
220 gint x, y, width, height;
221 GdkGC *gc;
222} RectanglePixmap;
223
67f72973 224static void rectangle_pixmap_each(void *key,
58a9b31b 225 HashedResourceData *value,
9e01e6d4 226 RectanglePixmap *rp)
227{
228 if(rp->height == -1)
229 rp->height = value->height;
230
231 gdk_draw_rectangle (value->pixmap,
232 rp->gc,
233 rp->filled,
234 rp->x, rp->y,
235 rp->width, rp->height);
236}
237
9e01e6d4 238void rectangle_pixmap(ProcessList *process_list, GdkGC *gc,
239 gboolean filled, gint x, gint y, gint width, gint height)
240{
67f72973 241 int i;
9e01e6d4 242 RectanglePixmap rp = { filled, x, y, width, height, gc };
243
67f72973 244 for(i=0; i<RV_RESOURCE_COUNT; i++) {
245 g_hash_table_foreach(process_list->restypes[i].hash_table,
9e01e6d4 246 (GHFunc)rectangle_pixmap_each,
247 &rp);
67f72973 248 }
9e01e6d4 249}
250
9e01e6d4 251/* Renders each pixmaps into on big drawable */
252void copy_pixmap_to_screen(ProcessList *process_list,
253 GdkDrawable *dest,
254 GdkGC *gc,
255 gint x, gint y,
256 gint width, gint height)
257{
258 if(process_list->index_to_pixmap->len == 0) return;
259 guint cell_height = process_list->cell_height;
260
261 /* Get indexes */
262 gint begin = floor(y/(double)cell_height);
263 gint end = MIN(ceil((y+height)/(double)cell_height),
264 process_list->index_to_pixmap->len);
265 gint i;
266
267 for(i=begin; i<end; i++) {
268 g_assert(i<process_list->index_to_pixmap->len);
269 /* Render the pixmap to the screen */
270 GdkPixmap *pixmap =
271 //(GdkPixmap*)g_ptr_array_index(process_list->index_to_pixmap, i);
272 GDK_PIXMAP(g_ptr_array_index(process_list->index_to_pixmap, i));
273
274 gdk_draw_drawable (dest,
275 gc,
276 pixmap,
277 x, 0,
278 x, i*cell_height,
279 width, cell_height);
280
281 }
9e01e6d4 282}
283
9e01e6d4 284ProcessList *processlist_construct(void)
285{
286 GtkTreeViewColumn *column;
287 GtkCellRenderer *renderer;
288
289 ProcessList* process_list = g_new(ProcessList,1);
290
291 process_list->number_of_process = 0;
292
293 process_list->current_hash_data = NULL;
294
295 /* Create the Process list */
67f72973 296 process_list->list_store = gtk_tree_store_new ( N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
9e01e6d4 297
298 process_list->process_list_widget =
299 gtk_tree_view_new_with_model
300 (GTK_TREE_MODEL (process_list->list_store));
43805632 301
302 gtk_tree_view_set_show_expanders(
303 GTK_TREE_VIEW(process_list->process_list_widget), FALSE);
304 gtk_tree_view_set_level_indentation(
305 process_list->process_list_widget, 20);
306
307 gtk_tree_view_set_enable_tree_lines(process_list->process_list_widget, TRUE);
9e01e6d4 308
309 g_object_unref (G_OBJECT (process_list->list_store));
310
fb93b151 311 gtk_tree_sortable_set_default_sort_func(
312 GTK_TREE_SORTABLE(process_list->list_store),
313 resource_sort_func,
314 NULL,
315 NULL);
316
fb93b151 317 gtk_tree_sortable_set_sort_column_id(
318 GTK_TREE_SORTABLE(process_list->list_store),
319 GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
320 GTK_SORT_ASCENDING);
9e01e6d4 321
9e01e6d4 322 gtk_tree_view_set_headers_visible(
323 GTK_TREE_VIEW(process_list->process_list_widget), TRUE);
324
325 /* Create a column, associating the "text" attribute of the
326 * cell_renderer to the first column of the model */
327 /* Columns alignment : 0.0 : Left 0.5 : Center 1.0 : Right */
328 renderer = gtk_cell_renderer_text_new ();
329 process_list->renderer = renderer;
330
331 gint vertical_separator;
332 gtk_widget_style_get (GTK_WIDGET (process_list->process_list_widget),
333 "vertical-separator", &vertical_separator,
334 NULL);
335 gtk_cell_renderer_get_size(renderer,
336 GTK_WIDGET(process_list->process_list_widget),
337 NULL,
338 NULL,
339 NULL,
340 NULL,
341 &process_list->cell_height);
342
343#if GTK_CHECK_VERSION(2,4,15)
344 guint ypad;
345 g_object_get(G_OBJECT(renderer), "ypad", &ypad, NULL);
346
347 process_list->cell_height += ypad;
348#endif
349 process_list->cell_height += vertical_separator;
350
351
c4e6f4dc 352 column = gtk_tree_view_column_new_with_attributes ( "Resource",
9e01e6d4 353 renderer,
354 "text",
58a9b31b 355 NAME_COLUMN,
9e01e6d4 356 NULL);
357 gtk_tree_view_column_set_alignment (column, 0.0);
358 gtk_tree_view_column_set_fixed_width (column, 45);
359 gtk_tree_view_append_column (
360 GTK_TREE_VIEW (process_list->process_list_widget), column);
361
362 process_list->button = column->button;
9e01e6d4 363
364 g_object_set_data_full(
365 G_OBJECT(process_list->process_list_widget),
366 "process_list_Data",
367 process_list,
368 (GDestroyNotify)processlist_destroy);
369
370 process_list->index_to_pixmap = g_ptr_array_sized_new(ALLOCATE_PROCESSES);
67f72973 371
372 process_list->restypes[RV_RESOURCE_MACHINE].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
373 process_list->restypes[RV_RESOURCE_CPU].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
374 process_list->restypes[RV_RESOURCE_IRQ].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
0305fe77 375 process_list->restypes[RV_RESOURCE_SOFT_IRQ].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
38726a78 376 process_list->restypes[RV_RESOURCE_TRAP].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
67f72973 377 process_list->restypes[RV_RESOURCE_BDEV].hash_table = g_hash_table_new(ru_numeric_hash_fct, ru_numeric_equ_fct);
43805632 378
9e01e6d4 379 return process_list;
380}
381
382void processlist_destroy(ProcessList *process_list)
383{
67f72973 384 int i;
385
9e01e6d4 386 g_debug("processlist_destroy %p", process_list);
67f72973 387
388 for(i=0; i<RV_RESOURCE_COUNT; i++) {
389 g_hash_table_destroy(process_list->restypes[i].hash_table);
390 process_list->restypes[i].hash_table = NULL;
391 }
9e01e6d4 392 g_ptr_array_free(process_list->index_to_pixmap, TRUE);
393
394 g_free(process_list);
395 g_debug("processlist_destroy end");
396}
397
67f72973 398static gboolean remove_hash_item(void *key,
58a9b31b 399 HashedResourceData *hashed_process_data,
9e01e6d4 400 ProcessList *process_list)
401{
402 GtkTreeIter iter;
403
404 iter = hashed_process_data->y_iter;
405
67f72973 406 gtk_tree_store_remove (process_list->list_store, &iter);
9e01e6d4 407 gdk_pixmap_unref(hashed_process_data->pixmap);
408
58a9b31b 409// TODO pmf: check this; might be needed
410// if(likely(process_list->current_hash_data != NULL)) {
411// if(likely(hashed_process_data ==
412// process_list->current_hash_data[process_info->trace_num][process_info->cpu]))
413// process_list->current_hash_data[process_info->trace_num][process_info->cpu] = NULL;
414// }
9e01e6d4 415 return TRUE; /* remove the element from the hash table */
416}
417
418void processlist_clear(ProcessList *process_list)
419{
67f72973 420 int i;
421
9e01e6d4 422 g_info("processlist_clear %p", process_list);
423
67f72973 424 for(i=RV_RESOURCE_COUNT-1; i>=0; i--) {
425 g_hash_table_foreach_remove(process_list->restypes[i].hash_table,
426 (GHRFunc)remove_hash_item,
427 (gpointer)process_list);
428 }
9e01e6d4 429 process_list->number_of_process = 0;
430 update_index_to_pixmap(process_list);
431}
432
433
434GtkWidget *processlist_get_widget(ProcessList *process_list)
435{
436 return process_list->process_list_widget;
437}
438
439
440void destroy_hash_key(gpointer key)
441{
442 g_free(key);
443}
444
445void destroy_hash_data(gpointer data)
446{
447 g_free(data);
448}
449
37b0f1ed 450GQuark make_cpu_name(ControlFlowData *resourceview_data, guint trace_num, guint id)
451{
452 GQuark name;
453 gchar *str;
454
455 str = g_strdup_printf("CPU%u", id);
456 name = g_quark_from_string(str);
457 g_free(str);
458
459 return name;
460}
461
462GQuark make_irq_name(ControlFlowData *resourceview_data, guint trace_num, guint id)
463{
464 GQuark name;
465 gchar *str;
466
467 str = g_strdup_printf("IRQ %u", id);
468 name = g_quark_from_string(str);
469 g_free(str);
470
471 return name;
472}
473
0305fe77 474GQuark make_soft_irq_name(ControlFlowData *resourceview_data, guint trace_num, guint id)
475{
476 GQuark name;
477 gchar *str;
478
479 str = g_strdup_printf("SOFTIRQ %u", id);
480 name = g_quark_from_string(str);
481 g_free(str);
482
483 return name;
484}
485
38726a78 486GQuark make_trap_name(ControlFlowData *resourceview_data, guint trace_num, guint id)
487{
488 GQuark name;
489 gchar *str;
490
491 str = g_strdup_printf("Trap %u", id);
492 name = g_quark_from_string(str);
493 g_free(str);
494
495 return name;
496}
497
37b0f1ed 498GQuark make_bdev_name(ControlFlowData *resourceview_data, guint trace_num, guint id)
499{
500 GQuark name;
501 gchar *str;
502
503 str = g_strdup_printf("Block (%u,%u)", MAJOR(id), MINOR(id));
504 name = g_quark_from_string(str);
505 g_free(str);
506
507 return name;
508}
509
67f72973 510HashedResourceData *resourcelist_obtain_machine(ControlFlowData *resourceview_data, guint trace_num, guint id)
9e01e6d4 511{
67f72973 512 ResourceUniqueNumeric *ru = g_new(ResourceUniqueNumeric, 1);
513 HashedResourceData *data = g_new(HashedResourceData, 1);
514
515 /* Prepare hash key */
516 ru->trace_num = trace_num;
517 ru->id = id;
518
519 /* Search within hash table */
520 GHashTable *ht = resourceview_data->process_list->restypes[RV_RESOURCE_MACHINE].hash_table;
521 data = g_hash_table_lookup(ht, ru);
522
523 /* If not found in hash table, add it */
524 if(data == NULL) {
525 GQuark name;
526
527 data = g_malloc(sizeof(HashedResourceData));
528 /* Prepare hashed data */
529 data->type = RV_RESOURCE_MACHINE;
530 data->x.over = 0;
531 data->x.over_used = FALSE;
532 data->x.over_marked = FALSE;
533 data->x.middle = 0; // last
534 data->x.middle_used = FALSE;
535 data->x.middle_marked = FALSE;
536 data->x.under = 0;
537 data->x.under_used = FALSE;
538 data->x.under_marked = FALSE;
539 data->next_good_time = ltt_time_zero;
540
541 data->height = resourceview_data->process_list->cell_height;
542 data->pixmap =
543 gdk_pixmap_new(resourceview_data->drawing->drawing_area->window,
544 resourceview_data->drawing->alloc_width,
545 data->height,
546 -1);
547 g_assert(data->pixmap);
58a9b31b 548
67f72973 549 gdk_draw_rectangle (data->pixmap,
550 resourceview_data->drawing->drawing_area->style->black_gc,
551 TRUE,
552 0, 0,
553 resourceview_data->drawing->alloc_width,
554 data->height);
555
556 /* add to hash table */
557 g_hash_table_insert(ht, ru, data);
558 resourceview_data->process_list->number_of_process++; // TODO: check
559
560 /* add to process list */
561 {
562 gchar *str;
563 str = g_strdup_printf("Trace %u", id);
564 name = g_quark_from_string(str);
565 g_free(str);
566 }
567
568 gtk_tree_store_append(resourceview_data->process_list->list_store, &data->y_iter, NULL);
569 gtk_tree_store_set(resourceview_data->process_list->list_store, &data->y_iter,
570 NAME_COLUMN, g_quark_to_string(name), DATA_COLUMN, data,
571 -1);
572
573 update_index_to_pixmap(resourceview_data->process_list);
574
575 int heightall = data->height * resourceview_data->process_list->number_of_process;
576
577 gtk_widget_set_size_request(resourceview_data->drawing->drawing_area,
578 -1,
579 heightall);
9e01e6d4 580
67f72973 581 gtk_widget_queue_draw(resourceview_data->drawing->drawing_area);
582 }
583
d0e4ae2f 584 gtk_tree_view_expand_all(GTK_TREE_VIEW(resourceview_data->process_list->process_list_widget));
67f72973 585
586 return data;
587}
588
37b0f1ed 589HashedResourceData *resourcelist_obtain_generic(ControlFlowData *resourceview_data, gint res_type, guint trace_num, guint id, GQuark (*make_name_func)(ControlFlowData *resourceview_data, guint trace_num, guint id))
67f72973 590{
591 ResourceUniqueNumeric *ru = g_new(ResourceUniqueNumeric, 1);
592 HashedResourceData *data = g_new(HashedResourceData, 1);
9e01e6d4 593
67f72973 594 /* Prepare hash key */
595 ru->trace_num = trace_num;
596 ru->id = id;
9e01e6d4 597
67f72973 598 /* Search within hash table */
37b0f1ed 599 GHashTable *ht = resourceview_data->process_list->restypes[res_type].hash_table;
67f72973 600 data = g_hash_table_lookup(ht, ru);
601
602 /* If not found in hash table, add it */
603 if(data == NULL) {
604 GQuark name;
605 HashedResourceData *parent;
606
607 /* Find the parent machine */
608 parent = resourcelist_obtain_machine(resourceview_data, trace_num, trace_num);
609
610 /* Prepare hashed data */
611 data = g_malloc(sizeof(HashedResourceData));
612
37b0f1ed 613 data->type = res_type;
67f72973 614 data->x.over = 0;
615 data->x.over_used = FALSE;
616 data->x.over_marked = FALSE;
617 data->x.middle = 0; // last
618 data->x.middle_used = FALSE;
619 data->x.middle_marked = FALSE;
620 data->x.under = 0;
621 data->x.under_used = FALSE;
622 data->x.under_marked = FALSE;
623 data->next_good_time = ltt_time_zero;
624
625 data->height = resourceview_data->process_list->cell_height;
626 data->pixmap =
627 gdk_pixmap_new(resourceview_data->drawing->drawing_area->window,
628 resourceview_data->drawing->alloc_width,
629 data->height,
630 -1);
631
632 gdk_draw_rectangle (data->pixmap,
633 resourceview_data->drawing->drawing_area->style->black_gc,
634 TRUE,
635 0, 0,
636 resourceview_data->drawing->alloc_width,
637 data->height);
9e01e6d4 638
67f72973 639 /* add to hash table */
640 g_hash_table_insert(ht, ru, data);
641 resourceview_data->process_list->number_of_process++; // TODO: check
9e01e6d4 642
67f72973 643 /* add to process list */
37b0f1ed 644 name = make_name_func(resourceview_data, trace_num, id);
9e01e6d4 645
67f72973 646 gtk_tree_store_append(resourceview_data->process_list->list_store, &data->y_iter, &parent->y_iter);
647 gtk_tree_store_set(resourceview_data->process_list->list_store, &data->y_iter,
648 NAME_COLUMN, g_quark_to_string(name), DATA_COLUMN, data,
649 -1);
9e01e6d4 650
67f72973 651 update_index_to_pixmap(resourceview_data->process_list);
652
653 int heightall = data->height * resourceview_data->process_list->number_of_process;
654
655 gtk_widget_set_size_request(resourceview_data->drawing->drawing_area,
656 -1,
657 heightall);
658
659 gtk_widget_queue_draw(resourceview_data->drawing->drawing_area);
660 }
661
662 return data;
663}
664
37b0f1ed 665HashedResourceData *resourcelist_obtain_cpu(ControlFlowData *resourceview_data, guint trace_num, guint id)
67f72973 666{
37b0f1ed 667 return resourcelist_obtain_generic(resourceview_data, RV_RESOURCE_CPU, trace_num, id, make_cpu_name);
668}
67f72973 669
37b0f1ed 670HashedResourceData *resourcelist_obtain_irq(ControlFlowData *resourceview_data, guint trace_num, guint id)
671{
672 return resourcelist_obtain_generic(resourceview_data, RV_RESOURCE_IRQ, trace_num, id, make_irq_name);
67f72973 673}
9e01e6d4 674
0305fe77 675HashedResourceData *resourcelist_obtain_soft_irq(ControlFlowData *resourceview_data, guint trace_num, guint id)
676{
677 return resourcelist_obtain_generic(resourceview_data, RV_RESOURCE_SOFT_IRQ, trace_num, id, make_soft_irq_name);
678}
679
38726a78 680HashedResourceData *resourcelist_obtain_trap(ControlFlowData *resourceview_data, guint trace_num, guint id)
681{
682 return resourcelist_obtain_generic(resourceview_data, RV_RESOURCE_TRAP, trace_num, id, make_trap_name);
683}
684
67f72973 685HashedResourceData *resourcelist_obtain_bdev(ControlFlowData *resourceview_data, guint trace_num, guint id)
9e01e6d4 686{
37b0f1ed 687 return resourcelist_obtain_generic(resourceview_data, RV_RESOURCE_BDEV, trace_num, id, make_bdev_name);
9e01e6d4 688}
37b0f1ed 689
This page took 0.053867 seconds and 4 git commands to generate.