From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31074 invoked by alias); 7 Jan 2015 19:48:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31057 invoked by uid 89); 7 Jan 2015 19:48:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout24.012.net.il Received: from mtaout24.012.net.il (HELO mtaout24.012.net.il) (80.179.55.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jan 2015 19:48:40 +0000 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NHT00700NGZUC00@mtaout24.012.net.il> for gdb-patches@sourceware.org; Wed, 07 Jan 2015 21:40:37 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NHT0016GNZPYY80@mtaout24.012.net.il>; Wed, 07 Jan 2015 21:40:37 +0200 (IST) Date: Wed, 07 Jan 2015 19:48:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Speed up "gdb -tui" output In-reply-to: To: Doug Evans Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <837fwy74ny.fsf@gnu.org> References: <83zj9v7urq.fsf@gnu.org> <83sifn7mpt.fsf@gnu.org> <83h9w278a9.fsf@gnu.org> <83bnma75yt.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00142.txt.bz2 > Date: Wed, 7 Jan 2015 11:30:37 -0800 > From: Doug Evans > Cc: gdb-patches > > I can't promise to have a patch ready before 7.9, but I'll put it > on my todo list. Thanks. > >> Note that while we do explicitly call *_unfiltered with single characters, > >> unfiltered output is not in itself broken up into single characters. > > > > Not sure what you mean by that. fputs_maybe_filtered, which is the > > workhorse of most of the output functions, explicitly writes out the > > stuff it gets one character at a time, by calling fputc_unfiltered. > > How's that not breaking output? > > fputs_maybe_filtered is the workhorse for filtered output, and > it early exists for a number of things, like stream != gdb_stdout. It is used both for gdb_stdout and for other streams. > Most unfiltered output goes straight to fputs_unfiltered (which is the > wrapper around the ui-file to_fputs method). Once again, I fail to see how this fact, which I certainly noticed already, helps to solve the problem. When fputs_maybe_filtered is called, we have no idea whether the text it gets is complete enough to flush the stream after we are done with it. That information is at higher levels. So we don't know whether to flush the stream after the direct call to fputs_unfiltered. > I see there is fputstr{,n}_unfiltered which does things a character > at a time but it looks like it is only used by MI. Grep for fputs_unfiltered callers, and you will see that there are much more calls with only 1 or 2 characters. Anyway, if we want to analyze the current callers and build our solution on that, we will be limited to what we currently have. Not sure if this is good or bad, but that's exactly what I am trying to do, and I still have some lose ends in the heuristics. But a general solution is not possible that way, because a general solution cannot depend on who does or doesn't call certain functions. That general solution is what looked hard to me.