Bug 13745 - memory tracepoints examples need updating
Summary: memory tracepoints examples need updating
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 17:44 UTC by David Smith
Modified: 2012-05-15 19:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2012-02-24 17:44:39 UTC
The systemtap.examples/memory/mmanonpage.stp and systemtap.examples/memory/mmfilepage.stp examples were originally developed against RHEL5 and use mm tracepoints. These tracepoints don't exist in current upstream kernels.  These examples should be updated.

The RHEL5 mm tracepoints (added by linux-2.6-mm-add-tracepoints.patch) were based on a preliminary upstream patches and went in the kernel in May of 2009.  The final upstream mm tracepoint patches went in the kernel in September of 2009.

Here are the final kernel mm tracepoint patches:

<https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4b4f278c030aa4b6ee0915f396e9a9478d92d610>
<https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e0fff1bd12469c45dab088e353d8882761387bb6>
<https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0d3d062a6e289e065bd0aa537a6806a1806bf8aa>
Comment 1 David Smith 2012-02-24 17:48:00 UTC
Note that bug #10604 added a system to the testsuite to test for the tracepoints existence before testing the scripts.  While this works, it also hid the failures.  If a kernel supports tracepoints (CONFIG_TRACEPOINTS=y), those example scripts should be tested.
Comment 2 David Smith 2012-03-01 16:48:17 UTC
Here's a list of the RHEL5 tracepoints and their current status vs RHEL6 and upstream kernels:

- mm_anon_cow, mm_anon_fault, mm_anon_pgin, mm_anon_unmap,
mm_anon_userfree: Present in RHEL5, RHEL6 (but not upstream). Used by
mmanonpage.stp.

- mm_directreclaim_reclaimall: Present in RHEL5, RHEL6 (but not
upstream).  Used by mmreclaim.stp.

- mm_directreclaim_reclaimzone: Present in RHEL5, RHEL6 (but not
upstream).  Unused by any example script.

- mm_filemap_cow, mm_filemap_fault, mm_filemap_unmap,
mm_filemap_userunmap: Present in RHEL5, RHEL6 (but not upstream).  Used
by mmfilepage.stp.

- mm_kernel_pagefault: x86 only, present in RHEL5, RHEL6 (but not
upstream).  Unused by any example script.

- mm_kswapd_runs: Present in RHEL5.  RHEL6 has mm_kswapd_ran, which
might be an equivalent.  Unused by any example script.

- mm_page_allocation: Present in RHEL5.  RHEL6 and upstream has
mm_page_alloc.  Used by mmanonpage.stp and mmfilepage.stp.

- mm_page_free: Present in RHEL5.  RHEL6 has mm_page_free_direct.
Upstream had mm_page_free_direct, recently changed to mm_page_free.
Used by mmanonpage.stp and mmfilepage.stp.

- mm_pagereclaim_free: Present in RHEL5, RHEL6 (but not upstream). Used
by mmreclaim.stp.

- mm_pagereclaim_pgout: Present in RHEL5 and RHEL6.  An upstream match
might be mm_vmscan_writepage.  Used by mmreclaim.stp and mmwriteback.stp.

- mm_pagereclaim_shrinkactive: Present in RHEL5 and RHEL6.  An upstream
match might be mm_vmscan_direct_reclaim_end?  Used by mmreclaim.stp.

- mm_pagereclaim_shrinkactive_a2a, mm_pagereclaim_shrinkactive_a2i,
mm_pagereclaim_shrinkinactive_i2a, mm_pagereclaim_shrinkinactive_i2i:
Present in RHEL5 only.  No RHEL6 or upstream matches found.  Used by
mmreclaim.stp.

- mm_pagereclaim_shrinkinactive: Present in RHEL5 and RHEL6.  An
upstream match might be mm_vmscan_lru_shrink_inactive?  Used by
mmreclaim.stp.

- mm_pagereclaim_shrinkzone: Present in RHEL5, RHEL6 (but not upstream).
 Unused by any example script.

- mm_pdflush_bgwriteout, mm_pdflush_kupdate: Present in RHEL5 only. No
RHEL6 or upstream matches found.  Used by mmwriteback.stp.
Comment 3 David Smith 2012-03-01 17:01:51 UTC
Here's the status of each example.  This assumes we map mm_page_allocation to mm_page_alloc and mm_page_free to mm_page_free_direct.

- mmanonpage.stp: On RHEL6, compiles.  For upstream kernels, still missing mm_anon_cow, mm_anon_fault, mm_anon_pgin, mm_anon_unmap, and mm_anon_userfree.

- mmfilepage.stp: On RHEL6, compiles.  For upstream kernels, still missing mm_filemap_cow, mm_filemap_fault, mm_filemap_unmap, and mm_filemap_userunmap.

- mmreclaim.stp: On RHEL6, missing mm_pagereclaim_shrinkactive_a2a, mm_pagereclaim_shrinkactive_a2i, mm_pagereclaim_shrinkinactive_i2a
and mm_pagereclaim_shrinkinactive_i2i.  It might be possible to rewrite the script a bit to make those tracepoints optional, but I'm not sure how useful the script would be at that point.

For upstream kernels, missing mm_directreclaim_reclaimall, mm_pagereclaim_free,
mm_pagereclaim_pgout, mm_pagereclaim_shrinkactive, mm_pagereclaim_shrinkactive_a2a, mm_pagereclaim_shrinkactive_a2i, mm_pagereclaim_shrinkinactive, mm_pagereclaim_shrinkinactive_i2a, and mm_pagereclaim_shrinkinactive_i2i.

- mmwriteback.stp: On RHEL6 and upstream kernels, missing mm_pagereclaim_pgout, mm_pdflush_bgwriteout, and mm_pdflush_kupdate.
Comment 4 David Smith 2012-04-12 18:09:06 UTC
Fixed in commit e0157be.  I've got mmanonpage.stp, mmfilepage.stp, and mmwriteback.stp updated for RHEL6 and upstream kernels. However, mmreclaim.stp was too RHEL5 specific to port forward.

The tracepoints used in mmwriteback.stp are quite a bit different, so we may need to hear from users if the modified script is still useful.
Comment 5 Frank Ch. Eigler 2012-05-15 12:44:23 UTC
The new mmwriteback.stp gives an semantic_error for kernel.trace("mm_pdflush_kupdate") on 2.6.32-246.el6.  What kernel version did that work for you with?
Comment 6 David Smith 2012-05-15 19:41:20 UTC
(In reply to comment #5)
> The new mmwriteback.stp gives an semantic_error for
> kernel.trace("mm_pdflush_kupdate") on 2.6.32-246.el6.  What kernel version did
> that work for you with?

Originally it worked for me with 2.6.32-220.7.1.el6.x86_64.  I just upgraded to 2.6.32-220.13.1.el6.x86_64 and it still works fine.