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>
31 #include <ltt/trace.h>
32 #include <ltt/facility.h>
33 #include <lttv/module.h>
34 #include <lttv/hook.h>
35 #include <lttv/tracecontext.h>
36 #include <lttv/state.h>
37 #include <lttv/filter.h>
38 #include <lttvwindow/lttvwindow.h>
39 #include <lttvwindow/lttv_plugin_tab.h>
42 #include "hDiskPerformanceInsert.xpm"
45 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
46 #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
47 // fixed #define TRACE_NUMBER 0
62 LTTV_READ_OPERATION = 1,
66 typedef struct _DiskPerformanceData {
72 LttvHooks * hooks_trace_after;
74 LttvHooks * hooks_trace_before;
76 TimeWindow time_window;
78 GtkWidget * scroll_win;
80 /* Model containing list data */
81 GtkListStore *store_m;
85 /* Widget to display the data in a columned list */
88 /* Selection handler */
89 GtkTreeSelection *select_c;
93 LttvHooksById * event_by_id_hooks;
95 } DiskPerformanceData;
98 typedef struct _lttv_block {
104 typedef struct _lttv_total_block {
106 guint64 total_bytes_read;
107 guint num_read_operations;
108 guint64 total_bytes_written;
109 guint num_write_operations;
113 GSList *g_disk_data_list = NULL ;
118 GQuark LTT_FACILITY_BLOCK;
121 GQuark LTT_EVENT_BLOCK_READ;
122 GQuark LTT_EVENT_BLOCK_WRITE;
124 static DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab);
125 static void disk_destroy_walk(gpointer data, gpointer user_data);
126 static gboolean disk_show(void *hook_data, void *call_data);
127 static gboolean trace_header(void *hook_data, void *call_data);
128 static gboolean disk_update_time_window(void * hook_data, void * call_data);
129 static void request_event( DiskPerformanceData *disk_performance);
130 void gui_disperformance_free(DiskPerformanceData *event_viewer_data);
131 static void get_event_detail(LttEvent *e, lttv_block* disk_data);
132 static char * major_minor_to_diskname( lttv_block* disk_data);
133 static void sum_data(char* diskname, guint size, enum operation_t opt, GArray *disk_array);
134 static GtkWidget *disk_performance(LttvPlugin *plugin);
136 static gboolean block_read_callback(void *hook_data, void *call_data);
138 static gboolean block_write_callback(void *hook_data, void *call_data);
141 static gboolean disk_show(void *hook_data, void *call_data){
144 lttv_total_block element;
146 LttTime time_interval;
147 guint64 time_interval_64;
148 guint64 temp_variable;
149 guint64 bytes_read_per_sec, bytes_written_per_sec;
150 g_info(" diskperformance: disk_show() \n");
151 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
152 GArray *disk_array = disk_performance->disk_array;
153 time_interval = ltt_time_sub(disk_performance->time_window.end_time, disk_performance->time_window.start_time);
155 time_interval_64 = time_interval.tv_sec;
156 time_interval_64 *= NANOSECONDS_PER_SECOND;
157 time_interval_64 += time_interval.tv_nsec;
158 gtk_list_store_clear(disk_performance->store_m);
159 for(i = 0; i < disk_array->len; i++){
161 element = g_array_index(disk_array,lttv_total_block,i);
162 temp_variable = element.total_bytes_read * NANOSECONDS_PER_SECOND;
163 bytes_read_per_sec = (guint64) temp_variable / time_interval_64;
165 temp_variable = element.total_bytes_written * NANOSECONDS_PER_SECOND;
166 bytes_written_per_sec = (guint64) temp_variable / time_interval_64;
168 gtk_list_store_append (disk_performance->store_m, &iter);
169 gtk_list_store_set (disk_performance->store_m, &iter,
170 DISKNAME_COLUMN, element.diskname,
171 BYTES_RD_COLUMN, element.total_bytes_read,
172 BYTES_RD_SEC_COLUMN,bytes_read_per_sec,
173 NUM_RD_COLUMN, element.num_read_operations,
174 BYTES_WR_COLUMN, element.total_bytes_written,
175 BYTES_WR_SEC_COLUMN, bytes_written_per_sec,
176 NUM_WR_COLUMN, element.num_write_operations,
180 if(disk_performance->disk_array->len)
181 g_array_remove_range (disk_performance->disk_array,0,disk_performance->disk_array->len);
185 static gboolean trace_header(void *hook_data, void *call_data){
190 static gboolean disk_update_time_window(void * hook_data, void * call_data){
192 DiskPerformanceData *disk_performance = (DiskPerformanceData *) hook_data;
193 const TimeWindowNotifyData *time_window_nofify_data = ((const TimeWindowNotifyData *)call_data);
194 disk_performance->time_window = *time_window_nofify_data->new_time_window;
195 Tab *tab = disk_performance->tab;
196 lttvwindow_events_request_remove_all(tab, disk_performance);
197 request_event( disk_performance);
203 void gui_disperformance_free(DiskPerformanceData *eventdata){
204 Tab *tab = eventdata->tab;
205 g_info("disperformance.c : gui_disperformance_free, %p", eventdata);
206 g_info("%p, %p", eventdata, tab);
209 g_array_free (eventdata->disk_array, TRUE);
211 lttvwindow_unregister_time_window_notify(tab,
212 disk_update_time_window,
215 lttvwindow_events_request_remove_all(eventdata->tab,
217 g_disk_data_list = g_slist_remove(g_disk_data_list, eventdata);
220 g_info("disperformance.c : gui_disperformance_free end, %p", eventdata);
228 void disk_destructor_full(DiskPerformanceData *disk_data)
231 if(GTK_IS_WIDGET(disk_data->hbox_v))
232 gtk_widget_destroy(disk_data->hbox_v);
236 static void disk_destroy_walk(gpointer data, gpointer user_data)
238 g_info("Walk destroy GUI disk performance Viewer");
239 disk_destructor_full((DiskPerformanceData*)data);
245 * This is the entry point of the viewer.
251 g_info("Init diskPerformance.c");
253 LTT_FACILITY_BLOCK = g_quark_from_string("block");
254 LTT_EVENT_BLOCK_READ = g_quark_from_string("read");
255 LTT_EVENT_BLOCK_WRITE = g_quark_from_string("write");
257 lttvwindow_register_constructor("diskperformance",
259 "Insert Disk Performance",
260 hDiskPerformanceInsert_xpm,
261 "Insert Disk Performance",
269 GtkWidget *disk_performance(LttvPlugin *plugin)
271 LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
272 DiskPerformanceData* disk_data = disk_performance_data(ptab);
274 return disk_data->hbox_v;
280 * This function initializes the Event Viewer functionnality through the
283 DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab)
286 GtkTreeViewColumn *column;
287 GtkCellRenderer *renderer;
288 DiskPerformanceData* disk_data = g_new(DiskPerformanceData,1) ;
290 g_info("enter disk_performance_data \n");
291 Tab *tab = ptab->tab;
292 disk_data->tab = tab;
293 disk_data->ptab = ptab;
294 disk_data->time_window = lttvwindow_get_time_window(tab);
296 disk_data->disk_array = g_array_new(FALSE, FALSE, sizeof(lttv_total_block ));
298 lttvwindow_register_time_window_notify(tab,
299 disk_update_time_window,
302 disk_data->scroll_win = gtk_scrolled_window_new (NULL, NULL);
303 gtk_widget_show (disk_data->scroll_win);
304 gtk_scrolled_window_set_policy(
305 GTK_SCROLLED_WINDOW(disk_data->scroll_win),
306 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
308 /* Create a model for storing the data list */
309 disk_data->store_m = gtk_list_store_new (
310 N_COLUMNS, /* Total number of columns */
311 G_TYPE_STRING, /* Diskname */
312 G_TYPE_INT64, /* Bytes read */
313 G_TYPE_INT64, /* Bytes read/sec */
315 G_TYPE_INT64, /* bytes written */
316 G_TYPE_INT64, /* bytes written/sec */
320 disk_data->tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (disk_data->store_m));
322 g_object_unref (G_OBJECT (disk_data->store_m));
324 renderer = gtk_cell_renderer_text_new ();
326 column = gtk_tree_view_column_new_with_attributes ("DiskName",
328 "text", DISKNAME_COLUMN,
330 gtk_tree_view_column_set_alignment (column, 0.0);
331 gtk_tree_view_column_set_fixed_width (column, 45);
332 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
334 renderer = gtk_cell_renderer_text_new ();
335 column = gtk_tree_view_column_new_with_attributes ("BytesRead",
337 "text", BYTES_RD_COLUMN,
339 gtk_tree_view_column_set_alignment (column, 0.0);
340 gtk_tree_view_column_set_fixed_width (column, 220);
341 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
343 renderer = gtk_cell_renderer_text_new ();
344 column = gtk_tree_view_column_new_with_attributes ("BytesRead/sec",
346 "text", BYTES_RD_SEC_COLUMN,
348 gtk_tree_view_column_set_alignment (column, 1.0);
349 gtk_tree_view_column_set_fixed_width (column, 220);
350 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
352 renderer = gtk_cell_renderer_text_new ();
353 column = gtk_tree_view_column_new_with_attributes ("NumReadOperations",
355 "text",NUM_RD_COLUMN,
357 gtk_tree_view_column_set_alignment (column, 1.0);
358 gtk_tree_view_column_set_fixed_width (column, 220);
359 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
361 renderer = gtk_cell_renderer_text_new ();
362 column = gtk_tree_view_column_new_with_attributes ("BytesWritten",
364 "text", BYTES_WR_COLUMN,
366 gtk_tree_view_column_set_alignment (column, 0.0);
367 gtk_tree_view_column_set_fixed_width (column, 145);
368 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
370 renderer = gtk_cell_renderer_text_new ();
371 column = gtk_tree_view_column_new_with_attributes ("BytesWritten/sec",
373 "text", BYTES_WR_SEC_COLUMN,
375 gtk_tree_view_column_set_alignment (column, 1.0);
376 gtk_tree_view_column_set_fixed_width (column, 220);
377 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
379 renderer = gtk_cell_renderer_text_new ();
380 column = gtk_tree_view_column_new_with_attributes ("NumWriteOperations",
382 "text",NUM_WR_COLUMN,
384 gtk_tree_view_column_set_alignment (column, 0.0);
385 gtk_tree_view_column_set_fixed_width (column, 145);
386 gtk_tree_view_append_column (GTK_TREE_VIEW (disk_data->tree_v), column);
388 disk_data->select_c = gtk_tree_view_get_selection (GTK_TREE_VIEW (disk_data->tree_v));
389 gtk_tree_selection_set_mode (disk_data->select_c, GTK_SELECTION_SINGLE);
391 gtk_container_add (GTK_CONTAINER (disk_data->scroll_win), disk_data->tree_v);
393 disk_data->hbox_v = gtk_hbox_new(0, 0);
394 gtk_box_pack_start(GTK_BOX(disk_data->hbox_v), disk_data->scroll_win, TRUE, TRUE, 0);
396 gtk_widget_show(disk_data->hbox_v);
397 gtk_widget_show(disk_data->tree_v);
400 g_disk_data_list = g_slist_append(g_disk_data_list, disk_data);
401 g_object_set_data_full(G_OBJECT(disk_data->hbox_v),
404 (GDestroyNotify)gui_disperformance_free);
406 request_event(disk_data);
412 * For each trace in the traceset, this function:
413 * - calls lttv_trace_find_hook() & registers a hook function to event_by_id_hooks
414 * - registers a callback function to each hook
415 * - calls lttvwindow_events_request() to request data in a specific
416 * time interval to the main window
419 static void request_event(DiskPerformanceData *disk_performance)
421 guint i, k, l, nb_trace;
431 LttvTraceHookByFacility *thf;
433 LttvTracesetContext *tsc = lttvwindow_get_traceset_context(disk_performance->tab);
434 /* Get the traceset */
435 LttvTraceset *traceset = tsc->ts;
437 nb_trace = lttv_traceset_number(traceset);
439 //for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
440 for(i = 0 ; i < nb_trace ; i++) {
441 EventsRequest *events_request = g_new(EventsRequest, 1);
443 hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
445 hooks = g_array_set_size(hooks, 2);
447 /* Get a trace state */
448 ts = (LttvTraceState *)tsc->traces[i];
450 disk_performance->event_by_id_hooks = lttv_hooks_by_id_new();
451 /* Register event_by_id_hooks with a callback function */
452 ret = lttv_trace_find_hook(ts->parent.t,
453 LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_READ,
457 &g_array_index(hooks, LttvTraceHook, 0));
459 ret = lttv_trace_find_hook(ts->parent.t,
460 LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_WRITE,
462 block_write_callback,
464 &g_array_index(hooks, LttvTraceHook, 1));
468 /*iterate through the facility list*/
469 for(k = 0 ; k < hooks->len; k++)
471 hook = &g_array_index(hooks, LttvTraceHook, k);
472 for(l=0; l<hook->fac_list->len; l++)
474 thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l);
475 lttv_hooks_add(lttv_hooks_by_id_find(disk_performance->event_by_id_hooks, thf->id),
483 disk_performance->hooks_trace_after = lttv_hooks_new();
484 /* Registers a hook function */
485 lttv_hooks_add(disk_performance->hooks_trace_after, disk_show, disk_performance, LTTV_PRIO_DEFAULT);
487 disk_performance->hooks_trace_before = lttv_hooks_new();
488 /* Registers a hook function */
489 lttv_hooks_add(disk_performance->hooks_trace_before, trace_header, disk_performance, LTTV_PRIO_DEFAULT);
491 /* Initalize the EventsRequest structure */
492 events_request->owner = disk_performance;
493 events_request->viewer_data = disk_performance;
494 events_request->servicing = FALSE;
495 events_request->start_time = disk_performance->time_window.start_time;
496 events_request->start_position = NULL;
497 events_request->stop_flag = FALSE;
498 events_request->end_time = disk_performance->time_window.end_time;
499 events_request->num_events = G_MAXUINT;
500 events_request->end_position = NULL;
501 events_request->trace = i;
502 events_request->hooks = hooks;
503 events_request->before_chunk_traceset = NULL;
504 events_request->before_chunk_trace = disk_performance->hooks_trace_before;
505 events_request->before_chunk_tracefile= NULL;
506 events_request->event = NULL;
507 events_request->event_by_id = disk_performance->event_by_id_hooks;
508 events_request->after_chunk_tracefile = NULL;
509 events_request->after_chunk_trace = NULL;
510 events_request->after_chunk_traceset = NULL;
511 events_request->before_request = NULL;
512 events_request->after_request = disk_performance->hooks_trace_after;
514 lttvwindow_events_request(disk_performance->tab, events_request);
520 * This function is called whenever a read event occurs.
523 static gboolean block_read_callback(void *hook_data, void *call_data)
528 lttv_block block_read;
531 LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
532 LttvTracefileState *tfs = (LttvTracefileState *)call_data;
533 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
534 GArray *disk_array = disk_performance->disk_array;
535 e = ltt_tracefile_get_event(tfc->tf);
536 event_time = ltt_event_time(e);
537 cpu_id = ltt_event_cpu_id(e);
539 get_event_detail(e, &block_read);
540 diskname = major_minor_to_diskname(&block_read);
541 sum_data(diskname, block_read.size,LTTV_READ_OPERATION, disk_array);
547 * This function is called whenever a write event occurs.
550 static gboolean block_write_callback(void *hook_data, void *call_data)
555 lttv_block block_write;
557 LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
558 LttvTracefileState *tfs = (LttvTracefileState *)call_data;
559 DiskPerformanceData *disk_performance = (DiskPerformanceData *)hook_data;
560 GArray *disk_array = disk_performance->disk_array;
561 e = ltt_tracefile_get_event(tfc->tf);
562 event_time = ltt_event_time(e);
563 cpu_id = ltt_event_cpu_id(e);
565 get_event_detail(e, &block_write);
566 diskname = major_minor_to_diskname(&block_write);
567 sum_data(diskname, block_write.size,LTTV_WRITE_OPERATION, disk_array);
573 * This function extracts the major, minor and size
576 static void get_event_detail(LttEvent *e, lttv_block* disk_data)
579 LttEventType *event_type;
582 event_type = ltt_event_eventtype(e);
583 num_fields = ltt_eventtype_num_fields(event_type);
585 for(i = 0 ; i < num_fields ; i++)
587 element = ltt_eventtype_field(event_type,i);
591 disk_data->major_number = ltt_event_get_long_unsigned(e, element);
595 disk_data->minor_number = ltt_event_get_long_unsigned(e, element);
598 disk_data->size = ltt_event_get_long_unsigned(e, element);
609 * This function calculates: the number of operations, the total bytes read or written,
610 * the average number of bytes read or written by sec.
612 static void sum_data(char* diskname, guint size, enum operation_t operation, GArray *disk_array)
615 lttv_total_block data;
616 lttv_total_block *element;
618 gboolean notFound = FALSE;
620 memset ((void*)&data, 0,sizeof(lttv_total_block));
622 if(disk_array->len == NO_ITEMS){
623 strcpy(data.diskname, diskname);
624 if(operation == LTTV_READ_OPERATION){
625 data.total_bytes_read = size;
626 data.num_read_operations++;
629 data.total_bytes_written = size;
630 data.num_write_operations ++;
632 g_array_append_val (disk_array, data);
635 for(i = 0; i < disk_array->len; i++){
636 element = &g_array_index(disk_array,lttv_total_block,i);
637 if(strcmp(element->diskname,diskname) == 0){
638 if(operation == LTTV_READ_OPERATION){
639 element->num_read_operations++;
640 element->total_bytes_read += size;
643 element->num_write_operations ++;
644 element->total_bytes_written += size;
650 strcpy(data.diskname, diskname);
651 if(operation == LTTV_READ_OPERATION){
652 data.total_bytes_read = size;
653 data.num_read_operations ++;
656 data.total_bytes_written = size;
657 data.num_write_operations ++;
659 g_array_append_val (disk_array, data);
665 static void destroy()
667 g_info("Destroy diskPerformance");
668 g_slist_foreach(g_disk_data_list, disk_destroy_walk, NULL );
669 g_slist_free(g_disk_data_list);
671 lttvwindow_unregister_constructor(disk_performance);
676 * This function convert the major and minor number to the corresponding disk.
677 * Data taken from Documentation/devices.txt of the kernel tree.
679 static char * major_minor_to_diskname( lttv_block* disk_data)
681 switch(disk_data->major_number)
684 case 3: /* First MFM, RLL and IDE hard disk/CD-ROM interface */
685 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
687 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
691 case 22: /*Second IDE hard disk/CD-ROM interface */
692 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
694 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
698 case 33: /* Third IDE hard disk/CD-ROM interface */
699 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
701 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
705 case 34: /* Fourth IDE hard disk/CD-ROM interface */
706 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
708 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
712 case 56: /* Fifth IDE hard disk/CD-ROM interface */
713 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
715 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
719 case 57: /* Sixth IDE hard disk/CD-ROM interface */
720 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
722 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
726 case 88: /* Seventh IDE hard disk/CD-ROM interface */
727 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
729 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
733 case 89: /* Eighth IDE hard disk/CD-ROM interface */
734 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
736 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
740 case 90: /* Ninth IDE hard disk/CD-ROM interface */
741 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
743 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
747 case 91: /* Tenth IDE hard disk/CD-ROM interface */
748 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
750 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
755 case 8: /* SCSI disk devices */
756 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
757 return "/dev/sda"; // First SCSI disk whole disk
759 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
760 return "/dev/sdb";// Second SCSI disk whole disk
762 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
763 return "/dev/sdc";// Third SCSI disk whole disk
765 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
766 return "/dev/sdd";// Fourth SCSI disk whole disk
768 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
769 return "/dev/sde";// Fifth SCSI disk whole disk
771 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
772 return "/dev/sdf";// Sixth SCSI disk whole disk
774 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
775 return "/dev/sdg";// seventh SCSI disk whole disk
777 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
778 return "/dev/sdh";// eighth SCSI disk whole disk
780 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
781 return "/dev/sdi";// 9th SCSI disk whole disk
783 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
784 return "/dev/sdj";// 10th SCSI disk whole disk
786 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
787 return "/dev/sdk";// 11th SCSI disk whole disk
789 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
790 return "/dev/sdl";// 12th SCSI disk whole disk
792 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
793 return "/dev/sdm";// 13th SCSI disk whole disk
795 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
796 return "/dev/sdn";// 14th SCSI disk whole disk
798 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
799 return "/dev/sdo";// 15th SCSI disk whole disk
801 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
802 return "/dev/sdp";// 16th SCSI disk whole disk
805 case 65: /* SCSI disk devices */
806 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
809 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
812 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
815 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
818 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
821 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
824 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
827 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
830 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
833 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
836 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
839 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
842 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
845 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
848 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
851 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
855 case 66: /* SCSI disk devices */
856 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
859 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
862 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
865 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
868 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
871 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
874 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
877 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
880 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
883 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
886 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
889 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
892 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
895 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
898 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
901 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
906 case 67: /* SCSI disk devices */
907 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
910 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
913 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
916 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
919 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
922 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
925 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
928 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
931 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
934 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
937 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
940 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
943 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
946 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
949 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
952 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
956 case 68 : /* SCSI disk devices */
957 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
960 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
963 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
966 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
969 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
972 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
975 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
978 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
981 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
984 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
987 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
990 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
993 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
996 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
999 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1002 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1005 case 69 : /* SCSI disk devices */
1006 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1009 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1012 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1015 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1018 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1021 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1024 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1027 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1030 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1033 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1036 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1039 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1042 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1045 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1048 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1051 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1056 case 70 : /* SCSI disk devices */
1057 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1060 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1063 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1066 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1069 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1072 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1075 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1078 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1081 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1084 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1087 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1090 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1093 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1096 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1099 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1102 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1106 case 71: /* SCSI disk devices */
1107 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1110 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1113 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1116 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1119 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1122 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1125 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1128 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1131 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1134 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1137 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1140 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1143 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1146 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1149 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1152 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1156 case 128: /* SCSI disk devices */
1157 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1160 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1163 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1166 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1169 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1172 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1175 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1178 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1181 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1184 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1187 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1190 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1193 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1196 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1199 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1202 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1206 case 129: /* SCSI disk devices */
1207 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
1210 if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
1213 if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
1216 if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
1219 if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
1222 if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
1225 if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
1228 if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
1231 if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
1234 if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
1237 if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
1240 if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
1243 if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
1246 if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
1249 if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
1252 if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
1255 /*USB block devices*/
1257 if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 8))
1259 if( (disk_data->minor_number >= 8) && (disk_data->minor_number < 16))
1261 if( (disk_data->minor_number >= 16) && (disk_data->minor_number < 24))
1269 LTTV_MODULE("diskperformance", "disk info view", \
1270 "Produce disk I/O performance", \
1271 init, destroy, "lttvwindow")