public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Herbert Poetzl <herbert@13thfloor.at>
Cc: Chris Rivera <cmrivera@ufl.edu>, linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE]  slab information utility
Date: Mon, 22 Sep 2003 01:17:18 -0400	[thread overview]
Message-ID: <1064207838.8888.241.camel@localhost> (raw)
In-Reply-To: <20030922044354.GA18855@DUK2.13thfloor.at>

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

On Mon, 2003-09-22 at 00:43, Herbert Poetzl wrote:

> what about checking at which position the space occurs?
> 
> at least to me it seems like pos < 20 would be okay
> for a space in the name  8-)

Not too pretty with the sscanf we do.  Or even possible -- how do we
differentiate between n spaces and the next delimiter followed by a
legal field?

Anyhow, Chris and I concocted a little patch.  Its not sexy but it
works.  Apply it and recompile -- let me know.

	Robert Love



[-- Attachment #2: slabtop-bogus-space-fix-rml-1.patch --]
[-- Type: text/x-patch, Size: 1691 bytes --]


 proc/slab.c |   20 ++++++++------------
 slabtop.c   |    5 +++++
 2 files changed, 13 insertions(+), 12 deletions(-)


diff -urN --exclude=CVS procps-cvs/proc/slab.c procps/proc/slab.c
--- procps-cvs/proc/slab.c	2003-09-21 23:01:59.816907168 -0400
+++ procps/proc/slab.c	2003-09-22 01:14:43.456249968 -0400
@@ -88,10 +88,8 @@
 			continue;
 	
 		curr = get_slabnode();
-		if (!curr) {
-			curr = NULL;
+		if (!curr)
 			break;
-		}
 
 		if (entries++ == 0)
 			*list = curr;
@@ -107,9 +105,9 @@
 				&curr->nr_slabs);
 
 		if (assigned < 8) {
-			fprintf(stderr, "unrecognizable data in slabinfo!\n");
-			curr = NULL;
-			break;
+			curr->obj_size = 0;
+			prev = curr;
+			continue;
 		}
 
 		if (curr->obj_size < stats->min_obj_size)
@@ -168,10 +166,8 @@
 		int assigned;
 
 		curr = get_slabnode();
-		if (!curr) {
-			curr = NULL;
+		if (!curr)
 			break;
-		}
 
 		if (entries++ == 0)
 			*list = curr;
@@ -186,9 +182,9 @@
 				&curr->pages_per_slab);
 
 		if (assigned < 6) {
-			fprintf(stderr, "unrecognizable data in slabinfo!\n");
-			curr = NULL;
-			break;
+			curr->obj_size = 0;
+			prev = curr;
+			continue;
 		}
 
 		if (curr->obj_size < stats->min_obj_size)
diff -urN --exclude=CVS procps-cvs/slabtop.c procps/slabtop.c
--- procps-cvs/slabtop.c	2003-09-21 23:01:59.822906256 -0400
+++ procps/slabtop.c	2003-09-22 01:12:58.069271224 -0400
@@ -330,6 +330,11 @@
 
 		curr = slab_list;
 		for (i = 0; i < rows - 8 && curr->next; i++) {
+			if (!curr->obj_size) {
+				curr = curr->next;
+				i--;
+				continue;
+			}
 			printw("%6d %6d %3d%% %7.2fK %6d %8d %9dK %-23s\n",
 				curr->nr_objs, curr->nr_active_objs, curr->use,
 				curr->obj_size / 1024.0, curr->nr_slabs,

  reply	other threads:[~2003-09-22  5:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-22  3:03 [ANNOUNCE] slab information utility Chris Rivera
2003-09-22  4:23 ` Herbert Poetzl
2003-09-22  4:39   ` Robert Love
2003-09-22  4:43     ` Herbert Poetzl
2003-09-22  5:17       ` Robert Love [this message]
2003-09-22 13:16         ` Herbert Poetzl
2003-09-22  5:18     ` Andrew Morton
2003-09-22  5:21       ` Robert Love
2003-09-22  5:17 ` William Lee Irwin III
2003-09-22  5:25   ` Robert Love
2003-09-22  5:45     ` Muli Ben-Yehuda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1064207838.8888.241.camel@localhost \
    --to=rml@tech9.net \
    --cc=cmrivera@ufl.edu \
    --cc=herbert@13thfloor.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox