[Crash-utility] Thoughts on swap_usage Crash extension?

Aaron Tomlin atomlin at redhat.com
Mon Feb 4 17:01:15 UTC 2013


Hi Dave, Bryn,

I've made some changes (see the attachments) to support the following:

	ARM, X86, X86_64, ALPHA, IA64 and S390

Unfortunately these are the only definitions I could find at the moment.
As per your suggestion, the command name has been changed to "pswap" which
is more appropriate and the extension displays the swap count in pages by default.
The '-k' option is added to display in kilobytes.

The latest version is here [1].

Cheers,

Aaron
---
[1]: https://github.com/aktlin115/crash-extension/blob/master/swap_usage.c

----- Original Message -----
From: "Dave Anderson" <anderson at redhat.com>
To: "Discussion list for crash utility usage, maintenance and development" <crash-utility at redhat.com>
Sent: Wednesday, January 30, 2013 2:41:21 PM
Subject: Re: [Crash-utility] Thoughts on swap_usage Crash extension?


Aaron,

Bryn's name change and pte_file() suggestion make good sense.

I also wonder if it's worth adding an option to alternatively display
the swap count in pages?  The only crash commands I can think of
off-hand that use kilobytes are the "ps" and "swap" commands, and
those were done that way because of the Linux commands of the same
name.  But when I want to see how much swap a process is using I 
do this to get a page count:

 crash> vm -p 1 | grep SWAP | wc -l
 382
 crash>

Or maybe just show both all the time?  Just a thought...

In any case, I've put the module in the crash extensions page as-is
for now.  When you're ready to update it, I'll just plug in your
latest-and-greatest version.

  http://people.redhat.com/anderson/extensions.html

Thanks,
  Dave

----- Original Message -----
> Hi Bryn,
> 
> Thanks for the feedback.
> I'll work on it. With regards to the name change, I think it's worth
> changing it to 'pswap'.
> 
> Cheers,
> Aaron
> 
> ----- Original Message -----
> From: "Bryn M. Reeves" <bmr at redhat.com>
> To: "Discussion list for crash utility usage, maintenance and
> development" <crash-utility at redhat.com>
> Cc: "Aaron Tomlin" <atomlin at redhat.com>
> Sent: Wednesday, January 30, 2013 1:51:35 PM
> Subject: Re: [Crash-utility] Thoughts on swap_usage Crash extension?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 01/30/2013 01:17 PM, Aaron Tomlin wrote:
> > I've made some changes [1] and included the help page, as per your
> > request. It's still x86_64 specific for now. What do you think?
> > [1]:
> > https://github.com/aktlin115/crash-extension/blob/master/swap_usage.c
> 
> Hi
> > 
> Aaron,
> 
> Extension looks useful. I was wondering about the name - would you
> consider renaming it as 'pswap'? It's less to type than swap_usage (as
> there's already a 'swap' command but nothing 'psw*').
> 
> For the _PAGE_FILE problem it might be possible to address this by
> providing a wrapper like the pte_file() interface defined by arch
> headers in the kernel sources.
> 
> There seem to be 11 arches (inc. x86 and powerpc) using (pte_val(pte)
> & _PAGE_FILE) idiom. Of the rest s390 has a well-commented explanation
> of its special cases and ARM uses a different name for the bit:
> 
> #define pte_file(pte)		(pte_val(pte) & L_PTE_FILE)
> 
> It seems like these could all be handled quite reasonably (actually
> the number that are identical maybe it's the case that this could be
> tidied up in the kernel so that arches that really need custom
> versions can override pte_file() but that's not really my area).
> 
> Regards,
> Bryn.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAlEJJWcACgkQ6YSQoMYUY97PKwCfa6ZuC2MuTrYa2E42WSEkBPjM
> 234An1RQFlRxrDFgMu/cxdhEMzfsRGGZ
> =VY7a
> -----END PGP SIGNATURE-----
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 

--
Crash-utility mailing list
Crash-utility at redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
-------------- next part --------------
A non-text attachment was scrubbed...
Name: display_in_pages_by_default.patch
Type: text/x-patch
Size: 3168 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20130204/f658ca4f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support_for_some_common_archs.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20130204/f658ca4f/attachment-0001.bin>


More information about the Crash-utility mailing list