graph of modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux