Commit graph

82 commits

Author SHA1 Message Date
Oren Tirosh
8f2294477c py3: do not use "except Exception, e:" syntax 1.5
If catching the exception is done with "except Exception as e:" this
will work only from 2.6. To maintain backward compatibility with 2.4 I
have used sys.exc_info(). A bit of a wart, but it works.
2015-05-15 12:52:02 -05:00
Oren Tirosh
0deddadf88 py3: add () to print statements
It's a function call in 3.x and redundant parentheses around an
expression on 2.x. This works fine as long as all prints have just a
single argument. One print statement with two arguments was changed to
use % formatting instead.
2015-05-15 12:50:59 -05:00
Oren Tirosh
afc19f79b6 py3: stop using iterkeys() 2015-05-15 12:49:06 -05:00
Cybjit
272cb17cf9 smem: allow column auto-sizing 2014-11-18 20:01:16 -06:00
Cybjit
29fc357a31 showfields: complain about sets 2014-11-18 16:26:12 -06:00
Matt Mackall
02dabc0b86 rename filter to filters to make 2to3 happy 2014-07-15 01:33:26 -05:00
Matt Mackall
834dc815c8 switch file() to open() 2014-05-22 17:04:26 -05:00
Matt Mackall
966493301c Added tag 1.4 for changeset e143c8fdb6f5 2013-11-20 15:57:07 -05:00
Matt Mackall
02bda05e5b handle division by zero with no swap 1.4
Reported by Stefan Praszalowicz
2013-05-08 14:21:28 -05:00
Matt Mackall
9e788b26c6 drop unused import of grp 2013-04-22 17:21:03 -05:00
Matt Mackall
18a680345c Added tag 1.3 for changeset ee281c13f31d 2013-03-27 20:02:06 -07:00
Lo?c Minier
f8dee1586a avoid bogus warning on PSS measurement with empty smaps files 1.3 2013-03-27 20:01:07 -07:00
Matt Mackall
2346c2b075 fix handling of new fields in smaps
reported by Loic Minier
2013-02-22 14:03:46 -06:00
Jani Monoses
e570a14243 drop trailing slashes when looking up user/group in tar snapshots 2012-11-08 14:25:42 -06:00
Matt Mackall
9c057328ae update COPYING for FSF address change 2012-10-29 14:59:55 -05:00
Matt Mackall
f5f0a68c8a Added tag 1.2 for changeset 43b299004079 2012-10-09 18:38:40 -05:00
Paul Townsend
cf3da2ba2e Fix percentage display for swap 1.2 2011-12-08 15:59:19 -06:00
Paul Townsend
9bba73fa6d Count only filtered pids
If '-t' is specified and a filter such as '-U me' is specified, the
pid total displayed is the total number of pids instead of the number
of filtered pids.
2011-12-05 22:42:38 -06:00
Matt Mackall
ac741c5ce9 cache meminfo data 2011-12-05 14:55:39 -06:00
Matt Mackall
1961a6fedb Added tag 1.1 for changeset 26f344c53f55 2011-11-30 14:57:46 -06:00
Matt Mackall
d4406341a4 Be more forgiving of environment errors for memory and user views 1.1 2011-11-30 14:57:25 -06:00
Paul Townsend
80ef1d7e5e Store uid/gid/mtime for /proc directory capture 2011-08-22 16:10:10 -05:00
Paul Townsend
5d5d2dd183 Sort the output by "rss" when no "Pss" present in smaps. 2011-08-22 16:10:00 -05:00
Paul Townsend
76959e6b68 Properly convert uid/gid to string 2011-08-22 16:09:51 -05:00
Paul Townsend
323e6491c4 Grab uid info from /proc/<pid>/ stat 2011-08-22 16:09:17 -05:00
Paul Townsend
bc48175929 Catch KeyError on uid and gid conversion 2011-08-17 17:16:21 -04:00
Matt Mackall
0245f382ba Use /usr/bin/env to locate Python 2011-08-17 16:31:34 -05:00
Matt Mackall
0279ad465a Actively detect PSS support
Rather than checking the kernel version, look for PSS field when
parsing smaps data and issue a warning.

(based on a suggestion by Paul Townsend)
2011-08-17 13:49:33 -05:00
Matt Mackall
4cb161ea45 read process uid/gid from task rather than cmdline 2011-06-10 08:58:26 -05:00
Matt Mackall
27fe66a83c Add support for terabytes 2011-05-26 09:17:28 -05:00
Matt Mackall
5c14f57b31 Added tag 1.0 for changeset 4f6b9d5b28e8 2011-02-16 16:26:56 -06:00
Tim Bird
7b68171f07 Fix bug in pie chart logic 1.0
I was getting an error with pie charts on some systems
with very small memory usage.

$ smem -S data.tar --pie=command
Traceback (most recent call last):
  File "/usr/local/bin/smem", line 636, in <module>
    showpids()
  File "/usr/local/bin/smem", line 246, in showpids
    showtable(pt.keys(), fields, columns.split(), options.sort or 'pss')
  File "/usr/local/bin/smem", line 455, in showtable
    showpie(l, sort)
  File "/usr/local/bin/smem", line 498, in showpie
    while values and (t + values[-1 - c] < (tm * .02) or
IndexError: list index out of range

I traced it to a bug in showpie, where there's some confused
usage of a list index and list popping.

In showpie, c is used to index into the values in a while
loop that removes entries from the end of a sorted list,
and aggregates their values for use in an "other" entry,
added to the list before display.

Moving (and using) the index is wrong because the list is being
chopped from the end as we go.  This warps the value of 'other',
but under normal circumstances would probably not be noticeable
because these items have very small values.
However, if several items are popped, and the list is very short,
it can result in the list index error above.

Also, truncating the values and labels in the subsequent
conditional is redundant with the pop in the loop.

Below is a patch to fix these problems.
 -- Tim

---
 smem |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
2011-02-16 16:12:50 -06:00
Hynek Cernoch
e2c5ced39a Clean up some tabs 2010-12-13 22:33:05 +01:00
Hynek Cernoch
fc150ea960 Give hint about uncompressed kernels 2010-12-13 22:33:05 +01:00
Hynek Cernoch
b0a3fae0e7 Add note about --realmem usage to manpage 2010-12-13 22:33:05 +01:00
Hynek Cernoch
455466fb67 Fixed bug in realmem option 2010-12-13 22:33:05 +01:00
Yves Goergen
c082952423 Avoid tracebacks on disappearing processes 2011-02-16 16:01:38 -06:00
Johannes Stezenbach
3d21e5daf3 smemcap: fix compile warnings 2010-05-12 15:59:24 -05:00
Dean Peterson
4bd765bc0c man page patch, including embedded section mentioning smemcap
Here is a patch for the smem man page.  It includes the following:

 * A new section on embedded usage briefly describing smemcap
   NOTE: Someone please doublecheck it,
         since I am not an embedded developer.
 * Mentions that kernel image for -K option must be uncompressed.
 * A new copyright section.
 * A new resources section.
 * Replaces notes with a requirements section.
 * Adds a couple of commands to the see also list.
 * Fixes a couple typos.
2010-03-29 16:38:31 -05:00
Michal ?iha?
9ad7a9f60c Escape dashes in man page
there are two dashes in man page which were forgotten to be escaped.
Attached patch fixes it.
2010-01-02 15:53:04 +01:00
Matt Mackall
5777a0c9c3 Drop obsolete capture script 2010-03-29 16:19:21 -05:00
Matt Mackall
54ffd3fca7 Added tag 0.9 for changeset 708dd2e1b91a 2009-11-11 11:03:21 -06:00
lethargo
6877fc1daa add smem man page 0.9
A while back Matthew Miller asked about a man page for smem.  Here is a proposed start of one.
2009-07-15 17:16:34 -05:00
Matt Mackall
d3d782beb0 Fix _ucache some more 2009-07-06 15:20:41 -05:00
Matt Mackall
dbe27ffe29 Fix references to _ucache and _gcache 2009-07-06 15:20:05 -05:00
Matt Mackall
7650aa076d tar source: use usernames and groupnames from tarfile if available 2009-06-23 17:01:12 -05:00
Matt Mackall
a0447bc26b Fix some tar header issues for smemcap 2009-06-08 15:15:37 -05:00
Matt Mackall
c8bb8425b2 Make system memory reporting more robust
- totalmem should return kB when provided manually
- firmware size never goes below zero
- add comments
- calculate kernel portion of cached by subtracting mapped rather than
  anonymous
- get rid of sum() bits for silly column totals
2009-05-27 18:12:00 -05:00
Matt Mackall
383d6480df add smemcap tool 2009-05-22 17:31:54 -05:00
Matt Mackall
dac4809c06 be less picky about tar directories 2009-05-22 17:29:51 -05:00