From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by dpdk.org (Postfix) with ESMTP id 202AF2C18 for ; Tue, 19 Dec 2017 17:01:34 +0100 (CET) Received: by mail-pl0-f68.google.com with SMTP id s3so7203090plp.4 for ; Tue, 19 Dec 2017 08:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8OIDWR6zUigJuLIJK2beFoA/oyHcF6iLzn/T0Y+zzpE=; b=RjjZuTR6z8MPwUXLLM2h56bdJSRzRuw3/JXIq0psoL5y9/XBqcW/7jL36R1dbacfyg v3r8wfdkDprcnivE7IsCdA478Eohj+MQX/YvCAEY7WaDiler6jzoMdFWNFazO/36nFwR V6sv2LnzMA5WhfXKy3BhGRGIRulEZJl91j2kafdS1xaezfHPiR13/2vLvJ5Z9U5hJa/i c9DCpvwJQfRb16G1QZ6Sby3ek/DY8owTVRd1xZ3drpfNSmqs2T9CbGUuwPyXW7czoePq o/I1shb2RKIR4j15J3HdInECp8GP5Gdo29UFpDpAxTTPc5ZdagWJJCvzboSiWDBFzy/X RKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8OIDWR6zUigJuLIJK2beFoA/oyHcF6iLzn/T0Y+zzpE=; b=IASJIbgk0LMAEvYrSxx4id4/eI74bgQOHtlrtOFi9QSnS7KKI9fDoDfUv6fBynh056 IW+H+BTKJg8m9Di6DsPT90Opl6v14o3pakHyJjlHNk+tBcJ9k/DjfvVQStqG5fHwOYcr YvLSleJ7yJ9/UUn1oDTkxNdSxoKUAoQB+SJVAuqa7PuyAgXUJQYPxTU/MVIXYInmEpNW 23ALwVMDZZ91V8wcAw2t3i7u21cSpPD5I8tgZ3YIjajzxBXfU+t9nAY3db14KdYDTPqV TMa4mLw0n1Y62RNA93lfi1ueZtzOoUWcN/GLfd8gYGV8b0sO3j5QGCNNy4T/X4zEgwia XH2g== X-Gm-Message-State: AKGB3mJbQyr0PSx9oKMcV5c5ADbRRAV8RV5D6tOx8bEAmWUiZxC7vU71 0rL9CfuK66etUrbySlY2iY9pN7n4ZB8= X-Google-Smtp-Source: ACJfBouP/dQAznnKWUJnOSvo0pkl/a5zU/UP67cHSUeDRmalcQBdFV+lXneNCgYSz7vgH+pxBR4U4A== X-Received: by 10.84.239.1 with SMTP id w1mr3664062plk.368.1513699292924; Tue, 19 Dec 2017 08:01:32 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id u19sm28112595pfh.89.2017.12.19.08.01.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 08:01:32 -0800 (PST) Date: Tue, 19 Dec 2017 08:01:29 -0800 From: Stephen Hemminger To: "Wiles, Keith" Cc: DPDK Message-ID: <20171219080129.0af9ab42@xeon-e3> In-Reply-To: <98763630-51EB-440B-934C-8489563F3AA2@intel.com> References: <96F900E1-45E4-4448-A876-5EC2B92E7E8D@intel.com> <20171219074427.2f6f4dfe@xeon-e3> <98763630-51EB-440B-934C-8489563F3AA2@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] Logging format and time stamping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 16:01:34 -0000 On Tue, 19 Dec 2017 15:51:09 +0000 "Wiles, Keith" wrote: > > On Dec 19, 2017, at 9:44 AM, Stephen Hemminger wrote: > >=20 > > On Tue, 19 Dec 2017 14:12:27 +0000 > > "Wiles, Keith" wrote: > > =20 > >> Hi all, > >>=20 > >> One other area with logging is we do not time stamp our logs to the sc= reen, which I feel is needed in some cases. The bigger area is figuring out= where the log message came from and greping the code is a bit hard in some= cases. > >>=20 > >> I would like to see more information in the log output with file and l= ine number of the log message with the time stamp. e.g. > >>=20 > >> [timestamp] pid function_name(filename:line) logid: log message > >>=20 > >>=20 > >> [ timestamp ] pid Function/file/line number Lid: Log messa= ge=20 > >> [ 14.039999] 49203 pkt_data_to_mbuf(pkt_mbufs.h:85) FNET: Failed a= ppend to mbuf too much data. > >>=20 > >> - The time stamp is from gettimeofday seconds.usecs formatted. Using a= relative time from application start. > >> - The pid is the process ID or logical core id in fixed %5d or some fi= xed width. > >> - Function/file/line number __func__(basename(__FILE__):__LINE__) usin= g a fixed width like %30s does not work in all cases but most. > >> - The lid is the LOG ID used(PMD, EAL, =E2=80=A6) and then the origina= l log message. > >>=20 > >> The timestamp helps determine when the message was created, but could = be turned off for normal use. The pid would be nice to know which thread or= lcore created the message. The bigger one is the function/file/line is the= one a would like to see most. Making some of the fields fixed length helps= align the messages. > >>=20 > >> What are your thoughts here? > >>=20 > >> Regards, > >> Keith > >> =20 > >=20 > > Syslog is where most real applications send their logging, and it alrea= dy does > > timestamping. =20 >=20 > Yes, I agree I forgot to add it was optional. The log messages currently = go the screen for me and I still need to see the timestamp instead of looki= ng in a log file. >=20 > Regards, > Keith >=20 Applications are also free to implement their own log output handler. Why not do that if you need something special.