Thread (5 messages) flat view 5 messages, 3 authors, 2015-08-14

Re: [PATCH] powerpc/xmon: Allow limiting the size of the paca display

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-08-12 09:47:17

On Wed, 2015-08-12 at 13:24 +0530, Anshuman Khandual wrote:
On 08/12/2015 12:27 PM, Michael Ellerman wrote:
quoted
@@ -2090,9 +2092,12 @@ static void dump_one_paca(int cpu)
 	printf(" %-*s = %s\n", 16, "present", cpu_present(cpu) ? "yes" : "no");
 	printf(" %-*s = %s\n", 16, "online", cpu_online(cpu) ? "yes" : "no");
 
+	i = 4; /* We always print the first four lines */
+
 #define DUMP(paca, name, format) \
-	printf(" %-*s = %#-*"format"\t(0x%lx)\n", 16, #name, 18, paca->name, \
-		offsetof(struct paca_struct, name));
+	if (!num_lines || i++ < num_lines)
All look good except the fact that we are using 0 to signify that
there is no limit to the number of lines. Is not it bit confusing ?
Maybe a bit, but it's the simplest option, and it's not uncommon for zero to
mean "no limit". chage(1) springs to mind as an example.

And in terms of xmon it's hardly the most confusing part :)

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help