Commit 83121580 authored by Vlastimil Babka's avatar Vlastimil Babka Committed by Andrew Morton

trace-vmscan-postprocess: sync with tracepoints updates

The script has fallen behind tracepoint changes for a while, fix it up.

Most changes are mechanical (renames, removal of tracepoint parameters
that are not used by the script).  More notable change involves
mm_vmscan_lru_isolate which is relying on the isolate_mode to determine if
the inactive list is being scanned.  However the parameter currently only
indicates ISOLATE_UNMAPPED.  We can use the lru parameter instead to
determine which list is scanned, and stop checking isolate_mode.

Link: https://lkml.kernel.org/r/20230914131637.12204-3-vbabka@suse.czSigned-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 93b13eca
...@@ -107,14 +107,14 @@ GetOptions( ...@@ -107,14 +107,14 @@ GetOptions(
); );
# Defaults for dynamically discovered regex's # Defaults for dynamically discovered regex's
my $regex_direct_begin_default = 'order=([0-9]*) may_writepage=([0-9]*) gfp_flags=([A-Z_|]*)'; my $regex_direct_begin_default = 'order=([0-9]*) gfp_flags=([A-Z_|]*)';
my $regex_direct_end_default = 'nr_reclaimed=([0-9]*)'; my $regex_direct_end_default = 'nr_reclaimed=([0-9]*)';
my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)';
my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; my $regex_kswapd_sleep_default = 'nid=([0-9]*)';
my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*) gfp_flags=([A-Z_|]*)'; my $regex_wakeup_kswapd_default = 'nid=([0-9]*) order=([0-9]*) gfp_flags=([A-Z_|]*)';
my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) classzone_idx=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_skipped=([0-9]*) nr_taken=([0-9]*) lru=([a-z_]*)'; my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) classzone=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_skipped=([0-9]*) nr_taken=([0-9]*) lru=([a-z_]*)';
my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) nr_dirty=([0-9]*) nr_writeback=([0-9]*) nr_congested=([0-9]*) nr_immediate=([0-9]*) nr_activate_anon=([0-9]*) nr_activate_file=([0-9]*) nr_ref_keep=([0-9]*) nr_unmap_fail=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) nr_dirty=([0-9]*) nr_writeback=([0-9]*) nr_congested=([0-9]*) nr_immediate=([0-9]*) nr_activate_anon=([0-9]*) nr_activate_file=([0-9]*) nr_ref_keep=([0-9]*) nr_unmap_fail=([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_lru_shrink_active_default = 'lru=([A-Z_]*) nr_taken=([0-9]*) nr_active=([0-9]*) nr_deactivated=([0-9]*) nr_referenced=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)' ;
my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)';
# Dyanically discovered regex # Dyanically discovered regex
...@@ -184,8 +184,7 @@ sub generate_traceevent_regex { ...@@ -184,8 +184,7 @@ sub generate_traceevent_regex {
$regex_direct_begin = generate_traceevent_regex( $regex_direct_begin = generate_traceevent_regex(
"vmscan/mm_vmscan_direct_reclaim_begin", "vmscan/mm_vmscan_direct_reclaim_begin",
$regex_direct_begin_default, $regex_direct_begin_default,
"order", "may_writepage", "order", "gfp_flags");
"gfp_flags");
$regex_direct_end = generate_traceevent_regex( $regex_direct_end = generate_traceevent_regex(
"vmscan/mm_vmscan_direct_reclaim_end", "vmscan/mm_vmscan_direct_reclaim_end",
$regex_direct_end_default, $regex_direct_end_default,
...@@ -201,11 +200,11 @@ $regex_kswapd_sleep = generate_traceevent_regex( ...@@ -201,11 +200,11 @@ $regex_kswapd_sleep = generate_traceevent_regex(
$regex_wakeup_kswapd = generate_traceevent_regex( $regex_wakeup_kswapd = generate_traceevent_regex(
"vmscan/mm_vmscan_wakeup_kswapd", "vmscan/mm_vmscan_wakeup_kswapd",
$regex_wakeup_kswapd_default, $regex_wakeup_kswapd_default,
"nid", "zid", "order", "gfp_flags"); "nid", "order", "gfp_flags");
$regex_lru_isolate = generate_traceevent_regex( $regex_lru_isolate = generate_traceevent_regex(
"vmscan/mm_vmscan_lru_isolate", "vmscan/mm_vmscan_lru_isolate",
$regex_lru_isolate_default, $regex_lru_isolate_default,
"isolate_mode", "classzone_idx", "order", "isolate_mode", classzone", "order",
"nr_requested", "nr_scanned", "nr_skipped", "nr_taken", "nr_requested", "nr_scanned", "nr_skipped", "nr_taken",
"lru"); "lru");
$regex_lru_shrink_inactive = generate_traceevent_regex( $regex_lru_shrink_inactive = generate_traceevent_regex(
...@@ -218,11 +217,10 @@ $regex_lru_shrink_inactive = generate_traceevent_regex( ...@@ -218,11 +217,10 @@ $regex_lru_shrink_inactive = generate_traceevent_regex(
$regex_lru_shrink_active = generate_traceevent_regex( $regex_lru_shrink_active = generate_traceevent_regex(
"vmscan/mm_vmscan_lru_shrink_active", "vmscan/mm_vmscan_lru_shrink_active",
$regex_lru_shrink_active_default, $regex_lru_shrink_active_default,
"nid", "zid", "nid", "nr_taken", "nr_active", "nr_deactivated", "nr_referenced",
"lru", "priority", "flags");
"nr_scanned", "nr_rotated", "priority");
$regex_writepage = generate_traceevent_regex( $regex_writepage = generate_traceevent_regex(
"vmscan/mm_vmscan_writepage", "vmscan/mm_vmscan_write_folio",
$regex_writepage_default, $regex_writepage_default,
"page", "pfn", "flags"); "page", "pfn", "flags");
...@@ -371,7 +369,7 @@ EVENT_PROCESS: ...@@ -371,7 +369,7 @@ EVENT_PROCESS:
print " $regex_wakeup_kswapd\n"; print " $regex_wakeup_kswapd\n";
next; next;
} }
my $order = $3; my $order = $2;
$perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]++; $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]++;
} elsif ($tracepoint eq "mm_vmscan_lru_isolate") { } elsif ($tracepoint eq "mm_vmscan_lru_isolate") {
$details = $6; $details = $6;
...@@ -381,18 +379,14 @@ EVENT_PROCESS: ...@@ -381,18 +379,14 @@ EVENT_PROCESS:
print " $regex_lru_isolate/o\n"; print " $regex_lru_isolate/o\n";
next; next;
} }
my $isolate_mode = $1;
my $nr_scanned = $5; my $nr_scanned = $5;
my $file = $8; my $lru = $8;
# To closer match vmstat scanning statistics, only count isolate_both # To closer match vmstat scanning statistics, only count
# and isolate_inactive as scanning. isolate_active is rotation # inactive lru as scanning
# isolate_inactive == 1 if ($lru =~ /inactive_/) {
# isolate_active == 2
# isolate_both == 3
if ($isolate_mode != 2) {
$perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned;
if ($file =~ /_file/) { if ($lru =~ /_file/) {
$perprocesspid{$process_pid}->{HIGH_NR_FILE_SCANNED} += $nr_scanned; $perprocesspid{$process_pid}->{HIGH_NR_FILE_SCANNED} += $nr_scanned;
} else { } else {
$perprocesspid{$process_pid}->{HIGH_NR_ANON_SCANNED} += $nr_scanned; $perprocesspid{$process_pid}->{HIGH_NR_ANON_SCANNED} += $nr_scanned;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment