Hello,

I wrote a bit of Perl to build dynamically the graph of modules' dependences

As sysadmin, I think it would be nice to have it on every Linux

Bellow an example of result and the code

Best regards

Gaƫl

                           +-------------------+     +-------------------+
                           |     backlight     | --> |       video       |
                           +-------------------+     +-------------------+

                                                       
+------------------------------------------------+
                                                       |                        
                        v
                           +-------------------+     +-------------------+     
+----------------+     +---------+     +-----+     +------+
                           |     configfs      | --> | ocfs2_nodemanager | --> 
|   ocfs2_dlm    | --> |  ocfs2  | <-- | jbd | --> | ext3 |
                           +-------------------+     +-------------------+     
+----------------+     +---------+     +-----+     +------+
                                                       |                        
 |
                                                       |                        
 |
                                                       v                        
 |
                           +-------------------+     +-------------------+      
 |
                           |    crypto_api     |     |    ocfs2_dlmfs    | 
<-----+
                           +-------------------+     +-------------------+
                             |
                             |
                             v
                           +-------------------+     +-------------------+
                           |    xfrm_nalgo     | --> |       ipv6        |
                           +-------------------+     +-------------------+

  +--------------------------+
  |                          |
  |  +---------------+     +-------------------+     +-------------------+     
+----------------+
  |  |  dm_snapshot  | <-- |      dm_mod       | --> |   dm_multipath    | --> 
| dm_round_robin |
  |  +---------------+     +-------------------+     +-------------------+     
+----------------+
  |                          |
  |                          |
  |                          v
  |                        +-------------------+
  |                        |     dm_mirror     |
  |                        +-------------------+
  |                        +-------------------+
  +----------------------> |      dm_zero      |
                           +-------------------+
                           +-------------------+     +-------------------+     
+----------------+
                           |     i2c_core      | --> |      i2c_ec       | --> 
|      sbs       |
                           +-------------------+     +-------------------+     
+----------------+
     +---------------+     +-------------------+     +-------------------+     
+----------------+
     |    sd_mod     | <-- |                   | --> |      libata       | --> 
|    ata_piix    |
     +---------------+     |                   |     +-------------------+     
+----------------+
                           |                   |
  +----------------------- |     scsi_mod      |
  |                        |                   |
  |  +---------------+     |                   |     +-------------------+
  |  |      sg       | <-- |                   | --> |       cciss       |
  |  +---------------+     +-------------------+     +-------------------+
  |                          |
  |                          +-------------------------+
  |                                                    v
  |                        +-------------------+     +-------------------+
  +----------------------> | scsi_transport_fc | --> |      qla2xxx      |
                           +-------------------+     +-------------------+
     +---------------+     +-------------------+     +-------------------+     
+----------------+     +---------+
     |    nfs_acl    | <-- |      sunrpc       | --> |       lockd       | --> 
|                | <-- | fscache |
     +---------------+     +-------------------+     +-------------------+     
|                |     +---------+
       |                     |                                                 
|                |
       |                     +-----------------------------------------------> 
|      nfs       |
       |                                                                       
|                |
       |                                                                       
|                |
       +---------------------------------------------------------------------> 
|                |
                                                                               
+----------------+
                           +-------------------+     +-------------------+
                           |       cdrom       | --> |      ide_cd       |
                           +-------------------+     +-------------------+
                           +-------------------+     +-------------------+
                           |      edac_mc      | --> |    i5000_edac     |
                           +-------------------+     +-------------------+
     +---------------+     +-------------------+     +-------------------+
     | ipmi_watchdog | <-- |  ipmi_msghandler  | --> |   ipmi_devintf    |
     +---------------+     +-------------------+     +-------------------+
                             |
                             |
                             v
                           +-------------------+
                           |      ipmi_si      |
                           +-------------------+
                           +-------------------+     +-------------------+
                           |      parport      | --> |        lp         |
                           +-------------------+     +-------------------+
                             |
                             |
                             v
                           +-------------------+
                           |    parport_pc     |
                           +-------------------+

#!/usr/bin/perl

use strict;
use Graph::Easy;

my @usedby;
my $g = Graph::Easy->new();

my $commande="lsmod";
open SORTIE, "$commande |" or die "impossible to duplicate the process : $!";
my $head = <SORTIE>;
while (my $ligne = <SORTIE>){
  my ($module,$size,$numused,$user) = split /\n| [ ]*/,$ligne;
  if ($user ne "") {
    my @users = split /,/,$user;
    my $use;
    foreach $use ( @users ){
        $g->add_edge($module,$use);
    }
  }
}

print $g->as_ascii();
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to