From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v5 05/17] xenctx: Add command line option -D (--decode-as-ascii) Date: Fri, 21 Mar 2014 14:42:31 -0400 Message-ID: <532C8817.5020508@terremark.com> References: <1395342425-16260-1-git-send-email-dslutz@verizon.com> <1395342425-16260-6-git-send-email-dslutz@verizon.com> <1395412737.19839.112.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1395412737.19839.112.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , George Dunlap , Don Slutz , Ian Jackson , Don Slutz , xen-devel@lists.xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org On 03/21/14 10:38, Ian Campbell wrote: > On Thu, 2014-03-20 at 15:06 -0400, Don Slutz wrote: >> If specified, output ascii version of stack also. > I suppose this is optional because the result is >100 chars wide? > Otherwise making it unconditional would be a nobrainer. No not 100, but it does exceed 80 and from a previous email: -------- Original Message -------- Subject: Re: [PATCH v2 03/12] xenctx: Output ascii version of stack also. Date: Thu, 7 Nov 2013 12:43:14 +0000 From: Ian Campbell Organization: Citrix Systems, Inc. To: Jan Beulich CC: Don Slutz , Don Slutz , "George Dunlap" , Ian Jackson , Stefano Stabellini , xen-devel On Thu, 2013-11-07 at 08:09 +0000, Jan Beulich wrote: > >>> On 06.11.13 at 21:08, Don Slutz wrote: > > Why? I personally don't see a need - there's rarely much useful > ASCII data on the stack. This is true IME > So afaic: If at all, then only via command > line option defaulting to off. Well, assuming it doesn't make the output >80 columns (which I can't tell from here) it seems harmless enough? ... > >> printf(" "); >> print_stack_word(word, width); >> stack += width; >> } >> + if ( xenctx.decode_as_ascii ) >> + { >> + /* >> + * Line up ascii output if less than bytes_per_line >> + * were printed. >> + */ >> + for (k = j; k < xenctx.bytes_per_line / width; k++) >> + printf(" %*s", width * 2, ""); > Avoid the loop by using width*2*((xenctx.bytes_per_line / width)-j) ? > (or whatever the sums are) I could, but you also need to include the test some how (and as an "if" is almost the same). And for code that is only ever run a few times in a developer tool, I do not see that the speed or output "breakage" make a big difference. But if you really want this... > At some point in the future perhaps > https://plus.google.com/111319147897550904359/posts/cZ6QVUAMAhT > will be widespread enoguh that we can all stop with this sort of > thing... Well, I wish them good luck. Getting the right terminal width to happen 100% of the time when going through many remote hops, just does not happen to me. (local stuff is just so much simpler.) Also getting a table to look right with variable spacing and variable sized "characters" is very hard. Last I knew the technical writers still are hand adjusting things even now. -Don Slutz > Ian >