2019-09-03 11:46:31

by Florian Schmidt

[permalink] [raw]
Subject: [PATCH 0/2] trace-vmscan-postprocess: fix parsing and output

This patch series updates trace-vmscan-postprocess.pl to work without
throwing warnings and errors which stem from updates to several trace
points.

3481c37ffa1d ("mm/vmscan: drop may_writepage and classzone_idx from
direct reclaim begin template") removed "may_writepage" from
mm_vmscan_direct_reclaim_begin, and 3b775998eca7
("include/trace/events/vmscan.h: drop zone id from kswapd tracepoints")
removed "zid" from mm_vmscan_wakeup_kswapd. The output of
mm_vmscan_lru_isolate and mm_vmscan_lru_shrink_active seems to never
have matched the format of the trace point output since they were
created, or at least for as long as I can tell. Patch 1 aligns the
format parsing of the perl script with the current output of the trace
points.

In addition, the tables that are printed by the script were not properly
aligned any more, so patch 2 fixes the spacing.

A side remark: parsing the trace output for mm_vmscan_lru_shrink_active
has been in the script ever since it was created in 2010, but at no
point the parsed output was ever used for anything. I updated the
parsing code now, but I wonder if we could just get rid of that part...

Florian Schmidt (2):
trace-vmscan-postprocess: sync with tracepoints updates
trace-vmscan-postprocess: fix output table spacing

.../postprocess/trace-vmscan-postprocess.pl | 29 +++++++++----------
1 file changed, 14 insertions(+), 15 deletions(-)

--
2.23.0.rc1


2019-09-04 20:44:25

by Daniel Jordan

[permalink] [raw]
Subject: Re: [PATCH 0/2] trace-vmscan-postprocess: fix parsing and output

On Tue, Sep 03, 2019 at 11:14:07AM +0000, Florian Schmidt wrote:
> This patch series updates trace-vmscan-postprocess.pl to work without
> throwing warnings and errors which stem from updates to several trace
> points.

Cc Yafang, who made (most of?) these updates.

> 3481c37ffa1d ("mm/vmscan: drop may_writepage and classzone_idx from
> direct reclaim begin template") removed "may_writepage" from
> mm_vmscan_direct_reclaim_begin, and 3b775998eca7
> ("include/trace/events/vmscan.h: drop zone id from kswapd tracepoints")
> removed "zid" from mm_vmscan_wakeup_kswapd. The output of
> mm_vmscan_lru_isolate and mm_vmscan_lru_shrink_active seems to never
> have matched the format of the trace point output since they were
> created, or at least for as long as I can tell. Patch 1 aligns the
> format parsing of the perl script with the current output of the trace
> points.

Thanks, patch 1 fixes the script for me for all tracepoints you touched.

> In addition, the tables that are printed by the script were not properly
> aligned any more, so patch 2 fixes the spacing.

Nit, not for Pages Scanned. With your series I get

Kswapd Kswapd Order Pages Pages Pages Pages
Instance Wakeups Re-wakeup Scanned Rclmed Sync-IO ASync-IO
kswapd0-175 1 0 253694 253691 3 129896 wake-0=1

> A side remark: parsing the trace output for mm_vmscan_lru_shrink_active
> has been in the script ever since it was created in 2010, but at no
> point the parsed output was ever used for anything. I updated the
> parsing code now, but I wonder if we could just get rid of that part...

I wonder if we shouldn't just get rid of the whole script, it's hard to
remember to keep in sync with vmscan changes and I can't think of a way to
remedy that short of having mm regression tests that run this. But your
patches are an improvement for now.

2019-09-05 04:41:19

by Yafang Shao

[permalink] [raw]
Subject: Re: [PATCH 0/2] trace-vmscan-postprocess: fix parsing and output

On Thu, Sep 5, 2019 at 4:42 AM Daniel Jordan <[email protected]> wrote:
>
> On Tue, Sep 03, 2019 at 11:14:07AM +0000, Florian Schmidt wrote:
> > This patch series updates trace-vmscan-postprocess.pl to work without
> > throwing warnings and errors which stem from updates to several trace
> > points.
>
> Cc Yafang, who made (most of?) these updates.
>

Yes, I made 3481c37ffa1d and 3b775998eca7 but didn't remeber to update
the scripts in the Document directory.
Thanks for improving it.

> > 3481c37ffa1d ("mm/vmscan: drop may_writepage and classzone_idx from
> > direct reclaim begin template") removed "may_writepage" from
> > mm_vmscan_direct_reclaim_begin, and 3b775998eca7
> > ("include/trace/events/vmscan.h: drop zone id from kswapd tracepoints")
> > removed "zid" from mm_vmscan_wakeup_kswapd. The output of
> > mm_vmscan_lru_isolate and mm_vmscan_lru_shrink_active seems to never
> > have matched the format of the trace point output since they were
> > created, or at least for as long as I can tell. Patch 1 aligns the
> > format parsing of the perl script with the current output of the trace
> > points.
>
> Thanks, patch 1 fixes the script for me for all tracepoints you touched.
>
> > In addition, the tables that are printed by the script were not properly
> > aligned any more, so patch 2 fixes the spacing.
>
> Nit, not for Pages Scanned. With your series I get
>
> Kswapd Kswapd Order Pages Pages Pages Pages
> Instance Wakeups Re-wakeup Scanned Rclmed Sync-IO ASync-IO
> kswapd0-175 1 0 253694 253691 3 129896 wake-0=1
>
> > A side remark: parsing the trace output for mm_vmscan_lru_shrink_active
> > has been in the script ever since it was created in 2010, but at no
> > point the parsed output was ever used for anything. I updated the
> > parsing code now, but I wonder if we could just get rid of that part...
>
> I wonder if we shouldn't just get rid of the whole script, it's hard to
> remember to keep in sync with vmscan changes and I can't think of a way to
> remedy that short of having mm regression tests that run this.

There are some similar scripts under tools/perf/scripts/, i.e.
compaction-times.py.
What about intergrating these vmscan scripts into perf/scripts as well ?
Something like vmscan-times.py...

> But your
> patches are an improvement for now.

Agreed.

Thanks
Yafang

2019-09-05 18:41:52

by Daniel Jordan

[permalink] [raw]
Subject: Re: [PATCH 0/2] trace-vmscan-postprocess: fix parsing and output

On Thu, Sep 05, 2019 at 12:32:49PM +0800, Yafang Shao wrote:
> On Thu, Sep 5, 2019 at 4:42 AM Daniel Jordan <[email protected]> wrote:
> > I wonder if we shouldn't just get rid of the whole script, it's hard to
> > remember to keep in sync with vmscan changes and I can't think of a way to
> > remedy that short of having mm regression tests that run this.
>
> There are some similar scripts under tools/perf/scripts/, i.e.
> compaction-times.py.
> What about intergrating these vmscan scripts into perf/scripts as well ?
> Something like vmscan-times.py...

Could be done, but I don't see how that makes it easier to keep in
sync...unless perf's tests are run regularly.

2019-09-11 10:46:31

by Florian Schmidt

[permalink] [raw]
Subject: Re: [PATCH 0/2] trace-vmscan-postprocess: fix parsing and output

Hi Daniel,

On 04/09/2019 21:42, Daniel Jordan wrote:
>> In addition, the tables that are printed by the script were not properly
>> aligned any more, so patch 2 fixes the spacing.
>
> Nit, not for Pages Scanned. With your series I get
>
> Kswapd Kswapd Order Pages Pages Pages Pages
> Instance Wakeups Re-wakeup Scanned Rclmed Sync-IO ASync-IO
> kswapd0-175 1 0 253694 253691 3 129896 wake-0=1

Whoops, you're right, I'll fix that in v2.


> I wonder if we shouldn't just get rid of the whole script, it's hard to
> remember to keep in sync with vmscan changes and I can't think of a way to
> remedy that short of having mm regression tests that run this. But your
> patches are an improvement for now.

That's definitely one possibility. If history has shown that these break
and aren't properly kept in line, they could go. Alternatively, as
Yafang suggested, integrating them into the perf test suite might help
with the issues.

I'll ignore that point for now though and just send a v2 for this patch
series.

Thanks for the feedback,
Florian