diff options
Diffstat (limited to 'Documentation/trace/postprocess')
| -rw-r--r-- | Documentation/trace/postprocess/trace-pagealloc-postprocess.pl | 20 | ||||
| -rw-r--r-- | Documentation/trace/postprocess/trace-vmscan-postprocess.pl | 43 | 
2 files changed, 31 insertions, 32 deletions
diff --git a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl index 7df50e8cf4d..0a120aae33c 100644 --- a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl +++ b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl @@ -17,8 +17,8 @@ use Getopt::Long;  # Tracepoint events  use constant MM_PAGE_ALLOC		=> 1; -use constant MM_PAGE_FREE_DIRECT 	=> 2; -use constant MM_PAGEVEC_FREE		=> 3; +use constant MM_PAGE_FREE		=> 2; +use constant MM_PAGE_FREE_BATCHED	=> 3;  use constant MM_PAGE_PCPU_DRAIN		=> 4;  use constant MM_PAGE_ALLOC_ZONE_LOCKED	=> 5;  use constant MM_PAGE_ALLOC_EXTFRAG	=> 6; @@ -223,10 +223,10 @@ EVENT_PROCESS:  		# Perl Switch() sucks majorly  		if ($tracepoint eq "mm_page_alloc") {  			$perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++; -		} elsif ($tracepoint eq "mm_page_free_direct") { -			$perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}++; -		} elsif ($tracepoint eq "mm_pagevec_free") { -			$perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}++; +		} elsif ($tracepoint eq "mm_page_free") { +			$perprocesspid{$process_pid}->{MM_PAGE_FREE}++ +		} elsif ($tracepoint eq "mm_page_free_batched") { +			$perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED}++;  		} elsif ($tracepoint eq "mm_page_pcpu_drain") {  			$perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++;  			$perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++; @@ -336,8 +336,8 @@ sub dump_stats {  			$process_pid,  			$stats{$process_pid}->{MM_PAGE_ALLOC},  			$stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}, -			$stats{$process_pid}->{MM_PAGE_FREE_DIRECT}, -			$stats{$process_pid}->{MM_PAGEVEC_FREE}, +			$stats{$process_pid}->{MM_PAGE_FREE}, +			$stats{$process_pid}->{MM_PAGE_FREE_BATCHED},  			$stats{$process_pid}->{MM_PAGE_PCPU_DRAIN},  			$stats{$process_pid}->{HIGH_PCPU_DRAINS},  			$stats{$process_pid}->{HIGH_PCPU_REFILLS}, @@ -364,8 +364,8 @@ sub aggregate_perprocesspid() {  		$perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC};  		$perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}; -		$perprocess{$process}->{MM_PAGE_FREE_DIRECT} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}; -		$perprocess{$process}->{MM_PAGEVEC_FREE} += $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}; +		$perprocess{$process}->{MM_PAGE_FREE} += $perprocesspid{$process_pid}->{MM_PAGE_FREE}; +		$perprocess{$process}->{MM_PAGE_FREE_BATCHED} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED};  		$perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN};  		$perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS};  		$perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS}; diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl index b3e73ddb156..78c9a7b2b58 100644 --- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl @@ -47,7 +47,6 @@ use constant HIGH_KSWAPD_REWAKEUP		=> 21;  use constant HIGH_NR_SCANNED			=> 22;  use constant HIGH_NR_TAKEN			=> 23;  use constant HIGH_NR_RECLAIMED			=> 24; -use constant HIGH_NR_CONTIG_DIRTY		=> 25;  my %perprocesspid;  my %perprocess; @@ -105,7 +104,7 @@ my $regex_direct_end_default = 'nr_reclaimed=([0-9]*)';  my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)';  my $regex_kswapd_sleep_default = 'nid=([0-9]*)';  my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; -my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; +my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) file=([0-9]*)';  my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)';  my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)';  my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; @@ -123,7 +122,7 @@ my $regex_writepage;  # Static regex used. Specified like this for readability and for use with /o  #                      (process_pid)     (cpus      )   ( time  )   (tpoint    ) (details) -my $regex_traceevent = '\s*([a-zA-Z0-9-]*)\s*(\[[0-9]*\])\s*([0-9.]*):\s*([a-zA-Z_]*):\s*(.*)'; +my $regex_traceevent = '\s*([a-zA-Z0-9-]*)\s*(\[[0-9]*\])(\s*[dX.][Nnp.][Hhs.][0-9a-fA-F.]*|)\s*([0-9.]*):\s*([a-zA-Z_]*):\s*(.*)';  my $regex_statname = '[-0-9]*\s\((.*)\).*';  my $regex_statppid = '[-0-9]*\s\(.*\)\s[A-Za-z]\s([0-9]*).*'; @@ -200,7 +199,7 @@ $regex_lru_isolate = generate_traceevent_regex(  			$regex_lru_isolate_default,  			"isolate_mode", "order",  			"nr_requested", "nr_scanned", "nr_taken", -			"contig_taken", "contig_dirty", "contig_failed"); +			"file");  $regex_lru_shrink_inactive = generate_traceevent_regex(  			"vmscan/mm_vmscan_lru_shrink_inactive",  			$regex_lru_shrink_inactive_default, @@ -270,8 +269,8 @@ EVENT_PROCESS:  	while ($traceevent = <STDIN>) {  		if ($traceevent =~ /$regex_traceevent/o) {  			$process_pid = $1; -			$timestamp = $3; -			$tracepoint = $4; +			$timestamp = $4; +			$tracepoint = $5;  			$process_pid =~ /(.*)-([0-9]*)$/;  			my $process = $1; @@ -299,7 +298,7 @@ EVENT_PROCESS:  			$perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}++;  			$perprocesspid{$process_pid}->{STATE_DIRECT_BEGIN} = $timestamp; -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_direct_begin/o) {  				print "WARNING: Failed to parse mm_vmscan_direct_reclaim_begin as expected\n";  				print "         $details\n"; @@ -322,7 +321,7 @@ EVENT_PROCESS:  				$perprocesspid{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index] = "$order-$latency";  			}  		} elsif ($tracepoint eq "mm_vmscan_kswapd_wake") { -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_kswapd_wake/o) {  				print "WARNING: Failed to parse mm_vmscan_kswapd_wake as expected\n";  				print "         $details\n"; @@ -356,7 +355,7 @@ EVENT_PROCESS:  		} elsif ($tracepoint eq "mm_vmscan_wakeup_kswapd") {  			$perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}++; -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_wakeup_kswapd/o) {  				print "WARNING: Failed to parse mm_vmscan_wakeup_kswapd as expected\n";  				print "         $details\n"; @@ -366,19 +365,26 @@ EVENT_PROCESS:  			my $order = $3;  			$perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]++;  		} elsif ($tracepoint eq "mm_vmscan_lru_isolate") { -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_lru_isolate/o) {  				print "WARNING: Failed to parse mm_vmscan_lru_isolate as expected\n";  				print "         $details\n";  				print "         $regex_lru_isolate/o\n";  				next;  			} +			my $isolate_mode = $1;  			my $nr_scanned = $4; -			my $nr_contig_dirty = $7; -			$perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; -			$perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; + +			# To closer match vmstat scanning statistics, only count isolate_both +			# and isolate_inactive as scanning. isolate_active is rotation +			# isolate_inactive == 1 +			# isolate_active   == 2 +			# isolate_both     == 3 +			if ($isolate_mode != 2) { +				$perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; +			}  		} elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_lru_shrink_inactive/o) {  				print "WARNING: Failed to parse mm_vmscan_lru_shrink_inactive as expected\n";  				print "         $details\n"; @@ -388,7 +394,7 @@ EVENT_PROCESS:  			my $nr_reclaimed = $4;  			$perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED} += $nr_reclaimed;  		} elsif ($tracepoint eq "mm_vmscan_writepage") { -			$details = $5; +			$details = $6;  			if ($details !~ /$regex_writepage/o) {  				print "WARNING: Failed to parse mm_vmscan_writepage as expected\n";  				print "         $details\n"; @@ -530,13 +536,6 @@ sub dump_stats {  				}  			}  		} -		if ($stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}) { -			print "      "; -			my $count = $stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}; -			if ($count != 0) { -				print "contig-dirty=$count "; -			} -		}  		print "\n";  	}  | 
