From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yh0-f43.google.com (mail-yh0-f43.google.com [209.85.213.43]) by dpdk.org (Postfix) with ESMTP id 889A95946 for ; Wed, 27 Aug 2014 15:49:43 +0200 (CEST) Received: by mail-yh0-f43.google.com with SMTP id 29so224029yhl.16 for ; Wed, 27 Aug 2014 06:53:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aj4Z4NEvo6rC5aQLvEk3I5VClhb/V93G0S/Gv7f5U4k=; b=MuDkfjlpvQcJCoxs2ZVQZa9Ur2eL7Xb32w4Y6hzAPrrCKBfL4Bz8CVaYi0SQh2EJ6q 9Ai2QsZ5vMVniNeNdYAHXxqg/eTiToto17NT0tUb6iMqdXkMukNF387c2VoU/WRL89Xf kTxNgd+yHUz9BD/v3xrVHEVj0u96Ka5USU/QBTS82CP+z2NL1kY7uaWEp6JuVwPgEpTg VRz4FQ+DAqJnujnFqXvj0fv+A2+3ua4kNmjyCZzUpJOjFXKU9kR502Hn7SYEAfj1kfHJ GNQP2UASyIWjBwSj8xipevH37Scmkz8pN4owqCGteNVh7YidV3e1KMXpoxxaLJo1c2SO Ms0w== X-Gm-Message-State: ALoCoQnbNuFBf79EkCTi6R4kIa+mMfo6v3yr7PlJuDvCudjMZPm6Wd3VKM27vrIUdzhrfS5bDNji MIME-Version: 1.0 X-Received: by 10.236.164.70 with SMTP id b46mr52057448yhl.16.1409147626941; Wed, 27 Aug 2014 06:53:46 -0700 (PDT) Received: by 10.170.96.213 with HTTP; Wed, 27 Aug 2014 06:53:46 -0700 (PDT) In-Reply-To: References: <1409062162-19575-1-git-send-email-david.marchand@6wind.com> <1409062162-19575-2-git-send-email-david.marchand@6wind.com> Date: Wed, 27 Aug 2014 08:53:46 -0500 Message-ID: From: Jay Rolette To: David Marchand Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 01/11] ixgbe: clean log messages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Aug 2014 13:49:43 -0000 Hi David, The updated output is definitely an improvement, but if you'll go with the first solution you described (adding \n in the log macro), it works much better for products using DPDK. For developer use, I think it ends up being a wash either way. At least for my product (embedded network appliance), we want to capture anything that is logging in syslog. The log macros in DPDK make that very reasonable to do, but if there are embedded newlines, it ends up screwing up log parsing when someone wants to process logs later. We end up having to remove all of those newlines, which makes it harder to merge as new releases coming out. I'm assuming most products have similar requirements for logging. That's at least been the case for the products I've been involved with over the years. If the PMDs are using PMD_LOG as a replacement macro for debugging printf's, I can see where this might be a little more pain, but having PMD_LOG is a lot more useful it if easily integrates with central logging facilities. Thanks, Jay On Tue, Aug 26, 2014 at 9:55 AM, David Marchand wrote: > Hello Jay, > > On Tue, Aug 26, 2014 at 4:23 PM, Jay Rolette > wrote: > >> Why are you adding newlines to log message strings? Shouldn't that be up >> to whatever the messages end up getting routed to? >> > > Actually, I wanted to have consistent log formats in the PMDs so that the > log messages displayed at runtime are aligned (and not bouncing with \n > before or after the log message). > There was two solutions from my point of view : > - either always add a \n in the log macro and remove all trailing \n > - do the opposite > > I preferred the latter as it let users of the macro set the message format > as they want. > > > Before this change : > > Configuring Port 0 (socket 1) > PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7f3e59cd8080 > hw_ring=0x7f3e59d02080 dma_addr=0x727702080 > > PMD: ixgbe_dev_tx_queue_setup(): Using simple tx code path > > PMD: ixgbe_dev_tx_queue_setup(): Vector tx enabled. > > PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7f3e59cd57c0 > hw_ring=0x7f3e59d12080 dma_addr=0x727712080 > > PMD: ixgbe_dev_rx_queue_setup(): Rx Burst Bulk Alloc Preconditions are > satisfied. Rx Burst Bulk Alloc function will be used on port=0, queue=0. > > PMD: ixgbe_dev_rx_queue_setup(): Vector rx enabled, please make sure RX > burst size no less than 32. > > > After this change : > > Configuring Port 0 (socket 1) > PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7fd47ecd8080 > hw_ring=0x7fd47ed02080 dma_addr=0x727702080 > PMD: ixgbe_dev_tx_queue_setup(): Using simple tx code path > PMD: ixgbe_dev_tx_queue_setup(): Vector tx enabled. > PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7fd47ecd57c0 > hw_ring=0x7fd47ed12080 dma_addr=0x727712080 > PMD: ixgbe_dev_rx_queue_setup(): Rx Burst Bulk Alloc Preconditions are > satisfied. Rx Burst Bulk Alloc function will be used on port=0, queue=0. > PMD: ixgbe_dev_rx_queue_setup(): Vector rx enabled, please make sure RX > burst size no less than 32. > Port 0: 90:E2:BA:29:DF:58 > > > -- > David Marchand >