[padb] r411 committed - Add "cmdline" as an option for the proc-summary data. Differs from...

padb at googlecode.com padb at googlecode.com
Mon Nov 8 18:14:28 GMT 2010


Revision: 411
Author: apittman at gmail.com
Date: Mon Nov  8 10:13:19 2010
Log: Add "cmdline" as an option for the proc-summary data.  Differs from
command in that it shows command line options as well.

http://code.google.com/p/padb/source/detail?r=411

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Sat Nov  6 16:21:44 2010
+++ /trunk/src/padb	Mon Nov  8 10:13:19 2010
@@ -8017,6 +8017,20 @@
      }
      return;
  }
+
+sub show_task_cmdline {
+    my ( $vp, $dir ) = @_;
+
+    local $/ = "\0";
+    open my $FD, '<', "$dir/cmdline" or return;
+    my @args;
+    while (<$FD>) {
+        chomp;
+        push @args, $_;
+    }
+    proc_output( $vp, 'cmdline', "@args" );
+    return;
+}

  sub show_task_dir {
      my ( $carg, $vp, $pid, $dir ) = @_;
@@ -8030,6 +8044,9 @@
          show_task_file( $vp, "$dir/status" );
          show_task_file( $vp, "$dir/wchan", 'wchan' );
          show_task_file( $vp, "$dir/stat", 'stat' );
+
+        show_task_cmdline( $vp, $dir );
+
          if ( $carg->{proc_shows_stat} ) {
              show_task_stat_file( $vp, "$dir/stat" );
          }




More information about the padb-devel mailing list