1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2005 Peter Ho
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;
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.
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,
29 #include <ltt/event.h>
30 #include <ltt/trace.h>
31 #include <lttv/module.h>
32 #include <lttv/hook.h>
33 #include <lttv/tracecontext.h>
34 #include <lttv/state.h>
35 #include <lttv/filter.h>
36 #include <lttvwindow/lttvwindow.h>
37 #include <lttvwindow/lttv_plugin_tab.h>
40 #include "hDiskPerformanceInsert.xpm"
43 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
44 #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
45 // fixed #define TRACE_NUMBER 0
60 LTTV_READ_OPERATION = 1,
64 typedef struct _DiskPerformanceData {
70 LttvHooks * hooks_trace_after;
72 LttvHooks * hooks_trace_before;
74 TimeWindow time_window;
76 GtkWidget * scroll_win;
78 /* Model containing list data */
79 GtkListStore *store_m;
83 /* Widget to display the data in a columned list */
86 /* Selection handler */
87 GtkTreeSelection *select_c;
91 LttvHooksById * event_by_id_hooks;
93 } DiskPerformanceData;
96 typedef struct _lttv_block {
102 typedef struct _lttv_total_block {
104 guint64 total_bytes_read;
105 guint num_read_operations;
106 guint64 total_bytes_written;
107 guint num_write_operations;
111 GSList *g_disk_data_list = NULL ;
116 GQuark LTT_FACILITY_BLOCK;
119 GQuark LTT_EVENT_BLOCK_READ;
120 GQuark LTT_EVENT_BLOCK_WRITE;
122 static DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab);
123 static void disk_destroy_walk(gpointer data, gpointer user_data);
124 static gboolean disk_show(void *hook_data, void *call_data);
125 static gboolean trace_header(void *hook_data, void *call_data);
126 static gboolean disk_update_time_window(void * hook_data, void * call_data);
127 static void request_event( DiskPerformanceData *disk_performance);
128 void gui_disperformance_free(DiskPerformanceData *event_viewer_data);
129 static void get_event_detail(LttEvent *e, lttv_block* disk_data);
130 static char * major_minor_to_diskname( lttv_block* disk_data);
131 static void sum_data(char* diskname, guint size, enum operation_t opt, GArray *disk_array);
132 static GtkWidget *disk_performance(LttvPlugin *plugin);
134 static gboolean block_read_callback(void *hook_data, void *call_data);
136 static gboolean block_write_callback(void *hook_data, void *call_data);
139 static gboolean disk_show(void *hook_data, void *call_data){
142 lttv_total_block element;
144 LttTime time_interval;
145 guint64 time_interval_64;
146 guint64 temp_variable;
147 guint64 bytes_read_per_sec, bytes_written_per_sec;
148 g_info(" diskperformance: disk_show() \n");
149 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
150 GArray *disk_array = disk_performance->disk_array;
151 time_interval = ltt_time_sub(disk_performance->time_window.end_time, disk_performance->time_window.start_time);
153 time_interval_64 = time_interval.tv_sec;
154 time_interval_64 *= NANOSECONDS_PER_SECOND;
155 time_interval_64 += time_interval.tv_nsec;
156 gtk_list_store_clear(disk_performance->store_m);
157 for(i = 0; i < disk_array->len; i++){
159 element = g_array_index(disk_array,lttv_total_block,i);
160 temp_variable = element.total_bytes_read * NANOSECONDS_PER_SECOND;
161 bytes_read_per_sec = (guint64) temp_variable / time_interval_64;
163 temp_variable = element.total_bytes_written * NANOSECONDS_PER_SECOND;
164 bytes_written_per_sec = (guint64) temp_variable / time_interval_64;
166 gtk_list_store_append (disk_performance->store_m, &iter);
167 gtk_list_store_set (disk_performance->store_m, &iter,
168 DISKNAME_COLUMN, element.diskname,
169 BYTES_RD_COLUMN, element.total_bytes_read,
170 BYTES_RD_SEC_COLUMN,bytes_read_per_sec,
171 NUM_RD_COLUMN, element.num_read_operations,
172 BYTES_WR_COLUMN, element.total_bytes_written,
173 BYTES_WR_SEC_COLUMN, bytes_written_per_sec,
174 NUM_WR_COLUMN, element.num_write_operations,
178 if(disk_performance->disk_array->len)
179 g_array_remove_range (disk_performance->disk_array,0,disk_performance->disk_array->len);
183 static gboolean trace_header(void *hook_data, void *call_data){
188 static gboolean disk_update_time_window(void * hook_data, void * call_data){
190 DiskPerformanceData *disk_performance = (DiskPerformanceData *) hook_data;
191 const TimeWindowNotifyData *time_window_nofify_data = ((const TimeWindowNotifyData *)call_data);
192 disk_performance->time_window = *time_window_nofify_data->new_time_window;
193 Tab *tab = disk_performance->tab;
194 lttvwindow_events_request_remove_all(tab, disk_performance);
195 request_event( disk_performance);
201 void gui_disperformance_free(DiskPerformanceData *eventdata){
202 Tab *tab = eventdata->tab;
203 g_info("disperformance.c : gui_disperformance_free, %p", eventdata);
204 g_info("%p, %p", eventdata, tab);
207 g_array_free (eventdata->disk_array, TRUE);
209 lttvwindow_unregister_time_window_notify(tab,
210 disk_update_time_window,
213 lttvwindow_events_request_remove_all(eventdata->tab,
215 g_disk_data_list = g_slist_remove(g_disk_data_list, eventdata);
218 g_info("disperformance.c : gui_disperformance_free end, %p", eventdata);
226 void disk_destructor_full(DiskPerformanceData *disk_data)
229 if(GTK_IS_WIDGET(disk_data->hbox_v))
230 gtk_widget_destroy(disk_data->hbox_v);
234 static void disk_destroy_walk(gpointer data, gpointer user_data)
236 g_info("Walk destroy GUI disk performance Viewer");
237 disk_destructor_full((DiskPerformanceData*)data);
243 * This is the entry point of the viewer.
249 g_info("Init diskPerformance.c");
251 LTT_FACILITY_BLOCK = g_quark_from_string("block");
252 LTT_EVENT_BLOCK_READ = g_quark_from_string("read");
253 LTT_EVENT_BLOCK_WRITE = g_quark_from_string("write");
255 lttvwindow_register_constructor("diskperformance",
257 "Insert Disk Performance",
258 hDiskPerformanceInsert_xpm,
259 "Insert Disk Performance",
267 GtkWidget *disk_performance(LttvPlugin *plugin)
269 LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
270 DiskPerformanceData* disk_data = disk_performance_data(ptab);
272 return disk_data->hbox_v;
278 * This function initializes the Event Viewer functionnality through the
281 DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab)
284 GtkTreeViewColumn *column;
285 GtkCellRenderer *renderer;
286 DiskPerformanceData* disk_data = g_new(DiskPerformanceData,1) ;
288 g_info("enter disk_performance_data \n");
289 Tab *tab = ptab->tab;
290 disk_data->tab = tab;
291 disk_data->ptab = ptab;
292 disk_data->time_window = lttvwindow_get_time_window(tab);
294 disk_data->disk_array = g_array_new(FALSE, FALSE, sizeof(lttv_total_block ));
296 lttvwindow_register_time_window_notify(tab,
297 disk_update_time_window,
300 disk_data->scroll_win = gtk_scrolled_window_new (NULL, NULL);
301 gtk_widget_show (disk_data->scroll_win);
302 gtk_scrolled_window_set_policy(
303 GTK_SCROLLED_WINDOW(disk_data->scroll_win),
304 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
306 /* Create a model for storing the data list */
307 disk_data->store_m = gtk_list_store_new (
308 N_COLUMNS, /* Total number of columns */
309 G_TYPE_STRING, /* Diskname */
310 G_TYPE_INT64, /* Bytes read */
311 G_TYPE_INT64, /* Bytes read/sec */
313 G_TYPE_INT64, /* bytes written */
314 G_TYPE_INT64, /* bytes written/sec */
318 disk_data->tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (disk_data->store_m));
320 g_object_unref (G_OBJECT (disk_data->store_m));
322 renderer = gtk_cell_renderer_text_new ();
324 column = gtk_tree_view_column_new_with_attributes ("DiskName",
326 "text", DISKNAME_COLUMN,
328 gtk_tree_view_column_set_alignment (column, 0.0);
329 gtk_tree_view_column_set_fixed_width (column, 45);
330 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
332 renderer = gtk_cell_renderer_text_new ();
333 column = gtk_tree_view_column_new_with_attributes ("BytesRead",
335 "text", BYTES_RD_COLUMN,
337 gtk_tree_view_column_set_alignment (column, 0.0);
338 gtk_tree_view_column_set_fixed_width (column, 220);
339 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
341 renderer = gtk_cell_renderer_text_new ();
342 column = gtk_tree_view_column_new_with_attributes ("BytesRead/sec",
344 "text", BYTES_RD_SEC_COLUMN,
346 gtk_tree_view_column_set_alignment (column, 1.0);
347 gtk_tree_view_column_set_fixed_width (column, 220);
348 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
350 renderer = gtk_cell_renderer_text_new ();
351 column = gtk_tree_view_column_new_with_attributes ("NumReadOperations",
353 "text",NUM_RD_COLUMN,
355 gtk_tree_view_column_set_alignment (column, 1.0);
356 gtk_tree_view_column_set_fixed_width (column, 220);
357 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
359 renderer = gtk_cell_renderer_text_new ();
360 column = gtk_tree_view_column_new_with_attributes ("BytesWritten",
362 "text", BYTES_WR_COLUMN,
364 gtk_tree_view_column_set_alignment (column, 0.0);
365 gtk_tree_view_column_set_fixed_width (column, 145);
366 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
368 renderer = gtk_cell_renderer_text_new ();
369 column = gtk_tree_view_column_new_with_attributes ("BytesWritten/sec",
371 "text", BYTES_WR_SEC_COLUMN,
373 gtk_tree_view_column_set_alignment (column, 1.0);
374 gtk_tree_view_column_set_fixed_width (column, 220);
375 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
377 renderer = gtk_cell_renderer_text_new ();
378 column = gtk_tree_view_column_new_with_attributes ("NumWriteOperations",
380 "text",NUM_WR_COLUMN,
382 gtk_tree_view_column_set_alignment (column, 0.0);
383 gtk_tree_view_column_set_fixed_width (column, 145);
384 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
386 disk_data->select_c = gtk_tree_view_get_selection (GTK_TREE_VIEW (disk_data->tree_v));
387 gtk_tree_selection_set_mode (disk_data->select_c, GTK_SELECTION_SINGLE);
389 gtk_container_add (GTK_CONTAINER (disk_data->scroll_win), disk_data->tree_v);
391 disk_data->hbox_v = gtk_hbox_new(0, 0);
392 gtk_box_pack_start(GTK_BOX(disk_data->hbox_v), disk_data->scroll_win, TRUE, TRUE, 0);
394 gtk_widget_show(disk_data->hbox_v);
395 gtk_widget_show(disk_data->tree_v);
398 g_disk_data_list = g_slist_append(g_disk_data_list, disk_data);
399 g_object_set_data_full(G_OBJECT(disk_data->hbox_v),
402 (GDestroyNotify)gui_disperformance_free);
404 request_event(disk_data);
410 * For each trace in the traceset, this function:
411 * - calls lttv_trace_find_hook() & registers a hook function to event_by_id_hooks
412 * - registers a callback function to each hook
413 * - calls lttvwindow_events_request() to request data in a specific
414 * time interval to the main window
417 static void request_event(DiskPerformanceData *disk_performance)
419 guint i, k, l, nb_trace;
429 LttvTraceHookByFacility *thf;
431 LttvTracesetContext *tsc = lttvwindow_get_traceset_context(disk_performance->tab);
432 /* Get the traceset */
433 LttvTraceset *traceset = tsc->ts;
435 nb_trace = lttv_traceset_number(traceset);
437 //for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
438 for(i = 0 ; i < nb_trace ; i++) {
439 EventsRequest *events_request = g_new(EventsRequest, 1);
441 hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
443 hooks = g_array_set_size(hooks, 2);
445 /* Get a trace state */
446 ts = (LttvTraceState *)tsc->traces[i];
448 disk_performance->event_by_id_hooks = lttv_hooks_by_id_new();
449 /* Register event_by_id_hooks with a callback function */
450 ret = lttv_trace_find_hook(ts->parent.t,
451 LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_READ,
455 &g_array_index(hooks, LttvTraceHook, 0));
457 ret = lttv_trace_find_hook(ts->parent.t,
458 LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_WRITE,
460 block_write_callback,
462 &g_array_index(hooks, LttvTraceHook, 1));
466 /*iterate through the facility list*/
467 for(k = 0 ; k < hooks->len; k++)
469 hook = &g_array_index(hooks, LttvTraceHook, k);
470 for(l=0; l<hook->fac_list->len; l++)
472 thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l);
473 lttv_hooks_add(lttv_hooks_by_id_find(disk_performance->event_by_id_hooks, thf->id),
481 disk_performance->hooks_trace_after = lttv_hooks_new();
482 /* Registers a hook function */
483 lttv_hooks_add(disk_performance->hooks_trace_after, disk_show, disk_performance, LTTV_PRIO_DEFAULT);
485 disk_performance->hooks_trace_before = lttv_hooks_new();
486 /* Registers a hook function */
487 lttv_hooks_add(disk_performance->hooks_trace_before, trace_header, disk_performance, LTTV_PRIO_DEFAULT);
489 /* Initalize the EventsRequest structure */
490 events_request->owner = disk_performance;
491 events_request->viewer_data = disk_performance;
492 events_request->servicing = FALSE;
493 events_request->start_time = disk_performance->time_window.start_time;
494 events_request->start_position = NULL;
495 events_request->stop_flag = FALSE;
496 events_request->end_time = disk_performance->time_window.end_time;
497 events_request->num_events = G_MAXUINT;
498 events_request->end_position = NULL;
499 events_request->trace = i;
500 events_request->hooks = hooks;
501 events_request->before_chunk_traceset = NULL;
502 events_request->before_chunk_trace = disk_performance->hooks_trace_before;
503 events_request->before_chunk_tracefile= NULL;
504 events_request->event = NULL;
505 events_request->event_by_id = disk_performance->event_by_id_hooks;
506 events_request->after_chunk_tracefile = NULL;
507 events_request->after_chunk_trace = NULL;
508 events_request->after_chunk_traceset = NULL;
509 events_request->before_request = NULL;
510 events_request->after_request = disk_performance->hooks_trace_after;
512 lttvwindow_events_request(disk_performance->tab, events_request);
518 * This function is called whenever a read event occurs.
521 static gboolean block_read_callback(void *hook_data, void *call_data)
526 lttv_block block_read;
529 LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
530 LttvTracefileState *tfs = (LttvTracefileState *)call_data;
531 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
532 GArray *disk_array = disk_performance->disk_array;
533 e = ltt_tracefile_get_event(tfc->tf);
534 event_time = ltt_event_time(e);
535 cpu_id = ltt_event_cpu_id(e);
537 get_event_detail(e, &block_read);
538 diskname = major_minor_to_diskname(&block_read);
539 sum_data(diskname, block_read.size,LTTV_READ_OPERATION, disk_array);
545 * This function is called whenever a write event occurs.
548 static gboolean block_write_callback(void *hook_data, void *call_data)
553 lttv_block block_write;
555 LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
556 LttvTracefileState *tfs = (LttvTracefileState *)call_data;
557 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
558 GArray *disk_array = disk_performance->disk_array;
559 e = ltt_tracefile_get_event(tfc->tf);
560 event_time = ltt_event_time(e);
561 cpu_id = ltt_event_cpu_id(e);
563 get_event_detail(e, &block_write);
564 diskname = major_minor_to_diskname(&block_write);
565 sum_data(diskname, block_write.size,LTTV_WRITE_OPERATION, disk_array);
571 * This function extracts the major, minor and size
574 static void get_event_detail(LttEvent *e, lttv_block* disk_data)
577 LttEventType *event_type;
580 event_type = ltt_event_eventtype(e);
581 num_fields = ltt_eventtype_num_fields(event_type);
583 for(i = 0 ; i < num_fields ; i++)
585 element = ltt_eventtype_field(event_type,i);
589 disk_data->major_number = ltt_event_get_long_unsigned(e, element);
593 disk_data->minor_number = ltt_event_get_long_unsigned(e, element);
596 disk_data->size = ltt_event_get_long_unsigned(e, element);
607 * This function calculates: the number of operations, the total bytes read or written,
608 * the average number of bytes read or written by sec.
610 static void sum_data(char* diskname, guint size, enum operation_t operation, GArray *disk_array)
613 lttv_total_block data;
614 lttv_total_block *element;
616 gboolean notFound = FALSE;
618 memset ((void*)&data, 0,sizeof(lttv_total_block));
620 if(disk_array->len == NO_ITEMS){
621 strcpy(data.diskname, diskname);
622 if(operation == LTTV_READ_OPERATION){
623 data.total_bytes_read = size;
624 data.num_read_operations++;
627 data.total_bytes_written = size;
628 data.num_write_operations ++;
630 g_array_append_val (disk_array, data);
633 for(i = 0; i < disk_array->len; i++){
634 element = &g_array_index(disk_array,lttv_total_block,i);
635 if(strcmp(element->diskname,diskname) == 0){
636 if(operation == LTTV_READ_OPERATION){
637 element->num_read_operations++;
638 element->total_bytes_read += size;
641 element->num_write_operations ++;
642 element->total_bytes_written += size;
648 strcpy(data.diskname, diskname);
649 if(operation == LTTV_READ_OPERATION){
650 data.total_bytes_read = size;
651 data.num_read_operations ++;
654 data.total_bytes_written = size;
655 data.num_write_operations ++;
657 g_array_append_val (disk_array, data);
663 static void destroy()
665 g_info("Destroy diskPerformance");
666 g_slist_foreach(g_disk_data_list, disk_destroy_walk, NULL );
667 g_slist_free(g_disk_data_list);
669 lttvwindow_unregister_constructor(disk_performance);
674 * This function convert the major and minor number to the corresponding disk.
675 * Data taken from Documentation/devices.txt of the kernel tree.
677 static char * major_minor_to_diskname( lttv_block* disk_data)
679 switch(disk_data->major_number)
682 case 3: /* First MFM, RLL and IDE hard disk/CD-ROM interface */
683 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
685 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
689 case 22: /*Second IDE hard disk/CD-ROM interface */
690 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
692 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
696 case 33: /* Third IDE hard disk/CD-ROM interface */
697 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
699 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
703 case 34: /* Fourth IDE hard disk/CD-ROM interface */
704 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
706 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
710 case 56: /* Fifth IDE hard disk/CD-ROM interface */
711 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
713 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
717 case 57: /* Sixth IDE hard disk/CD-ROM interface */
718 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
720 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
724 case 88: /* Seventh IDE hard disk/CD-ROM interface */
725 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
727 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
731 case 89: /* Eighth IDE hard disk/CD-ROM interface */
732 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
734 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
738 case 90: /* Ninth IDE hard disk/CD-ROM interface */
739 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
741 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
745 case 91: /* Tenth IDE hard disk/CD-ROM interface */
746 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
748 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
753 case 8: /* SCSI disk devices */
754 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
755 return "/dev/sda"; // First SCSI disk whole disk
757 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
758 return "/dev/sdb";// Second SCSI disk whole disk
760 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
761 return "/dev/sdc";// Third SCSI disk whole disk
763 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
764 return "/dev/sdd";// Fourth SCSI disk whole disk
766 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
767 return "/dev/sde";// Fifth SCSI disk whole disk
769 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
770 return "/dev/sdf";// Sixth SCSI disk whole disk
772 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
773 return "/dev/sdg";// seventh SCSI disk whole disk
775 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
776 return "/dev/sdh";// eighth SCSI disk whole disk
778 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
779 return "/dev/sdi";// 9th SCSI disk whole disk
781 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
782 return "/dev/sdj";// 10th SCSI disk whole disk
784 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
785 return "/dev/sdk";// 11th SCSI disk whole disk
787 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
788 return "/dev/sdl";// 12th SCSI disk whole disk
790 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
791 return "/dev/sdm";// 13th SCSI disk whole disk
793 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
794 return "/dev/sdn";// 14th SCSI disk whole disk
796 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
797 return "/dev/sdo";// 15th SCSI disk whole disk
799 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
800 return "/dev/sdp";// 16th SCSI disk whole disk
803 case 65: /* SCSI disk devices */
804 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
807 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
810 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
813 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
816 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
819 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
822 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
825 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
828 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
831 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
834 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
837 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
840 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
843 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
846 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
849 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
853 case 66: /* SCSI disk devices */
854 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
857 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
860 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
863 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
866 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
869 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
872 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
875 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
878 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
881 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
884 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
887 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
890 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
893 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
896 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
899 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
904 case 67: /* SCSI disk devices */
905 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
908 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
911 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
914 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
917 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
920 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
923 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
926 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
929 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
932 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
935 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
938 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
941 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
944 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
947 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
950 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
954 case 68 : /* SCSI disk devices */
955 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
958 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
961 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
964 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
967 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
970 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
973 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
976 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
979 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
982 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
985 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
988 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
991 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
994 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
997 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1000 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1003 case 69 : /* SCSI disk devices */
1004 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1007 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1010 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1013 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1016 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1019 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1022 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1025 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1028 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1031 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1034 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1037 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1040 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1043 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1046 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1049 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1054 case 70 : /* SCSI disk devices */
1055 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1058 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1061 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1064 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1067 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1070 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1073 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1076 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1079 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1082 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1085 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1088 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1091 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1094 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1097 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1100 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1104 case 71: /* SCSI disk devices */
1105 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1108 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1111 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1114 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1117 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1120 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1123 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1126 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1129 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1132 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1135 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1138 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1141 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1144 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1147 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1150 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1154 case 128: /* SCSI disk devices */
1155 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1158 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1161 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1164 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1167 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1170 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1173 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1176 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1179 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1182 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1185 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1188 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1191 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1194 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1197 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1200 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1204 case 129: /* SCSI disk devices */
1205 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1208 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1211 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1214 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1217 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1220 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1223 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1226 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1229 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1232 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1235 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1238 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1241 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1244 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1247 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1250 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1253 /*USB block devices*/
1255 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 8))
1257 if( (disk_data->minor_number >= 8) && (disk_data->minor_number < 16))
1259 if( (disk_data->minor_number >= 16) && (disk_data->minor_number < 24))
1267 LTTV_MODULE("diskperformance", "disk info view", \
1268 "Produce disk I/O performance", \
1269 init, destroy, "lttvwindow")